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');
assert(
compareArray(
Object.getOwnPropertyNames(result), ['get', 'set', 'enumerable', 'configurable']
)
assert.compareArray(
Object.getOwnPropertyNames(result),
['get', 'set', 'enumerable', 'configurable']
);
assert.sameValue(result.enumerable, false);
assert.sameValue(result.configurable, true);

View File

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

View File

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

View File

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

View File

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

View File

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