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

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

Issue 1307223002: [es6] fix nested object literals with computed property names (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 4 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
« src/ast.cc ('K') | « 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/es6/computed-property-names.js
diff --git a/test/mjsunit/es6/computed-property-names.js b/test/mjsunit/es6/computed-property-names.js
index 80a047cc9cd3491aca0d9d9bacd390329e08606a..8c1aeb52af756480042ac174055f4f2c4f9a1caa 100644
--- a/test/mjsunit/es6/computed-property-names.js
+++ b/test/mjsunit/es6/computed-property-names.js
@@ -298,3 +298,14 @@ function ID(x) {
};
}, MyError);
})();
+
+
+(function TestNestedLiteral() {
+ var key = "test";
+ for (var i = 0; i < 10; ++i) {
+ assertEquals(i, ({ a: { [key + i]: i } }).a[key + i]);
+ assertEquals(i, ({ a: { b: { [key + i]: i } } }).a.b[key + i]);
+ assertEquals(i, ([ { [key + i]: i } ])[0][key + i]);
+ assertEquals(i, ([ { b: { [key + i]: i } } ])[0].b[key + i]);
+ }
+})();
« src/ast.cc ('K') | « src/ast.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698