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

Side by Side Diff: test/mjsunit/harmony/class-fields-proxy.js

Issue 2330473002: Class fields, part 3 (backends)
Patch Set: bytecode test Created 4 years, 3 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
OLDNEW
(Empty)
1 // Copyright 2016 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: --harmony-class-fields
6
7 {
8 let effects = [];
9 let handler = {
10 defineProperty(){
11 effects.push(0);
12 return true;
13 },
14 get(){
15 throw 'called get';
16 },
17 set(){
18 throw 'called set';
19 }
20 };
21
22 class Base {
23 constructor(){
24 return new Proxy({}, handler);
25 }
26 }
27
28 class Derived extends Base {
29 a = 0;
30 }
31
32 new Derived;
33 assertArrayEquals([0], effects);
34 }
35
36 {
37 let handler = {
38 defineProperty(){
39 throw new Error;
40 }
41 };
42
43 class Base {
44 constructor(){
45 return new Proxy({}, handler);
46 }
47 }
48
49 class Derived extends Base {
50 a = 0;
51 }
52
53 assertThrows(() => new Derived);
54 }
OLDNEW
« no previous file with comments | « test/mjsunit/harmony/class-fields-function-name-inference.js ('k') | test/mjsunit/harmony/class-fields-scoping.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698