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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « src/builtins.cc ('k') | test/test262/test262.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Flags: --harmony-object-own-property-descriptors 5 // Flags: --harmony-object-own-property-descriptors
6 // Flags: --allow-natives-syntax 6 // Flags: --allow-natives-syntax
7 7
8 function DataDescriptor(value) { 8 function DataDescriptor(value) {
9 return { "enumerable": true, "configurable": true, "writable": true, value }; 9 return { "enumerable": true, "configurable": true, "writable": true, value };
10 } 10 }
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 value: "VALUE" 188 value: "VALUE"
189 }; 189 };
190 }, 190 },
191 get(target, name) { assertUnreachable(); }, 191 get(target, name) { assertUnreachable(); },
192 set(target, name, value) { assertUnreachable(); }, 192 set(target, name, value) { assertUnreachable(); },
193 deleteProperty(target, name) { assertUnreachable(); }, 193 deleteProperty(target, name) { assertUnreachable(); },
194 defineProperty(target, name, desc) { assertUnreachable(); } 194 defineProperty(target, name, desc) { assertUnreachable(); }
195 }); 195 });
196 196
197 var result = Object.getOwnPropertyDescriptors(P); 197 var result = Object.getOwnPropertyDescriptors(P);
198 assertEquals({ "A": undefined }, result); 198 assertEquals({
199 "A": {
200 "value": "VALUE",
201 "writable": false,
202 "enumerable": false,
203 "configurable": true
204 }
205 }, result);
199 assertTrue(result.hasOwnProperty("A")); 206 assertTrue(result.hasOwnProperty("A"));
200 assertEquals([ 207 assertEquals([
201 "ownKeys()", 208 "ownKeys()",
202 "getOwnPropertyDescriptor(A)", 209 "getOwnPropertyDescriptor(A)",
203 "getOwnPropertyDescriptor(A)" 210 "getOwnPropertyDescriptor(A)"
204 ], log); 211 ], log);
205 } 212 }
206 TestDuplicateKeys(); 213 TestDuplicateKeys();
214
215 function TestFakeProperty() {
216 var log = [];
217 var P = new Proxy({}, {
218 ownKeys() {
219 log.push(`ownKeys()`);
220 return ["fakeProperty"];
221 },
222 getOwnPropertyDescriptor(target, name) {
223 log.push(`getOwnPropertyDescriptor(${name})`);
224 return;
225 }
226 });
227 var result = Object.getOwnPropertyDescriptors(P);
228 assertEquals({}, result);
229 assertFalse(result.hasOwnProperty("fakeProperty"));
230 assertEquals([
231 "ownKeys()",
232 "getOwnPropertyDescriptor(fakeProperty)"
233 ], log);
234 }
235 TestFakeProperty();
OLDNEW
« 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