Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(28)

Unified Diff: test/mjsunit/harmony/object-get-own-property-descriptors.js

Issue 2118613003: [builtins] don't create keys for undefined property descriptors in O.gOPDs (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix test262.status Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/builtins.cc ('k') | test/test262/test262.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « src/builtins.cc ('k') | test/test262/test262.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698