Index: test/mjsunit/harmony/class-fields-visibility.js |
diff --git a/test/mjsunit/harmony/class-fields-visibility.js b/test/mjsunit/harmony/class-fields-visibility.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..1debe14c5b6c95a080094fe0c4ce44678acbeecf |
--- /dev/null |
+++ b/test/mjsunit/harmony/class-fields-visibility.js |
@@ -0,0 +1,51 @@ |
+// 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 |
+ |
+{ |
+ class C { |
+ a = 0; |
+ get a() { return 1; } |
+ } |
+ |
+ let c = new C; |
+ assertEquals(0, c.a); |
+} |
+ |
+{ |
+ class C { |
+ get a() { return 1; } |
+ a = 0; |
+ } |
+ |
+ let c = new C; |
+ assertEquals(0, c.a); |
+} |
+ |
+{ |
+ class Base { |
+ get a() { return 1; } |
+ } |
+ |
+ class Derived extends Base { |
+ a = 0; |
+ } |
+ |
+ let c = new Derived; |
+ assertEquals(0, c.a); |
+} |
+ |
+{ |
+ class Base { |
+ a = 0; |
+ } |
+ |
+ class Derived extends Base { |
+ get a() { return 1; } |
+ } |
+ |
+ let c = new Derived; |
+ assertEquals(0, c.a); |
+} |