Review feedback.

This commit is contained in:
Jordan Harband 2016-02-01 10:44:25 -08:00
parent cf578d5190
commit 0a5e8372aa
14 changed files with 36 additions and 21 deletions

View File

@ -3,7 +3,7 @@
/*--- /*---
description: Object.getOwnPropertyDescriptors should fail if given a null or undefined value description: Object.getOwnPropertyDescriptors should fail if given a null or undefined value
es7id: pending esid: pending
author: Jordan Harband author: Jordan Harband
---*/ ---*/

View File

@ -3,7 +3,7 @@
/*--- /*---
description: Object.getOwnPropertyDescriptors should have length 1 description: Object.getOwnPropertyDescriptors should have length 1
es7id: pending esid: pending
author: Jordan Harband author: Jordan Harband
includes: [propertyHelper.js] includes: [propertyHelper.js]
---*/ ---*/

View File

@ -3,7 +3,7 @@
/*--- /*---
description: Object.getOwnPropertyDescriptors should have name property with value 'getOwnPropertyDescriptors' description: Object.getOwnPropertyDescriptors should have name property with value 'getOwnPropertyDescriptors'
es7id: pending esid: pending
author: Jordan Harband author: Jordan Harband
includes: [propertyHelper.js] includes: [propertyHelper.js]
---*/ ---*/

View File

@ -3,7 +3,7 @@
/*--- /*---
description: Object.getOwnPropertyDescriptors should be writable, non-enumerable, and configurable description: Object.getOwnPropertyDescriptors should be writable, non-enumerable, and configurable
es7id: pending esid: pending
author: Jordan Harband author: Jordan Harband
includes: [propertyHelper.js] includes: [propertyHelper.js]
---*/ ---*/

View File

@ -3,16 +3,17 @@
/*--- /*---
description: Object.getOwnPropertyDescriptors does not see inherited properties. description: Object.getOwnPropertyDescriptors does not see inherited properties.
es7id: pending esid: pending
author: Jordan Harband author: Jordan Harband
---*/ ---*/
var F = function G() {}; var F = function () {};
F.prototype.a = {}; F.prototype.a = {};
F.prototype.b = {}; F.prototype.b = {};
var f = new F(); var f = new F();
f.b = {}; // shadow the prototype var bValue = {};
f.b = bValue; // shadow the prototype
Object.defineProperty(f, 'c', { Object.defineProperty(f, 'c', {
enumerable: false, enumerable: false,
configurable: true, configurable: true,
@ -28,15 +29,15 @@ assert.sameValue(!!result.c, true, 'c has a descriptor');
assert.sameValue(result.b.enumerable, true, 'b is enumerable'); assert.sameValue(result.b.enumerable, true, 'b is enumerable');
assert.sameValue(result.b.configurable, true, 'b is configurable'); assert.sameValue(result.b.configurable, true, 'b is configurable');
assert.sameValue(result.b.writable, true, 'b is writable'); assert.sameValue(result.b.writable, true, 'b is writable');
assert.sameValue(result.b.value, f.b, 'bs value is f.b'); assert.sameValue(result.b.value, bValue, 'bs value is `bValue`');
assert.sameValue(result.c.enumerable, false, 'c is enumerable'); assert.sameValue(result.c.enumerable, false, 'c is enumerable');
assert.sameValue(result.c.configurable, true, 'c is configurable'); assert.sameValue(result.c.configurable, true, 'c is configurable');
assert.sameValue(result.c.writable, false, 'c is writable'); assert.sameValue(result.c.writable, false, 'c is writable');
assert.sameValue(result.c.value, f.c, 'cs value is f.c'); assert.sameValue(result.c.value, f.c, 'cs value is `f.c`');
assert.sameValue( assert.sameValue(
Object.keys(result).length, Object.keys(result).length,
Object.getOwnPropertyNames(f).length, 2,
'result has same number of own property names as f' 'result has same number of own property names as f'
); );

View File

@ -0,0 +1,13 @@
// Copyright (C) 2016 Jordan Harband. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: Object.getOwnPropertyDescriptors should produce a normal object inheriting from Object.prototype
esid: pending
author: Jordan Harband
---*/
assert.sameValue(
Object.getPrototypeOf(Object.getOwnPropertyDescriptors({})),
Object.prototype
);

View File

@ -3,7 +3,7 @@
/*--- /*---
description: Object.getOwnPropertyDescriptors should perform observable operations in the correct order description: Object.getOwnPropertyDescriptors should perform observable operations in the correct order
es7id: pending esid: pending
author: Jordan Harband author: Jordan Harband
features: [Proxy] features: [Proxy]
---*/ ---*/
@ -42,4 +42,4 @@ var check = {
}; };
var proxy = new Proxy(object, new Proxy(handler, check)); var proxy = new Proxy(object, new Proxy(handler, check));
var result = Object.getOwnPropertyDescriptors(proxy); var result = Object.getOwnPropertyDescriptors(proxy);
assert.sameValue(log, "|ownKeys|getOwnPropertyDescriptor:a|getOwnPropertyDescriptor:b|getOwnPropertyDescriptor:c", log); assert.sameValue(log, "|ownKeys|getOwnPropertyDescriptor:a|getOwnPropertyDescriptor:b|getOwnPropertyDescriptor:c", 'log');

View File

@ -3,7 +3,7 @@
/*--- /*---
description: Object.getOwnPropertyDescriptors accepts boolean primitives. description: Object.getOwnPropertyDescriptors accepts boolean primitives.
es7id: pending esid: pending
author: Jordan Harband author: Jordan Harband
---*/ ---*/

View File

@ -3,7 +3,7 @@
/*--- /*---
description: Object.getOwnPropertyDescriptors accepts number primitives. description: Object.getOwnPropertyDescriptors accepts number primitives.
es7id: pending esid: pending
author: Jordan Harband author: Jordan Harband
---*/ ---*/

View File

@ -3,7 +3,7 @@
/*--- /*---
description: Object.getOwnPropertyDescriptors accepts string primitives. description: Object.getOwnPropertyDescriptors accepts string primitives.
es7id: pending esid: pending
author: Jordan Harband author: Jordan Harband
---*/ ---*/

View File

@ -3,7 +3,7 @@
/*--- /*---
description: Object.getOwnPropertyDescriptors accepts Symbol primitives. description: Object.getOwnPropertyDescriptors accepts Symbol primitives.
es7id: pending esid: pending
author: Jordan Harband author: Jordan Harband
features: [Symbol] features: [Symbol]
---*/ ---*/

View File

@ -2,8 +2,8 @@
// This code is governed by the BSD license found in the LICENSE file. // This code is governed by the BSD license found in the LICENSE file.
/*--- /*---
description: Object.getOwnPropertyDescriptors does not include Symbol keys. description: Object.getOwnPropertyDescriptors includes Symbol keys.
es7id: pending esid: pending
author: Jordan Harband author: Jordan Harband
features: [Symbol] features: [Symbol]
---*/ ---*/

View File

@ -4,8 +4,9 @@
/*--- /*---
description: > description: >
Object.getOwnPropertyDescriptors should not have its behavior impacted by modifications to the global property Object Object.getOwnPropertyDescriptors should not have its behavior impacted by modifications to the global property Object
es7id: pending esid: pending
author: Jordan Harband author: Jordan Harband
includes: [fnGlobalObject.js]
---*/ ---*/
function fakeObject() { function fakeObject() {
@ -14,7 +15,7 @@ function fakeObject() {
fakeObject.getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors; fakeObject.getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors;
fakeObject.keys = Object.keys; fakeObject.keys = Object.keys;
var global = Function('return this;')(); var global = fnGlobalObject();
global.Object = fakeObject; global.Object = fakeObject;
assert.sameValue(Object, fakeObject, 'Sanity check failed: could not modify the global Object'); assert.sameValue(Object, fakeObject, 'Sanity check failed: could not modify the global Object');

View File

@ -4,7 +4,7 @@
/*--- /*---
description: > description: >
Object.getOwnPropertyDescriptors should not have its behavior impacted by modifications to Object.getOwnPropertyDescriptor Object.getOwnPropertyDescriptors should not have its behavior impacted by modifications to Object.getOwnPropertyDescriptor
es7id: pending esid: pending
author: Jordan Harband author: Jordan Harband
---*/ ---*/