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

Unified Diff: test/mjsunit/harmony/class-fields-async-syntax.js

Issue 2330473002: Class fields, part 3 (backends)
Patch Set: bytecode test Created 4 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/mjsunit/harmony/class-fields-arguments.js ('k') | test/mjsunit/harmony/class-fields-attributes.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/harmony/class-fields-async-syntax.js
diff --git a/test/mjsunit/harmony/class-fields-async-syntax.js b/test/mjsunit/harmony/class-fields-async-syntax.js
new file mode 100644
index 0000000000000000000000000000000000000000..990737294a65a682f2d3126a2c10c30927b905d9
--- /dev/null
+++ b/test/mjsunit/harmony/class-fields-async-syntax.js
@@ -0,0 +1,89 @@
+// Copyright 2016 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-class-fields --harmony-async-await
+
+{
+ class C {
+ async = 0;
+ }
+
+ let c = new C;
+ assertArrayEquals(['constructor'], Object.getOwnPropertyNames(C.prototype));
+ assertArrayEquals(['async'], Object.getOwnPropertyNames(c));
+}
+
+{
+ class C {
+ async;
+ }
+
+ let c = new C;
+ assertArrayEquals(['constructor'], Object.getOwnPropertyNames(C.prototype));
+ assertArrayEquals(['async'], Object.getOwnPropertyNames(c));
+}
+
+{
+ class C {
+ async = 0
+ }
+
+ let c = new C;
+ assertArrayEquals(['constructor'], Object.getOwnPropertyNames(C.prototype));
+ assertArrayEquals(['async'], Object.getOwnPropertyNames(c));
+}
+
+{
+ class C {
+ async
+ }
+
+ let c = new C;
+ assertArrayEquals(['constructor'], Object.getOwnPropertyNames(C.prototype));
+ assertArrayEquals(['async'], Object.getOwnPropertyNames(c));
+}
+
+{
+ class C {
+ static async = 0;
+ }
+
+ let c = new C;
+ assertArrayEquals(['constructor'], Object.getOwnPropertyNames(C.prototype));
+ assertTrue(C.hasOwnProperty('async'));
+ assertArrayEquals([], Object.getOwnPropertyNames(c));
+}
+
+{
+ class C {
+ static async;
+ }
+
+ let c = new C;
+ assertArrayEquals(['constructor'], Object.getOwnPropertyNames(C.prototype));
+ assertTrue(C.hasOwnProperty('async'));
+ assertArrayEquals([], Object.getOwnPropertyNames(c));
+}
+
+{
+ class C {
+ static async = 0
+ }
+
+ let c = new C;
+ assertArrayEquals(['constructor'], Object.getOwnPropertyNames(C.prototype));
+ assertTrue(C.hasOwnProperty('async'));
+ assertArrayEquals([], Object.getOwnPropertyNames(c));
+}
+
+{
+ class C {
+ static async
+ }
+
+ let c = new C;
+ assertArrayEquals(['constructor'], Object.getOwnPropertyNames(C.prototype));
+ assertTrue(C.hasOwnProperty('async'));
+ assertArrayEquals([], Object.getOwnPropertyNames(c));
+}
« no previous file with comments | « test/mjsunit/harmony/class-fields-arguments.js ('k') | test/mjsunit/harmony/class-fields-attributes.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698