Updates to Proxy trap: ownKeys

This commit is contained in:
Rick Waldron 2017-08-04 11:56:15 -04:00
parent c0b520b8c9
commit 3ebd97ca9b
16 changed files with 44 additions and 40 deletions

View File

@ -1,11 +1,11 @@
// Copyright (C) 2015 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es6id: 9.5.12
esid: sec-proxy-object-internal-methods-and-internal-slots-ownpropertykeys
description: >
[[OwnPropertyKeys]] ( )
8. Let trapResultArray be Call(trap, handler, «target»).
7. Let trapResultArray be ? Call(trap, handler, « target »).
---*/
var _target, _handler;

View File

@ -1,11 +1,12 @@
// Copyright (C) 2015 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es6id: 9.5.12
esid: sec-proxy-object-internal-methods-and-internal-slots-ownpropertykeys
description: >
[[OwnPropertyKeys]] ( )
8. Let trapResultArray be Call(trap, handler, «target»).
7. Let trapResultArray be ? Call(trap, handler, « target »).
features: [Symbol]
---*/

View File

@ -1,7 +1,7 @@
// Copyright (C) 2015 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es6id: 9.5.12
esid: sec-proxy-object-internal-methods-and-internal-slots-ownpropertykeys
description: >
[[OwnPropertyKeys]] ( )

View File

@ -1,7 +1,7 @@
// Copyright (C) 2015 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es6id: 9.5.12
esid: sec-proxy-object-internal-methods-and-internal-slots-ownpropertykeys
description: >
If target is extensible, return the non-falsy trap result if target doesn't
contain any non-configurable keys.
@ -9,7 +9,7 @@ info: >
[[OwnPropertyKeys]] ( )
...
19. If extensibleTarget is true and targetNonconfigurableKeys is empty, then
15. If extensibleTarget is true and targetNonconfigurableKeys is empty, then
a. Return trapResult.
---*/

View File

@ -1,7 +1,7 @@
// Copyright (C) 2015 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es6id: 9.5.12
esid: sec-proxy-object-internal-methods-and-internal-slots-ownpropertykeys
description: >
If target is extensible, return the non-falsy trap result if it contains all
of target's non-configurable keys.
@ -9,7 +9,7 @@ info: >
[[OwnPropertyKeys]] ( )
...
22. If extensibleTarget is true, return trapResult.
18. If extensibleTarget is true, return trapResult.
---*/
var target = {};

View File

@ -1,7 +1,7 @@
// Copyright (C) 2015 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es6id: 9.5.12
esid: sec-proxy-object-internal-methods-and-internal-slots-ownpropertykeys
description: >
If target is not extensible, the result must contain all the keys of the own
properties of the target object.
@ -9,7 +9,7 @@ info: >
[[OwnPropertyKeys]] ( )
...
23. Repeat, for each key that is an element of targetConfigurableKeys,
19. For each key that is an element of targetConfigurableKeys, do
a. If key is not an element of uncheckedResultKeys, throw a TypeError
exception.
---*/

View File

@ -1,7 +1,7 @@
// Copyright (C) 2015 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es6id: 9.5.12
esid: sec-proxy-object-internal-methods-and-internal-slots-ownpropertykeys
description: >
If target is not extensible, the result can't contain keys names not
contained in the target object.
@ -9,7 +9,7 @@ info: >
[[OwnPropertyKeys]] ( )
...
24. If uncheckedResultKeys is not empty, throw a TypeError exception.
20. If uncheckedResultKeys is not empty, throw a TypeError exception.
---*/
var target = {

View File

@ -1,7 +1,7 @@
// Copyright (C) 2015 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es6id: 9.5.12
esid: sec-proxy-object-internal-methods-and-internal-slots-ownpropertykeys
description: >
If target is not extensible, the result must contain all the keys of the own
properties of the target object and no other values
@ -9,7 +9,7 @@ info: >
[[OwnPropertyKeys]] ( )
...
25. Return trapResult.
21. Return trapResult.
---*/
var target = {

View File

@ -1,7 +1,7 @@
// Copyright (C) 2015 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es6id: 9.5.12
esid: sec-proxy-object-internal-methods-and-internal-slots-ownpropertykeys
description: >
[[OwnPropertyKeys]] ( )

View File

@ -1,7 +1,7 @@
// Copyright (C) 2015 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es6id: 9.5.12
esid: sec-proxy-object-internal-methods-and-internal-slots-ownpropertykeys
description: >
The result List must contain the keys of all non-configurable own properties
of the target object.
@ -9,9 +9,10 @@ info: >
[[OwnPropertyKeys]] ( )
...
21. Repeat, for each key that is an element of targetNonconfigurableKeys,
17. For each key that is an element of targetNonconfigurableKeys, do
a. If key is not an element of uncheckedResultKeys, throw a TypeError
exception.
---*/
var target = {

View File

@ -1,19 +1,16 @@
// Copyright (C) 2015 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es6id: 9.5.12
esid: sec-proxy-object-internal-methods-and-internal-slots-ownpropertykeys
description: >
Trap returns abrupt.
info: >
[[OwnPropertyKeys]] ( )
...
8. Let trapResultArray be Call(trap, handler, «target»).
9. Let trapResult be CreateListFromArrayLike(trapResultArray, «String, Symbol»).
7.3.17 CreateListFromArrayLike (obj [, elementTypes] )
7. Let trapResultArray be ? Call(trap, handler, « target »).
8. Let trapResult be ? CreateListFromArrayLike(trapResultArray, « String, Symbol »).
1. ReturnIfAbrupt(obj).
...
---*/
var p = new Proxy({}, {

View File

@ -2,7 +2,6 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-proxy-object-internal-methods-and-internal-slots-ownpropertykeys
es6id: 9.5.12
description: >
If return is not a list object, throw a TypeError exception (honoring
the Realm of the current execution context)
@ -13,10 +12,11 @@ info: |
Symbol »).
...
#sec-createlistfromarraylike
7.3.17 CreateListFromArrayLike (obj [, elementTypes] )
...
3. If Type(obj) is not Object, throw a TypeError exception.
2. If Type(obj) is not Object, throw a TypeError exception.
features: [Symbol]
---*/

View File

@ -1,18 +1,22 @@
// Copyright (C) 2015 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es6id: 9.5.12
esid: sec-proxy-object-internal-methods-and-internal-slots-ownpropertykeys
description: >
If return is not a list object, throw a TypeError exception
info: >
[[OwnPropertyKeys]] ( )
8. Let trapResultArray be Call(trap, handler, «target»).
9. Let trapResult be CreateListFromArrayLike(trapResultArray, «String,
Symbol»).
7. Let trapResultArray be ? Call(trap, handler, « target »).
8. Let trapResult be ? CreateListFromArrayLike(trapResultArray, « String,
Symbol »).
...
7.3.17 CreateListFromArrayLike (obj [, elementTypes] )
3. If Type(obj) is not Object, throw a TypeError exception.
#sec-createlistfromarraylike
7.3.17 CreateListFromArrayLike (obj [, elementTypes] )
2. If Type(obj) is not Object, throw a TypeError exception.
features: [Symbol]
---*/

View File

@ -2,7 +2,6 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-proxy-object-internal-methods-and-internal-slots-ownpropertykeys
es6id: 9.5.12
description: >
Throws if trap is not callable (honoring the Realm of the current execution
context)
@ -12,9 +11,10 @@ info: |
5. Let trap be GetMethod(handler, "ownKeys").
...
#sec-getmethod
7.3.9 GetMethod (O, P)
5. If IsCallable(func) is false, throw a TypeError exception.
4. If IsCallable(func) is false, throw a TypeError exception.
---*/
var OProxy = $262.createRealm().global.Proxy;

View File

@ -1,18 +1,19 @@
// Copyright (C) 2015 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es6id: 9.5.12
esid: sec-proxy-object-internal-methods-and-internal-slots-ownpropertykeys
description: >
Trap is not callable.
info: >
[[OwnPropertyKeys]] ( )
5. Let trap be GetMethod(handler, "ownKeys").
5. Let trap be ? GetMethod(handler, "ownKeys").
...
#sec-getmethod
7.3.9 GetMethod (O, P)
5. If IsCallable(func) is false, throw a TypeError exception.
4. If IsCallable(func) is false, throw a TypeError exception.
---*/
var p = new Proxy({attr:1}, {

View File

@ -1,11 +1,11 @@
// Copyright (C) 2015 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es6id: 9.5.12
esid: sec-proxy-object-internal-methods-and-internal-slots-ownpropertykeys
description: >
[[OwnPropertyKeys]] ( )
7. If trap is undefined, then Return target.[[OwnPropertyKeys]]()
6. If trap is undefined, then Return target.[[OwnPropertyKeys]]()
---*/
var target = {