OLD | NEW |
---|---|
1 // Copyright 2015 the V8 project authors. All rights reserved. | 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 | 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 a = new Int32Array(100); | 7 var a = new Int32Array(100); |
8 a.__proto__ = null; | 8 a.__proto__ = null; |
9 | 9 |
10 function get(a) { | 10 function get(a) { |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
64 return a.length; | 64 return a.length; |
65 } | 65 } |
66 | 66 |
67 assertEquals(undefined, get(a)); | 67 assertEquals(undefined, get(a)); |
68 assertEquals(undefined, get(a)); | 68 assertEquals(undefined, get(a)); |
69 assertEquals(undefined, get(a)); | 69 assertEquals(undefined, get(a)); |
70 %OptimizeFunctionOnNextCall(get); | 70 %OptimizeFunctionOnNextCall(get); |
71 assertEquals(undefined, get(a)); | 71 assertEquals(undefined, get(a)); |
72 })(); | 72 })(); |
73 | 73 |
74 // Ensure we cannot delete length, byteOffset, byteLength. | 74 // Ensure we cannot delete length, byteOffset, byteLength. |
arv (Not doing code reviews)
2015/06/15 16:23:12
I think this is invalid. Maybe justs file a bug an
Dan Ehrenberg
2015/06/15 23:28:35
Fixed it.
| |
75 assertTrue(Int32Array.prototype.hasOwnProperty("length")); | 75 assertTrue(Int32Array.prototype.__proto__.hasOwnProperty("length")); |
76 assertTrue(Int32Array.prototype.hasOwnProperty("byteOffset")); | 76 assertTrue(Int32Array.prototype.__proto__.hasOwnProperty("byteOffset")); |
77 assertTrue(Int32Array.prototype.hasOwnProperty("byteLength")); | 77 assertTrue(Int32Array.prototype.__proto__.hasOwnProperty("byteLength")); |
78 assertFalse(delete Int32Array.prototype.length); | 78 assertFalse(delete Int32Array.prototype.__proto__.length); |
79 assertFalse(delete Int32Array.prototype.byteOffset); | 79 assertFalse(delete Int32Array.prototype.__proto__.byteOffset); |
80 assertFalse(delete Int32Array.prototype.byteLength); | 80 assertFalse(delete Int32Array.prototype.__proto__.byteLength); |
81 | 81 |
82 a = new Int32Array(100); | 82 a = new Int32Array(100); |
83 | 83 |
84 get = function(a) { | 84 get = function(a) { |
85 return a.length; | 85 return a.length; |
86 } | 86 } |
87 | 87 |
88 assertEquals(100, get(a)); | 88 assertEquals(100, get(a)); |
89 assertEquals(100, get(a)); | 89 assertEquals(100, get(a)); |
90 assertEquals(100, get(a)); | 90 assertEquals(100, get(a)); |
(...skipping 12 matching lines...) Expand all Loading... | |
103 | 103 |
104 get = function(a) { | 104 get = function(a) { |
105 return a.byteOffset; | 105 return a.byteOffset; |
106 } | 106 } |
107 | 107 |
108 assertEquals(0, get(a)); | 108 assertEquals(0, get(a)); |
109 assertEquals(0, get(a)); | 109 assertEquals(0, get(a)); |
110 assertEquals(0, get(a)); | 110 assertEquals(0, get(a)); |
111 %OptimizeFunctionOnNextCall(get); | 111 %OptimizeFunctionOnNextCall(get); |
112 assertEquals(0, get(a)); | 112 assertEquals(0, get(a)); |
OLD | NEW |