Index: test/mjsunit/harmony/object-get-own-property-descriptors.js |
diff --git a/test/mjsunit/harmony/object-get-own-property-descriptors.js b/test/mjsunit/harmony/object-get-own-property-descriptors.js |
index 7f631d8e58f7ac10d04ca2b2961651117ac7693c..c71b20a226249dbbbe841387565ae9bd5748933f 100644 |
--- a/test/mjsunit/harmony/object-get-own-property-descriptors.js |
+++ b/test/mjsunit/harmony/object-get-own-property-descriptors.js |
@@ -195,7 +195,14 @@ function TestDuplicateKeys() { |
}); |
var result = Object.getOwnPropertyDescriptors(P); |
- assertEquals({ "A": undefined }, result); |
+ assertEquals({ |
+ "A": { |
+ "value": "VALUE", |
+ "writable": false, |
+ "enumerable": false, |
+ "configurable": true |
+ } |
+ }, result); |
assertTrue(result.hasOwnProperty("A")); |
assertEquals([ |
"ownKeys()", |
@@ -204,3 +211,25 @@ function TestDuplicateKeys() { |
], log); |
} |
TestDuplicateKeys(); |
+ |
+function TestFakeProperty() { |
+ var log = []; |
+ var P = new Proxy({}, { |
+ ownKeys() { |
+ log.push(`ownKeys()`); |
+ return ["fakeProperty"]; |
+ }, |
+ getOwnPropertyDescriptor(target, name) { |
+ log.push(`getOwnPropertyDescriptor(${name})`); |
+ return; |
+ } |
+ }); |
+ var result = Object.getOwnPropertyDescriptors(P); |
+ assertEquals({}, result); |
+ assertFalse(result.hasOwnProperty("fakeProperty")); |
+ assertEquals([ |
+ "ownKeys()", |
+ "getOwnPropertyDescriptor(fakeProperty)" |
+ ], log); |
+} |
+TestFakeProperty(); |