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

Side by Side Diff: test/mjsunit/harmony/object-literals-property-shorthand.js

Issue 858673002: Fix issue with __proto__ when using ES6 object literals (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: git rebase Created 5 years, 11 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
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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-literals 5 // Flags: --harmony-object-literals
6 6
7 7
8 (function TestBasics() { 8 (function TestBasics() {
9 var x = 1; 9 var x = 1;
10 var object = {x}; 10 var object = {x};
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 var yield = 1; 42 var yield = 1;
43 var object = {yield}; 43 var object = {yield};
44 assertEquals(1, object.yield); 44 assertEquals(1, object.yield);
45 })(); 45 })();
46 46
47 47
48 (function TestToString() { 48 (function TestToString() {
49 function f(x) { return {x}; } 49 function f(x) { return {x}; }
50 assertEquals('function f(x) { return {x}; }', f.toString()); 50 assertEquals('function f(x) { return {x}; }', f.toString());
51 })(); 51 })();
52
53
54 (function TestProtoName() {
55 var __proto__ = 1;
56 var object = {
57 __proto__
58 };
59 assertEquals(Object.prototype, Object.getPrototypeOf(object));
60 assertEquals(1, object.__proto__);
61 })();
62
63
64 (function TestProtoName2() {
65 var __proto__ = 1;
66 var p = {};
67 var object = {
68 __proto__: p,
69 __proto__,
70 };
71 assertEquals(p, Object.getPrototypeOf(object));
72 assertEquals(1, object.__proto__);
73 })();
OLDNEW
« no previous file with comments | « test/mjsunit/harmony/object-literals-method.js ('k') | test/mjsunit/object-literal-multiple-proto-fields.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698