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

Side by Side Diff: test/mjsunit/strong/super.js

Issue 1138603003: [strong] Fix super in strong classes (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Enable super spread call tests Created 5 years, 7 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 | « test/mjsunit/strong/function-arity.js ('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 2015 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: --strong-mode --harmony-classes --allow-natives-syntax
6
7 'use strong';
8
9
10 function desc(obj, n) {
11 return Object.getOwnPropertyDescriptor(obj, n);
12 }
13
14
15 (function TestClass() {
16 class C {
17 m() {
18 super.x;
19 }
20 get x() {
21 super.x;
22 }
23 set y(_) {
24 super.x;
25 }
26 static m() {
27 super.x;
28 }
29 static get x() {
30 super.x;
31 }
32 static set y(_) {
33 super.x;
34 }
35 }
36
37 assertEquals(C.prototype, C.prototype.m[%HomeObjectSymbol()]);
38 assertEquals(C.prototype, desc(C.prototype, 'x').get[%HomeObjectSymbol()]);
39 assertEquals(C.prototype, desc(C.prototype, 'y').set[%HomeObjectSymbol()]);
40 assertEquals(C, C.m[%HomeObjectSymbol()]);
41 assertEquals(C, desc(C, 'x').get[%HomeObjectSymbol()]);
42 assertEquals(C, desc(C, 'y').set[%HomeObjectSymbol()]);
43 })();
44
45
46 (function TestObjectLiteral() {
47 let o = {
48 m() {
49 super.x;
50 },
51 get x() {
52 super.x;
53 },
54 set y(_) {
55 super.x;
56 }
57 };
58
59 assertEquals(o, o.m[%HomeObjectSymbol()]);
60 assertEquals(o, desc(o, 'x').get[%HomeObjectSymbol()]);
61 assertEquals(o, desc(o, 'y').set[%HomeObjectSymbol()]);
62 })();
OLDNEW
« no previous file with comments | « test/mjsunit/strong/function-arity.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698