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

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

Issue 584993002: ES6: Implement object literal property shorthand (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: git rebase Created 6 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 | « test/cctest/test-parsing.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/object-literals-property-shorthand.js
diff --git a/test/mjsunit/harmony/object-literals-property-shorthand.js b/test/mjsunit/harmony/object-literals-property-shorthand.js
new file mode 100644
index 0000000000000000000000000000000000000000..2921495d892fba40e7f111fa0250b50777a75849
--- /dev/null
+++ b/test/mjsunit/harmony/object-literals-property-shorthand.js
@@ -0,0 +1,51 @@
+// Copyright 2014 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Flags: --harmony-object-literals
+
+
+(function TestBasics() {
+ var x = 1;
+ var object = {x};
+ assertEquals(1, object.x);
+})();
+
+
+(function TestDescriptor() {
+ var x = 1;
+ var object = {x};
+ var descr = Object.getOwnPropertyDescriptor(object, 'x');
+ assertEquals(1, descr.value);
+ assertTrue(descr.enumerable);
+ assertTrue(descr.writable);
+ assertTrue(descr.configurable);
+})();
+
+
+(function TestNotDefined() {
+ 'use strict';
+ assertThrows(function() {
+ return {notDefined};
+ }, ReferenceError);
+})();
+
+
+(function TestLet() {
+ var let = 1;
+ var object = {let};
+ assertEquals(1, object.let);
+})();
+
+
+(function TestYieldInFunction() {
+ var yield = 1;
+ var object = {yield};
+ assertEquals(1, object.yield);
+})();
+
+
+(function TestToString() {
+ function f(x) { return {x}; }
+ assertEquals('function f(x) { return {x}; }', f.toString());
+})();
« no previous file with comments | « test/cctest/test-parsing.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698