OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Flags: --allow-natives-syntax | |
6 | |
7 class A {} | 5 class A {} |
8 class B {} | 6 class B {} |
9 Object.assign(B, A); | 7 Object.assign(B, A); |
10 assertEquals("class B {}", B.toString()); | 8 assertEquals("class B {}", B.toString()); |
11 | |
12 (function() { | |
13 function f(a, i, v) { | |
14 a[i] = v; | |
15 } | |
16 | |
17 f("make it generic", 0, 0); | |
18 | |
19 var o = {foo: "foo"}; | |
20 %OptimizeObjectForAddingMultipleProperties(o, 10); | |
21 | |
22 var s = %CreatePrivateSymbol("priv"); | |
23 f(o, s, "private"); | |
24 %ToFastProperties(o); | |
25 | |
26 var desc = Object.getOwnPropertyDescriptor(o, s); | |
27 assertEquals("private", desc.value); | |
28 assertTrue(desc.writable); | |
29 assertFalse(desc.enumerable); | |
30 assertTrue(desc.configurable); | |
31 })(); | |
OLD | NEW |