Index: test/mjsunit/harmony/classes-experimental.js |
diff --git a/test/mjsunit/harmony/classes-experimental.js b/test/mjsunit/harmony/classes-experimental.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..42c219c49cf7d83620daf4be4971e4a6554f2ab2 |
--- /dev/null |
+++ b/test/mjsunit/harmony/classes-experimental.js |
@@ -0,0 +1,35 @@ |
+// 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: --experimental-classes --harmony-classes |
+ |
+'use strict'; |
+ |
+class Base { |
+ constructor() { |
+ let o = new Object(); |
+ o.prp = 1; |
+ return o; |
+ } |
+} |
+ |
+class Subclass extends Base { |
+ constructor() { |
+ try { |
+ this.prp1 = 3; |
+ } catch(e) { |
arv (Not doing code reviews)
2015/01/22 16:20:26
} catch (e) {
space after `catch`, just like `if`
Dmitry Lomov (no reviews)
2015/01/22 17:00:25
Done.
|
+ // TODO(dslomov): actually test the exception once TDZ is implemented. |
+ } |
+ super(); |
+ assertSame(1, this.prp); |
+ assertSame(undefined, this.prp1); |
+ assertFalse(this.hasOwnProperty("prp1")); |
+ return this; |
+ } |
+} |
+ |
+let s = new Subclass(); |
+assertSame(1, s.prp); |
+assertSame(undefined, s.prp1); |
+assertFalse(s.hasOwnProperty("prp1")); |