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: --expose-wasm | 5 // Flags: --expose-wasm |
6 | 6 |
| 7 'use strict'; |
| 8 |
7 // Basic tests. | 9 // Basic tests. |
8 | 10 |
9 var outOfUint32RangeValue = 1e12; | 11 var outOfUint32RangeValue = 1e12; |
10 var int32ButOob = 1073741824; | 12 var int32ButOob = 1073741824; |
11 | 13 |
12 function assertTableIsValid(table) { | 14 function assertTableIsValid(table) { |
13 assertSame(WebAssembly.Table.prototype, table.__proto__); | 15 assertSame(WebAssembly.Table.prototype, table.__proto__); |
14 assertSame(WebAssembly.Table, table.constructor); | 16 assertSame(WebAssembly.Table, table.constructor); |
15 assertTrue(table instanceof Object); | 17 assertTrue(table instanceof Object); |
16 assertTrue(table instanceof WebAssembly.Table); | 18 assertTrue(table instanceof WebAssembly.Table); |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 (function TestMaximumDoesHasProperty() { | 88 (function TestMaximumDoesHasProperty() { |
87 var hasPropertyWasCalled = false; | 89 var hasPropertyWasCalled = false; |
88 var desc = {element: "anyfunc", initial: 10}; | 90 var desc = {element: "anyfunc", initial: 10}; |
89 var proxy = new Proxy({maximum: 16}, { | 91 var proxy = new Proxy({maximum: 16}, { |
90 has: function(target, name) { hasPropertyWasCalled = true; } | 92 has: function(target, name) { hasPropertyWasCalled = true; } |
91 }); | 93 }); |
92 Object.setPrototypeOf(desc, proxy); | 94 Object.setPrototypeOf(desc, proxy); |
93 let table = new WebAssembly.Table(desc); | 95 let table = new WebAssembly.Table(desc); |
94 assertTableIsValid(table); | 96 assertTableIsValid(table); |
95 })(); | 97 })(); |
OLD | NEW |