Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(343)

Side by Side Diff: test/mjsunit/wasm/memory.js

Issue 2367673003: [wasm] Do a proper HasProperty() check in the memory and table setup. (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« src/wasm/wasm-js.cc ('K') | « src/wasm/wasm-js.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 // Basic tests. 7 // Basic tests.
8 8
9 var outOfUint32RangeValue = 1e12; 9 var outOfUint32RangeValue = 1e12;
10 10
(...skipping 24 matching lines...) Expand all
35 })(); 35 })();
36 36
37 (function TestConstructorWithMaximum() { 37 (function TestConstructorWithMaximum() {
38 let memory = new WebAssembly.Memory({initial: 1, maximum: 10}); 38 let memory = new WebAssembly.Memory({initial: 1, maximum: 10});
39 assertSame(WebAssembly.Memory.prototype, memory.__proto__); 39 assertSame(WebAssembly.Memory.prototype, memory.__proto__);
40 assertSame(WebAssembly.Memory, memory.constructor); 40 assertSame(WebAssembly.Memory, memory.constructor);
41 assertTrue(memory instanceof Object); 41 assertTrue(memory instanceof Object);
42 assertTrue(memory instanceof WebAssembly.Memory); 42 assertTrue(memory instanceof WebAssembly.Memory);
43 })(); 43 })();
44 44
45 (function TestInitialIsUndefined() {
Franzi 2016/09/23 17:23:28 I think this test passes without your change as we
ahaas 2016/09/26 09:19:12 Done, and I also added many more tests.
46 // New memory with initial = undefined, which means initial = 0.
47 let memory = new WebAssembly.Memory({initial: undefined});
48 assertSame(WebAssembly.Memory.prototype, memory.__proto__);
49 assertSame(WebAssembly.Memory, memory.constructor);
50 assertTrue(memory instanceof Object);
51 assertTrue(memory instanceof WebAssembly.Memory);
52 })();
53
45 (function TestBuffer() { 54 (function TestBuffer() {
46 let memory = new WebAssembly.Memory({initial: 1}); 55 let memory = new WebAssembly.Memory({initial: 1});
47 assertTrue(memory.buffer instanceof Object); 56 assertTrue(memory.buffer instanceof Object);
48 assertTrue(memory.buffer instanceof ArrayBuffer); 57 assertTrue(memory.buffer instanceof ArrayBuffer);
49 assertThrows(() => {'use strict'; memory.buffer = memory.buffer}, TypeError) 58 assertThrows(() => {'use strict'; memory.buffer = memory.buffer}, TypeError)
50 assertThrows(() => ({__proto__: memory}).buffer, TypeError) 59 assertThrows(() => ({__proto__: memory}).buffer, TypeError)
51 })(); 60 })();
OLDNEW
« src/wasm/wasm-js.cc ('K') | « src/wasm/wasm-js.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698