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
es7id: pending
esid: pending
author: Jordan Harband
---*/

View File

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

View File

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

View File

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

View File

@ -3,16 +3,17 @@
/*---
description: Object.getOwnPropertyDescriptors does not see inherited properties.
es7id: pending
esid: pending
author: Jordan Harband
---*/
var F = function G() {};
var F = function () {};
F.prototype.a = {};
F.prototype.b = {};
var f = new F();
f.b = {}; // shadow the prototype
var bValue = {};
f.b = bValue; // shadow the prototype
Object.defineProperty(f, 'c', {
enumerable: false,
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.configurable, true, 'b is configurable');
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.configurable, true, 'c is configurable');
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(
Object.keys(result).length,
Object.getOwnPropertyNames(f).length,
2,
'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
es7id: pending
esid: pending
author: Jordan Harband
features: [Proxy]
---*/
@ -42,4 +42,4 @@ var check = {
};
var proxy = new Proxy(object, new Proxy(handler, check));
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.
es7id: pending
esid: pending
author: Jordan Harband
---*/

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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