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

Unified Diff: test/mjsunit/harmony/computed-property-names.js

Issue 1338413002: Version 4.5.103.33 (cherry-pick) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@4.5
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ast.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/harmony/computed-property-names.js
diff --git a/test/mjsunit/harmony/computed-property-names.js b/test/mjsunit/harmony/computed-property-names.js
index 36e141116930c7d028f2bffbdadaff1bc536e994..a559159380400ea730c6327c2949d3f335cce915 100644
--- a/test/mjsunit/harmony/computed-property-names.js
+++ b/test/mjsunit/harmony/computed-property-names.js
@@ -300,3 +300,59 @@ function ID(x) {
};
}, MyError);
})();
+
+
+(function TestNestedLiterals() {
+ var array = [
+ 42,
+ { a: 'A',
+ ['b']: 'B',
+ c: 'C',
+ [ID('d')]: 'D',
+ },
+ 43,
+ ];
+ assertEquals(42, array[0]);
+ assertEquals(43, array[2]);
+ assertEquals('A', array[1].a);
+ assertEquals('B', array[1].b);
+ assertEquals('C', array[1].c);
+ assertEquals('D', array[1].d);
+ var object = {
+ outer: 42,
+ inner: {
+ a: 'A',
+ ['b']: 'B',
+ c: 'C',
+ [ID('d')]: 'D',
+ },
+ outer2: 43,
+ };
+ assertEquals(42, object.outer);
+ assertEquals(43, object.outer2);
+ assertEquals('A', object.inner.a);
+ assertEquals('B', object.inner.b);
+ assertEquals('C', object.inner.c);
+ assertEquals('D', object.inner.d);
+ var object = {
+ outer: 42,
+ array: [
+ 43,
+ { a: 'A',
+ ['b']: 'B',
+ c: 'C',
+ [ID('d')]: 'D',
+ },
+ 44,
+ ],
+ outer2: 45
+ };
+ assertEquals(42, object.outer);
+ assertEquals(45, object.outer2);
+ assertEquals(43, object.array[0]);
+ assertEquals(44, object.array[2]);
+ assertEquals('A', object.array[1].a);
+ assertEquals('B', object.array[1].b);
+ assertEquals('C', object.array[1].c);
+ assertEquals('D', object.array[1].d);
+})();
« no previous file with comments | « src/ast.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698