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

Side by Side 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: Fix x64 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 unified diff | Download patch
« no previous file with comments | « src/x64/full-codegen-x64.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 //
5 // Flags: --experimental-classes --harmony-classes
6
7 'use strict';
8
9 class Base {
10 constructor() {
11 let o = new Object();
12 o.prp = 1;
13 return o;
14 }
15 }
16
17 class Subclass extends Base {
18 constructor() {
19 try {
20 this.prp1 = 3;
21 } catch (e) {
22 // TODO(dslomov): actually test the exception once TDZ is implemented.
23 }
24 super();
25 assertSame(1, this.prp);
26 assertSame(undefined, this.prp1);
27 assertFalse(this.hasOwnProperty("prp1"));
28 return this;
29 }
30 }
31
32 let s = new Subclass();
33 assertSame(1, s.prp);
34 assertSame(undefined, s.prp1);
35 assertFalse(s.hasOwnProperty("prp1"));
OLDNEW
« no previous file with comments | « src/x64/full-codegen-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698