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

Unified Diff: test/mjsunit/harmony/classes-experimental.js

Issue 803933008: new classes: change semantics of super(...) call and add new.target to construct stub. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Platform ports Created 5 years, 11 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/runtime/runtime-object.cc ('K') | « src/x64/full-codegen-x64.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/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..8e1b889683864f05f55919caac5f3b9096d41e0d
--- /dev/null
+++ b/test/mjsunit/harmony/classes-experimental.js
@@ -0,0 +1,33 @@
+// 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(ReferenceError) {}
arv (Not doing code reviews) 2015/01/21 19:18:56 This does not do what you think it does. Change i
Dmitry Lomov (no reviews) 2015/01/22 11:59:00 Right! Changed code, added a TODO to actually test
+ 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"));
« src/runtime/runtime-object.cc ('K') | « src/x64/full-codegen-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698