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

Side by Side Diff: test/mjsunit/harmony/object-literals-method.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
« no previous file with comments | « src/preparser.h ('k') | test/mjsunit/harmony/object-literals-property-shorthand.js » ('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 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 --allow-natives-syntax 5 // Flags: --harmony-object-literals --allow-natives-syntax
6 6
7 7
8 (function TestBasics() { 8 (function TestBasics() {
9 var object = { 9 var object = {
10 method() { 10 method() {
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 assertEquals(1, calls); 239 assertEquals(1, calls);
240 })(); 240 })();
241 241
242 242
243 (function TestGeneratorToString() { 243 (function TestGeneratorToString() {
244 var object = { 244 var object = {
245 *method() { yield 1; } 245 *method() { yield 1; }
246 }; 246 };
247 assertEquals('*method() { yield 1; }', object.method.toString()); 247 assertEquals('*method() { yield 1; }', object.method.toString());
248 })(); 248 })();
249
250
251 (function TestProtoName() {
252 var object = {
253 __proto__() {
254 return 1;
255 }
256 };
257 assertEquals(Object.prototype, Object.getPrototypeOf(object));
258 assertEquals(1, object.__proto__());
259 })();
260
261
262 (function TestProtoName2() {
263 var p = {};
264 var object = {
265 __proto__() {
266 return 1;
267 },
268 __proto__: p
269 };
270 assertEquals(p, Object.getPrototypeOf(object));
271 assertEquals(1, object.__proto__());
272 })();
OLDNEW
« no previous file with comments | « src/preparser.h ('k') | test/mjsunit/harmony/object-literals-property-shorthand.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698