Transform compareArray -> assert.compareArray: test/built-ins/Reflect/**/*.js (#3232)

This commit is contained in:
Rick Waldron 2021-10-05 22:33:22 -04:00 committed by GitHub
parent 891b7915bd
commit 0f47fe4528
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 17 additions and 25 deletions

View File

@ -45,10 +45,9 @@ Object.defineProperty(o1, 'p', {
var result = Reflect.getOwnPropertyDescriptor(o1, 'p'); var result = Reflect.getOwnPropertyDescriptor(o1, 'p');
assert( assert.compareArray(
compareArray( Object.getOwnPropertyNames(result),
Object.getOwnPropertyNames(result), ['get', 'set', 'enumerable', 'configurable'] ['get', 'set', 'enumerable', 'configurable']
)
); );
assert.sameValue(result.enumerable, false); assert.sameValue(result.enumerable, false);
assert.sameValue(result.configurable, true); assert.sameValue(result.configurable, true);

View File

@ -21,10 +21,9 @@ var o1 = {
var result = Reflect.getOwnPropertyDescriptor(o1, 'p'); var result = Reflect.getOwnPropertyDescriptor(o1, 'p');
assert( assert.compareArray(
compareArray( Object.getOwnPropertyNames(result),
Object.getOwnPropertyNames(result), ['value', 'writable', 'enumerable', 'configurable'] ['value', 'writable', 'enumerable', 'configurable']
)
); );
assert.sameValue(result.value, 'foo'); assert.sameValue(result.value, 'foo');
assert.sameValue(result.enumerable, true); assert.sameValue(result.enumerable, true);

View File

@ -27,10 +27,9 @@ o[s] = 42;
var result = Reflect.getOwnPropertyDescriptor(o, s); var result = Reflect.getOwnPropertyDescriptor(o, s);
assert( assert.compareArray(
compareArray( Object.getOwnPropertyNames(result),
Object.getOwnPropertyNames(result), ['value', 'writable', 'enumerable', 'configurable'] ['value', 'writable', 'enumerable', 'configurable']
)
); );
assert.sameValue(result.value, 42); assert.sameValue(result.value, 42);
assert.sameValue(result.enumerable, true); assert.sameValue(result.enumerable, true);

View File

@ -23,7 +23,4 @@ var o = Object.create(proto);
o.p1 = 42; o.p1 = 42;
o.p2 = 43; o.p2 = 43;
o.p3 = 44; o.p3 = 44;
assert( assert.compareArray(Reflect.ownKeys(o), ['p1', 'p2', 'p3'], 'return object own keys');
compareArray(Reflect.ownKeys(o), ['p1', 'p2', 'p3']),
'return object own keys'
);

View File

@ -15,10 +15,10 @@ includes: [compareArray.js]
features: [Reflect] features: [Reflect]
---*/ ---*/
assert(compareArray(Reflect.ownKeys({}), [])); assert.compareArray(Reflect.ownKeys({}), []);
var o = { var o = {
d: 42 d: 42
}; };
delete o.d; delete o.d;
assert(compareArray(Reflect.ownKeys(o), [])); assert.compareArray(Reflect.ownKeys(o), []);

View File

@ -15,15 +15,13 @@ includes: [compareArray.js]
features: [Reflect] features: [Reflect]
---*/ ---*/
assert( assert.compareArray(
compareArray(Reflect.ownKeys([]), ['length']), Reflect.ownKeys([]),
['length'],
'return non enumerable `length` from empty array' 'return non enumerable `length` from empty array'
); );
assert( assert.compareArray(Reflect.ownKeys([, , 2]), ['2', 'length'], 'return array keys');
compareArray(Reflect.ownKeys([, , 2]), ['2', 'length']),
'return array keys'
);
var o = {}; var o = {};
Object.defineProperty(o, 'p1', { Object.defineProperty(o, 'p1', {
@ -35,4 +33,4 @@ Object.defineProperty(o, 'p2', {
enumerable: false enumerable: false
}); });
assert(compareArray(Reflect.ownKeys(o), ['p1', 'p2'])); assert.compareArray(Reflect.ownKeys(o), ['p1', 'p2']);