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

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

Issue 1328083002: [es6] support `get` and `set` in shorthand properties (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase Created 5 years, 3 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 | « test/cctest/test-parsing.cc ('k') | test/mjsunit/harmony/destructuring.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 5
6 (function TestBasics() { 6 (function TestBasics() {
7 var x = 1; 7 var x = 1;
8 var object = {x}; 8 var object = {x};
9 assertEquals(1, object.x); 9 assertEquals(1, object.x);
10 })(); 10 })();
11 11
12 12
13 (function TestBasicsGetSet() {
14 var get = 1, set = 2;
15 var object = {get, set};
16 assertEquals(1, object.get);
17 assertEquals(2, object.set);
18 })();
19
20
13 (function TestDescriptor() { 21 (function TestDescriptor() {
14 var x = 1; 22 var x = 1;
15 var object = {x}; 23 var object = {x};
16 var descr = Object.getOwnPropertyDescriptor(object, 'x'); 24 var descr = Object.getOwnPropertyDescriptor(object, 'x');
17 assertEquals(1, descr.value); 25 assertEquals(1, descr.value);
18 assertTrue(descr.enumerable); 26 assertTrue(descr.enumerable);
19 assertTrue(descr.writable); 27 assertTrue(descr.writable);
20 assertTrue(descr.configurable); 28 assertTrue(descr.configurable);
21 })(); 29 })();
22 30
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 (function TestProtoName2() { 70 (function TestProtoName2() {
63 var __proto__ = 1; 71 var __proto__ = 1;
64 var p = {}; 72 var p = {};
65 var object = { 73 var object = {
66 __proto__: p, 74 __proto__: p,
67 __proto__, 75 __proto__,
68 }; 76 };
69 assertEquals(p, Object.getPrototypeOf(object)); 77 assertEquals(p, Object.getPrototypeOf(object));
70 assertEquals(1, object.__proto__); 78 assertEquals(1, object.__proto__);
71 })(); 79 })();
OLDNEW
« no previous file with comments | « test/cctest/test-parsing.cc ('k') | test/mjsunit/harmony/destructuring.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698