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

Side by Side Diff: test/mjsunit/object-literal.js

Issue 2445333002: Ensure slow properties for simple {__proto__:null} literals. (Closed)
Patch Set: Created 4 years, 1 month 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
« src/ast/ast.h ('K') | « src/ast/ast.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 set 5E0(_) {}, 253 set 5E0(_) {},
254 set 6e-0(_) {}, 254 set 6e-0(_) {},
255 set 7E-0(_) {}, 255 set 7E-0(_) {},
256 set 0x8(_) {}, 256 set 0x8(_) {},
257 set 0X9(_) {}, 257 set 0X9(_) {},
258 }); 258 });
259 TestNumericNamesSetter(['1.2', '1.3'], { 259 TestNumericNamesSetter(['1.2', '1.3'], {
260 set 1.2(_) {; }, 260 set 1.2(_) {; },
261 set 1.30(_) {; } 261 set 1.30(_) {; }
262 }); 262 });
263
264
265 (function TestLiteralWithNullProto() {
266 // Assume dictionary usage for simple null prototype literal objects,
267 // this is equivalent to Object.create(null).
268 var obj = {__proto__:null};
269 assertFalse(%HasFastProperties(obj));
adamk 2016/10/25 11:14:24 You'll need --allow-natives-syntax in Flags
Camillo Bruni 2017/03/13 17:21:44 arg, bitten by my own smart aliases that add these
270 assertEquals(Object.getPrototypeOf(obj), null);
271 // Once we add inline properties we probably don't want slow properties
272 // anymore.
273 var obj2 = {__proto__:null, a:1, b:2};
adamk 2016/10/25 11:14:24 Please add a test with computed properties and non
Camillo Bruni 2017/03/13 17:21:44 done.
274 assertTrue(%HasFastProperties(obj2));
275 assertEquals(Object.getPrototypeOf(obj2), null);
276
277 })()
OLDNEW
« src/ast/ast.h ('K') | « src/ast/ast.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698