OLD | NEW |
(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-private-class-fields |
| 6 |
| 7 var handler = { |
| 8 getPrototypeOf(){ throw 'Called getPrototypeOf'; }, |
| 9 setPrototypeOf(){ throw 'Called setPrototypeOf'; }, |
| 10 isExtensible(){ throw 'Called isExtensible'; }, |
| 11 preventExtensions(){ throw 'Called preventExtensions'; }, |
| 12 getOwnPropertyDescriptor(){ throw 'Called getOwnPropertyDescriptor'; }, |
| 13 defineProperty(){ throw 'Called defineProperty'; }, |
| 14 has(){ throw 'Called has'; }, |
| 15 get(){ throw 'Called get'; }, |
| 16 set(){ throw 'Called set'; }, |
| 17 deleteProperty(){ throw 'Called deleteProperty'; }, |
| 18 ownKeys(){ throw 'Called ownKeys'; }, |
| 19 apply(){ throw 'Called apply'; }, |
| 20 construct(){ throw 'Called construct'; } |
| 21 }; |
| 22 |
| 23 { |
| 24 class Base { |
| 25 constructor() { |
| 26 return new Proxy({}, handler); |
| 27 } |
| 28 } |
| 29 |
| 30 class Derived extends Base { |
| 31 #x = 0; |
| 32 static m(o){ return o.#x; } |
| 33 } |
| 34 |
| 35 assertEquals(0, Derived.m(new Derived)); |
| 36 } |
OLD | NEW |