OLD | NEW |
---|---|
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
rossberg
2015/06/15 12:09:11
This should be merged into harmony/private.js
wingo
2015/06/16 07:09:45
Done.
| |
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 | 5 // Flags: --allow-natives-syntax |
6 | 6 |
7 var s = %CreatePrivateOwnSymbol("s"); | 7 var s = %CreatePrivateSymbol("s"); |
8 var s1 = %CreatePrivateOwnSymbol("s1"); | 8 var s1 = %CreatePrivateSymbol("s1"); |
9 | 9 |
10 function TestSimple() { | 10 function TestSimple() { |
11 var p = {} | 11 var p = {} |
12 p[s] = "moo"; | 12 p[s] = "moo"; |
13 | 13 |
14 var o = Object.create(p); | 14 var o = Object.create(p); |
15 | 15 |
16 assertEquals(undefined, o[s]); | 16 assertEquals(undefined, o[s]); |
17 assertEquals("moo", p[s]); | 17 assertEquals("moo", p[s]); |
18 | 18 |
(...skipping 27 matching lines...) Expand all Loading... | |
46 // Test non-monomorphic. | 46 // Test non-monomorphic. |
47 for (var i = 0; i < 1000; i++) { | 47 for (var i = 0; i < 1000; i++) { |
48 var oNew = Object.create(p); | 48 var oNew = Object.create(p); |
49 oNew["s" + i] = i; | 49 oNew["s" + i] = i; |
50 oNew[s1] = "bow-wow"; | 50 oNew[s1] = "bow-wow"; |
51 checkNonOwn(oNew); | 51 checkNonOwn(oNew); |
52 } | 52 } |
53 } | 53 } |
54 | 54 |
55 TestICs(); | 55 TestICs(); |
OLD | NEW |