Commit 995c9fe3 authored by titzer's avatar titzer Committed by Commit bot

[wasm] Rename the WASM object to _WASMEXP_.

R=ahaas@chromium.org,bradnelson@chromium.org
LOG=Y
BUG=chromium:575167

Review URL: https://codereview.chromium.org/1577803002

Cr-Commit-Position: refs/heads/master@{#33251}
parent d3fe473b
...@@ -314,7 +314,7 @@ void WasmJs::Install(Isolate* isolate, Handle<JSGlobalObject> global) { ...@@ -314,7 +314,7 @@ void WasmJs::Install(Isolate* isolate, Handle<JSGlobalObject> global) {
// Bind the WASM object. // Bind the WASM object.
Factory* factory = isolate->factory(); Factory* factory = isolate->factory();
Handle<String> name = v8_str(isolate, "WASM"); Handle<String> name = v8_str(isolate, "_WASMEXP_");
Handle<JSFunction> cons = factory->NewFunction(name); Handle<JSFunction> cons = factory->NewFunction(name);
JSFunction::SetInstancePrototype( JSFunction::SetInstancePrototype(
cons, Handle<Object>(global->native_context()->initial_object_prototype(), cons, Handle<Object>(global->native_context()->initial_object_prototype(),
......
...@@ -8,4 +8,5 @@ function f() { ...@@ -8,4 +8,5 @@ function f() {
"use asm"; "use asm";
} }
assertThrows(function() { WASM.asmCompileRun(f.toString()); }); assertFalse(_WASMEXP_ == undefined);
assertThrows(function() { _WASMEXP_.asmCompileRun(f.toString()); });
...@@ -35,7 +35,7 @@ function IntTest() { ...@@ -35,7 +35,7 @@ function IntTest() {
return {caller: caller}; return {caller: caller};
} }
assertEquals(101, WASM.asmCompileRun(IntTest.toString())); assertEquals(101, _WASMEXP_.asmCompileRun(IntTest.toString()));
function Float64Test() { function Float64Test() {
"use asm"; "use asm";
...@@ -59,7 +59,7 @@ function Float64Test() { ...@@ -59,7 +59,7 @@ function Float64Test() {
return {caller: caller}; return {caller: caller};
} }
assertEquals(1, WASM.asmCompileRun(Float64Test.toString())); assertEquals(1, _WASMEXP_.asmCompileRun(Float64Test.toString()));
function BadModule() { function BadModule() {
"use asm"; "use asm";
...@@ -78,7 +78,7 @@ function BadModule() { ...@@ -78,7 +78,7 @@ function BadModule() {
} }
assertThrows(function() { assertThrows(function() {
WASM.asmCompileRun(BadModule.toString()) _WASMEXP_.asmCompileRun(BadModule.toString())
}); });
function TestReturnInBlock() { function TestReturnInBlock() {
...@@ -98,7 +98,7 @@ function TestReturnInBlock() { ...@@ -98,7 +98,7 @@ function TestReturnInBlock() {
return {caller: caller}; return {caller: caller};
} }
assertEquals(1, WASM.asmCompileRun(TestReturnInBlock.toString())); assertEquals(1, _WASMEXP_.asmCompileRun(TestReturnInBlock.toString()));
function TestWhileSimple() { function TestWhileSimple() {
"use asm"; "use asm";
...@@ -114,7 +114,7 @@ function TestWhileSimple() { ...@@ -114,7 +114,7 @@ function TestWhileSimple() {
return {caller: caller}; return {caller: caller};
} }
assertEquals(5, WASM.asmCompileRun(TestWhileSimple.toString())); assertEquals(5, _WASMEXP_.asmCompileRun(TestWhileSimple.toString()));
function TestWhileWithoutBraces() { function TestWhileWithoutBraces() {
"use asm"; "use asm";
...@@ -129,7 +129,7 @@ function TestWhileWithoutBraces() { ...@@ -129,7 +129,7 @@ function TestWhileWithoutBraces() {
return {caller: caller}; return {caller: caller};
} }
assertEquals(4, WASM.asmCompileRun(TestWhileWithoutBraces.toString())); assertEquals(4, _WASMEXP_.asmCompileRun(TestWhileWithoutBraces.toString()));
function TestReturnInWhile() { function TestReturnInWhile() {
"use asm"; "use asm";
...@@ -146,7 +146,7 @@ function TestReturnInWhile() { ...@@ -146,7 +146,7 @@ function TestReturnInWhile() {
return {caller: caller}; return {caller: caller};
} }
assertEquals(6, WASM.asmCompileRun(TestReturnInWhile.toString())); assertEquals(6, _WASMEXP_.asmCompileRun(TestReturnInWhile.toString()));
function TestReturnInWhileWithoutBraces() { function TestReturnInWhileWithoutBraces() {
"use asm"; "use asm";
...@@ -161,7 +161,7 @@ function TestReturnInWhileWithoutBraces() { ...@@ -161,7 +161,7 @@ function TestReturnInWhileWithoutBraces() {
return {caller: caller}; return {caller: caller};
} }
assertEquals(7, WASM.asmCompileRun(TestReturnInWhileWithoutBraces.toString())); assertEquals(7, _WASMEXP_.asmCompileRun(TestReturnInWhileWithoutBraces.toString()));
function TestBreakInWhile() { function TestBreakInWhile() {
"use asm"; "use asm";
...@@ -176,7 +176,7 @@ function TestBreakInWhile() { ...@@ -176,7 +176,7 @@ function TestBreakInWhile() {
return {caller: caller}; return {caller: caller};
} }
assertEquals(8, WASM.asmCompileRun(TestBreakInWhile.toString())); assertEquals(8, _WASMEXP_.asmCompileRun(TestBreakInWhile.toString()));
function TestBreakInNestedWhile() { function TestBreakInNestedWhile() {
"use asm"; "use asm";
...@@ -198,7 +198,7 @@ function TestBreakInNestedWhile() { ...@@ -198,7 +198,7 @@ function TestBreakInNestedWhile() {
return {caller: caller}; return {caller: caller};
} }
assertEquals(9, WASM.asmCompileRun(TestBreakInNestedWhile.toString())); assertEquals(9, _WASMEXP_.asmCompileRun(TestBreakInNestedWhile.toString()));
function TestBreakInBlock() { function TestBreakInBlock() {
"use asm"; "use asm";
...@@ -218,7 +218,7 @@ function TestBreakInBlock() { ...@@ -218,7 +218,7 @@ function TestBreakInBlock() {
return {caller: caller}; return {caller: caller};
} }
assertEquals(10, WASM.asmCompileRun(TestBreakInBlock.toString())); assertEquals(10, _WASMEXP_.asmCompileRun(TestBreakInBlock.toString()));
function TestBreakInNamedWhile() { function TestBreakInNamedWhile() {
"use asm"; "use asm";
...@@ -237,7 +237,7 @@ function TestBreakInNamedWhile() { ...@@ -237,7 +237,7 @@ function TestBreakInNamedWhile() {
return {caller: caller}; return {caller: caller};
} }
assertEquals(11, WASM.asmCompileRun(TestBreakInNamedWhile.toString())); assertEquals(11, _WASMEXP_.asmCompileRun(TestBreakInNamedWhile.toString()));
function TestContinue() { function TestContinue() {
"use asm"; "use asm";
...@@ -258,7 +258,7 @@ function TestContinue() { ...@@ -258,7 +258,7 @@ function TestContinue() {
return {caller: caller}; return {caller: caller};
} }
assertEquals(-5, WASM.asmCompileRun(TestContinue.toString())); assertEquals(-5, _WASMEXP_.asmCompileRun(TestContinue.toString()));
function TestContinueInNamedWhile() { function TestContinueInNamedWhile() {
"use asm"; "use asm";
...@@ -284,7 +284,7 @@ function TestContinueInNamedWhile() { ...@@ -284,7 +284,7 @@ function TestContinueInNamedWhile() {
return {caller: caller}; return {caller: caller};
} }
assertEquals(20, WASM.asmCompileRun(TestContinueInNamedWhile.toString())); assertEquals(20, _WASMEXP_.asmCompileRun(TestContinueInNamedWhile.toString()));
function TestNot() { function TestNot() {
"use asm"; "use asm";
...@@ -297,7 +297,7 @@ function TestNot() { ...@@ -297,7 +297,7 @@ function TestNot() {
return {caller:caller}; return {caller:caller};
} }
assertEquals(1, WASM.asmCompileRun(TestNot.toString())); assertEquals(1, _WASMEXP_.asmCompileRun(TestNot.toString()));
function TestNotEquals() { function TestNotEquals() {
"use asm"; "use asm";
...@@ -313,7 +313,7 @@ function TestNotEquals() { ...@@ -313,7 +313,7 @@ function TestNotEquals() {
return {caller:caller}; return {caller:caller};
} }
assertEquals(21, WASM.asmCompileRun(TestNotEquals.toString())); assertEquals(21, _WASMEXP_.asmCompileRun(TestNotEquals.toString()));
function TestUnsignedComparison() { function TestUnsignedComparison() {
"use asm"; "use asm";
...@@ -329,7 +329,7 @@ function TestUnsignedComparison() { ...@@ -329,7 +329,7 @@ function TestUnsignedComparison() {
return {caller:caller}; return {caller:caller};
} }
assertEquals(22, WASM.asmCompileRun(TestUnsignedComparison.toString())); assertEquals(22, _WASMEXP_.asmCompileRun(TestUnsignedComparison.toString()));
function TestMixedAdd() { function TestMixedAdd() {
"use asm"; "use asm";
...@@ -350,7 +350,7 @@ function TestMixedAdd() { ...@@ -350,7 +350,7 @@ function TestMixedAdd() {
return {caller:caller}; return {caller:caller};
} }
assertEquals(23, WASM.asmCompileRun(TestMixedAdd.toString())); assertEquals(23, _WASMEXP_.asmCompileRun(TestMixedAdd.toString()));
function TestInt32HeapAccess(stdlib, foreign, buffer) { function TestInt32HeapAccess(stdlib, foreign, buffer) {
"use asm"; "use asm";
...@@ -368,7 +368,7 @@ function TestInt32HeapAccess(stdlib, foreign, buffer) { ...@@ -368,7 +368,7 @@ function TestInt32HeapAccess(stdlib, foreign, buffer) {
return {caller: caller}; return {caller: caller};
} }
assertEquals(7, WASM.asmCompileRun(TestInt32HeapAccess.toString())); assertEquals(7, _WASMEXP_.asmCompileRun(TestInt32HeapAccess.toString()));
function TestHeapAccessIntTypes() { function TestHeapAccessIntTypes() {
var types = [ var types = [
...@@ -383,7 +383,7 @@ function TestHeapAccessIntTypes() { ...@@ -383,7 +383,7 @@ function TestHeapAccessIntTypes() {
var code = TestInt32HeapAccess.toString(); var code = TestInt32HeapAccess.toString();
code = code.replace('Int32Array', types[i][0]); code = code.replace('Int32Array', types[i][0]);
code = code.replace(/>> 2/g, types[i][1]); code = code.replace(/>> 2/g, types[i][1]);
assertEquals(7, WASM.asmCompileRun(code)); assertEquals(7, _WASMEXP_.asmCompileRun(code));
} }
} }
...@@ -411,7 +411,7 @@ function TestFloatHeapAccess(stdlib, foreign, buffer) { ...@@ -411,7 +411,7 @@ function TestFloatHeapAccess(stdlib, foreign, buffer) {
return {caller: caller}; return {caller: caller};
} }
assertEquals(1, WASM.asmCompileRun(TestFloatHeapAccess.toString())); assertEquals(1, _WASMEXP_.asmCompileRun(TestFloatHeapAccess.toString()));
function TestConvertI32() { function TestConvertI32() {
"use asm"; "use asm";
...@@ -427,7 +427,7 @@ function TestConvertI32() { ...@@ -427,7 +427,7 @@ function TestConvertI32() {
return {caller:caller}; return {caller:caller};
} }
assertEquals(24, WASM.asmCompileRun(TestConvertI32.toString())); assertEquals(24, _WASMEXP_.asmCompileRun(TestConvertI32.toString()));
function TestConvertF64FromInt() { function TestConvertF64FromInt() {
"use asm"; "use asm";
...@@ -443,7 +443,7 @@ function TestConvertF64FromInt() { ...@@ -443,7 +443,7 @@ function TestConvertF64FromInt() {
return {caller:caller}; return {caller:caller};
} }
assertEquals(25, WASM.asmCompileRun(TestConvertF64FromInt.toString())); assertEquals(25, _WASMEXP_.asmCompileRun(TestConvertF64FromInt.toString()));
function TestConvertF64FromUnsigned() { function TestConvertF64FromUnsigned() {
"use asm"; "use asm";
...@@ -461,7 +461,7 @@ function TestConvertF64FromUnsigned() { ...@@ -461,7 +461,7 @@ function TestConvertF64FromUnsigned() {
return {caller:caller}; return {caller:caller};
} }
assertEquals(26, WASM.asmCompileRun(TestConvertF64FromUnsigned.toString())); assertEquals(26, _WASMEXP_.asmCompileRun(TestConvertF64FromUnsigned.toString()));
function TestModInt() { function TestModInt() {
"use asm"; "use asm";
...@@ -475,7 +475,7 @@ function TestModInt() { ...@@ -475,7 +475,7 @@ function TestModInt() {
return {caller:caller}; return {caller:caller};
} }
assertEquals(-27, WASM.asmCompileRun(TestModInt.toString())); assertEquals(-27, _WASMEXP_.asmCompileRun(TestModInt.toString()));
function TestModUnsignedInt() { function TestModUnsignedInt() {
"use asm"; "use asm";
...@@ -489,7 +489,7 @@ function TestModUnsignedInt() { ...@@ -489,7 +489,7 @@ function TestModUnsignedInt() {
return {caller:caller}; return {caller:caller};
} }
assertEquals(8, WASM.asmCompileRun(TestModUnsignedInt.toString())); assertEquals(8, _WASMEXP_.asmCompileRun(TestModUnsignedInt.toString()));
function TestModDouble() { function TestModDouble() {
"use asm"; "use asm";
...@@ -506,7 +506,7 @@ function TestModDouble() { ...@@ -506,7 +506,7 @@ function TestModDouble() {
return {caller:caller}; return {caller:caller};
} }
assertEquals(28, WASM.asmCompileRun(TestModDouble.toString())); assertEquals(28, _WASMEXP_.asmCompileRun(TestModDouble.toString()));
/* /*
TODO: Fix parsing of negative doubles TODO: Fix parsing of negative doubles
...@@ -526,7 +526,7 @@ function TestModDoubleNegative() { ...@@ -526,7 +526,7 @@ function TestModDoubleNegative() {
return {caller:caller}; return {caller:caller};
} }
assertEquals(28, WASM.asmCompileRun(TestModDoubleNegative.toString())); assertEquals(28, _WASMEXP_.asmCompileRun(TestModDoubleNegative.toString()));
*/ */
function TestNamedFunctions() { function TestNamedFunctions() {
...@@ -548,7 +548,7 @@ function TestNamedFunctions() { ...@@ -548,7 +548,7 @@ function TestNamedFunctions() {
add:add}; add:add};
} }
var module = WASM.instantiateModuleFromAsm(TestNamedFunctions.toString()); var module = _WASMEXP_.instantiateModuleFromAsm(TestNamedFunctions.toString());
module.init(); module.init();
assertEquals(77.5, module.add()); assertEquals(77.5, module.add());
...@@ -565,7 +565,7 @@ function TestGlobalsWithInit() { ...@@ -565,7 +565,7 @@ function TestGlobalsWithInit() {
return {add:add}; return {add:add};
} }
var module = WASM.instantiateModuleFromAsm(TestGlobalsWithInit.toString()); var module = _WASMEXP_.instantiateModuleFromAsm(TestGlobalsWithInit.toString());
module.__init__(); module.__init__();
assertEquals(77.5, module.add()); assertEquals(77.5, module.add());
...@@ -584,7 +584,7 @@ function TestForLoop() { ...@@ -584,7 +584,7 @@ function TestForLoop() {
return {caller:caller}; return {caller:caller};
} }
assertEquals(54, WASM.asmCompileRun(TestForLoop.toString())); assertEquals(54, _WASMEXP_.asmCompileRun(TestForLoop.toString()));
function TestForLoopWithoutInit() { function TestForLoopWithoutInit() {
"use asm" "use asm"
...@@ -601,7 +601,7 @@ function TestForLoopWithoutInit() { ...@@ -601,7 +601,7 @@ function TestForLoopWithoutInit() {
return {caller:caller}; return {caller:caller};
} }
assertEquals(100, WASM.asmCompileRun(TestForLoopWithoutInit.toString())); assertEquals(100, _WASMEXP_.asmCompileRun(TestForLoopWithoutInit.toString()));
function TestForLoopWithoutCondition() { function TestForLoopWithoutCondition() {
"use asm" "use asm"
...@@ -621,7 +621,7 @@ function TestForLoopWithoutCondition() { ...@@ -621,7 +621,7 @@ function TestForLoopWithoutCondition() {
return {caller:caller}; return {caller:caller};
} }
assertEquals(66, WASM.asmCompileRun(TestForLoopWithoutCondition.toString())); assertEquals(66, _WASMEXP_.asmCompileRun(TestForLoopWithoutCondition.toString()));
function TestForLoopWithoutNext() { function TestForLoopWithoutNext() {
"use asm" "use asm"
...@@ -637,7 +637,7 @@ function TestForLoopWithoutNext() { ...@@ -637,7 +637,7 @@ function TestForLoopWithoutNext() {
return {caller:caller}; return {caller:caller};
} }
assertEquals(41, WASM.asmCompileRun(TestForLoopWithoutNext.toString())); assertEquals(41, _WASMEXP_.asmCompileRun(TestForLoopWithoutNext.toString()));
function TestForLoopWithoutBody() { function TestForLoopWithoutBody() {
"use asm" "use asm"
...@@ -652,7 +652,7 @@ function TestForLoopWithoutBody() { ...@@ -652,7 +652,7 @@ function TestForLoopWithoutBody() {
return {caller:caller}; return {caller:caller};
} }
assertEquals(45, WASM.asmCompileRun(TestForLoopWithoutBody.toString())); assertEquals(45, _WASMEXP_.asmCompileRun(TestForLoopWithoutBody.toString()));
function TestDoWhile() { function TestDoWhile() {
"use asm" "use asm"
...@@ -670,7 +670,7 @@ function TestDoWhile() { ...@@ -670,7 +670,7 @@ function TestDoWhile() {
return {caller:caller}; return {caller:caller};
} }
assertEquals(84, WASM.asmCompileRun(TestDoWhile.toString())); assertEquals(84, _WASMEXP_.asmCompileRun(TestDoWhile.toString()));
function TestConditional() { function TestConditional() {
"use asm" "use asm"
......
...@@ -10,7 +10,7 @@ var module = (function () { ...@@ -10,7 +10,7 @@ var module = (function () {
var kBodySize = 5; var kBodySize = 5;
var kNameOffset = 21 + kBodySize + 1; var kNameOffset = 21 + kBodySize + 1;
return WASM.instantiateModule(bytes( return _WASMEXP_.instantiateModule(bytes(
// -- memory // -- memory
kDeclMemory, kDeclMemory,
12, 12, 1, 12, 12, 1,
...@@ -64,7 +64,7 @@ var module = (function() { ...@@ -64,7 +64,7 @@ var module = (function() {
var kBodySize = 1; var kBodySize = 1;
var kNameOffset2 = 19 + kBodySize + 1; var kNameOffset2 = 19 + kBodySize + 1;
return WASM.instantiateModule(bytes( return _WASMEXP_.instantiateModule(bytes(
// -- memory // -- memory
kDeclMemory, kDeclMemory,
12, 12, 1, 12, 12, 1,
...@@ -136,7 +136,7 @@ assertEquals(undefined, module.nop()); ...@@ -136,7 +136,7 @@ assertEquals(undefined, module.nop());
'f', 'l', 't', 0 // name 'f', 'l', 't', 0 // name
); );
var module = WASM.instantiateModule(data); var module = _WASMEXP_.instantiateModule(data);
assertEquals("function", typeof module.flt); assertEquals("function", typeof module.flt);
assertEquals(1, module.flt(-2, -1)); assertEquals(1, module.flt(-2, -1));
......
...@@ -28,4 +28,4 @@ var data = bytes( ...@@ -28,4 +28,4 @@ var data = bytes(
'm', 'a', 'i', 'n', 0 // name 'm', 'a', 'i', 'n', 0 // name
); );
assertEquals(kReturnValue, WASM.compileRun(data)); assertEquals(kReturnValue, _WASMEXP_.compileRun(data));
...@@ -52,7 +52,7 @@ function makeDivRem(opcode) { ...@@ -52,7 +52,7 @@ function makeDivRem(opcode) {
'm', 'a', 'i', 'n', 0 // -- 'm', 'a', 'i', 'n', 0 // --
); );
var module = WASM.instantiateModule(data); var module = _WASMEXP_.instantiateModule(data);
assertEquals("function", typeof module.main); assertEquals("function", typeof module.main);
......
...@@ -38,7 +38,7 @@ function testCallFFI(ffi) { ...@@ -38,7 +38,7 @@ function testCallFFI(ffi) {
); );
print("instantiate FFI"); print("instantiate FFI");
var module = WASM.instantiateModule(data, ffi); var module = _WASMEXP_.instantiateModule(data, ffi);
} }
// everything is good. // everything is good.
......
...@@ -38,7 +38,7 @@ function testCallFFI(func, check) { ...@@ -38,7 +38,7 @@ function testCallFFI(func, check) {
'm', 'a', 'i', 'n', 0 // -- 'm', 'a', 'i', 'n', 0 // --
); );
var module = WASM.instantiateModule(data, ffi); var module = _WASMEXP_.instantiateModule(data, ffi);
assertEquals("function", typeof module.main); assertEquals("function", typeof module.main);
...@@ -236,7 +236,7 @@ function testCallBinopVoid(type, func, check) { ...@@ -236,7 +236,7 @@ function testCallBinopVoid(type, func, check) {
'm', 'a', 'i', 'n', 0 // -- 'm', 'a', 'i', 'n', 0 // --
); );
var module = WASM.instantiateModule(data, ffi); var module = _WASMEXP_.instantiateModule(data, ffi);
assertEquals("function", typeof module.main); assertEquals("function", typeof module.main);
...@@ -320,7 +320,7 @@ function testCallPrint() { ...@@ -320,7 +320,7 @@ function testCallPrint() {
'm', 'a', 'i', 'n', 0 // -- 'm', 'a', 'i', 'n', 0 // --
); );
var module = WASM.instantiateModule(data, ffi); var module = _WASMEXP_.instantiateModule(data, ffi);
assertEquals("function", typeof module.main); assertEquals("function", typeof module.main);
......
...@@ -19,7 +19,7 @@ var module = (function () { ...@@ -19,7 +19,7 @@ var module = (function () {
var ffi = new Object(); var ffi = new Object();
ffi.add = (function(a, b) { return a + b | 0; }); ffi.add = (function(a, b) { return a + b | 0; });
return WASM.instantiateModule(bytes( return _WASMEXP_.instantiateModule(bytes(
// -- signatures // -- signatures
kDeclSignatures, 2, kDeclSignatures, 2,
2, kAstI32, kAstI32, kAstI32, // int, int -> int 2, kAstI32, kAstI32, kAstI32, // int, int -> int
......
...@@ -31,7 +31,7 @@ var data = bytes( ...@@ -31,7 +31,7 @@ var data = bytes(
'm', 'a', 'i', 'n', 0 // name 'm', 'a', 'i', 'n', 0 // name
); );
var module = WASM.instantiateModule(data); var module = _WASMEXP_.instantiateModule(data);
// Check the module exists. // Check the module exists.
assertFalse(module === undefined); assertFalse(module === undefined);
......
...@@ -45,7 +45,7 @@ function genModule(memory) { ...@@ -45,7 +45,7 @@ function genModule(memory) {
'm', 'a', 'i', 'n', 0 // -- 'm', 'a', 'i', 'n', 0 // --
); );
return WASM.instantiateModule(data, null, memory); return _WASMEXP_.instantiateModule(data, null, memory);
} }
function testPokeMemory() { function testPokeMemory() {
...@@ -159,7 +159,7 @@ function testOOBThrows() { ...@@ -159,7 +159,7 @@ function testOOBThrows() {
); );
var memory = null; var memory = null;
var module = WASM.instantiateModule(data, null, memory); var module = _WASMEXP_.instantiateModule(data, null, memory);
var offset; var offset;
......
...@@ -35,7 +35,7 @@ function testSelect2(type) { ...@@ -35,7 +35,7 @@ function testSelect2(type) {
's','e','l','e','c','t',0 // name 's','e','l','e','c','t',0 // name
); );
var module = WASM.instantiateModule(data); var module = _WASMEXP_.instantiateModule(data);
assertEquals("function", typeof module.select); assertEquals("function", typeof module.select);
runSelect2(module, which, 99, 97); runSelect2(module, which, 99, 97);
...@@ -111,7 +111,7 @@ function testSelect10(type) { ...@@ -111,7 +111,7 @@ function testSelect10(type) {
's','e','l','e','c','t',0 // name 's','e','l','e','c','t',0 // name
); );
var module = WASM.instantiateModule(data); var module = _WASMEXP_.instantiateModule(data);
assertEquals("function", typeof module.select); assertEquals("function", typeof module.select);
runSelect10(module, which, 99, 97); runSelect10(module, which, 99, 97);
......
...@@ -38,7 +38,7 @@ function makeFFI(func) { ...@@ -38,7 +38,7 @@ function makeFFI(func) {
'm', 'a', 'i', 'n', 0 // -- 'm', 'a', 'i', 'n', 0 // --
); );
var module = WASM.instantiateModule(data, ffi); var module = _WASMEXP_.instantiateModule(data, ffi);
assertEquals("function", typeof module.main); assertEquals("function", typeof module.main);
......
...@@ -15,7 +15,7 @@ var module = (function () { ...@@ -15,7 +15,7 @@ var module = (function () {
var ffi = new Object(); var ffi = new Object();
ffi.add = (function(a, b) { return a + b | 0; }); ffi.add = (function(a, b) { return a + b | 0; });
return WASM.instantiateModule(bytes( return _WASMEXP_.instantiateModule(bytes(
// -- signatures // -- signatures
kDeclSignatures, 1, kDeclSignatures, 1,
0, kAstStmt, // void -> void 0, kAstStmt, // void -> void
......
...@@ -6,13 +6,13 @@ ...@@ -6,13 +6,13 @@
function Foo() { } function Foo() { }
assertThrows(function() { WASM.verifyFunction(); }) assertThrows(function() { _WASMEXP_.verifyFunction(); })
assertThrows(function() { WASM.verifyFunction(0); }) assertThrows(function() { _WASMEXP_.verifyFunction(0); })
assertThrows(function() { WASM.verifyFunction("s"); }) assertThrows(function() { _WASMEXP_.verifyFunction("s"); })
assertThrows(function() { WASM.verifyFunction(undefined); }) assertThrows(function() { _WASMEXP_.verifyFunction(undefined); })
assertThrows(function() { WASM.verifyFunction(1.1); }) assertThrows(function() { _WASMEXP_.verifyFunction(1.1); })
assertThrows(function() { WASM.verifyFunction(1/0); }) assertThrows(function() { _WASMEXP_.verifyFunction(1/0); })
assertThrows(function() { WASM.verifyFunction(null); }) assertThrows(function() { _WASMEXP_.verifyFunction(null); })
assertThrows(function() { WASM.verifyFunction(new Foo()); }) assertThrows(function() { _WASMEXP_.verifyFunction(new Foo()); })
assertThrows(function() { WASM.verifyFunction(new ArrayBuffer(0)); }) assertThrows(function() { _WASMEXP_.verifyFunction(new ArrayBuffer(0)); })
assertThrows(function() { WASM.verifyFunction(new ArrayBuffer(140000)); }) assertThrows(function() { _WASMEXP_.verifyFunction(new ArrayBuffer(140000)); })
...@@ -16,7 +16,7 @@ try { ...@@ -16,7 +16,7 @@ try {
kExprNop // body kExprNop // body
); );
WASM.verifyFunction(data); _WASMEXP_.verifyFunction(data);
print("ok"); print("ok");
} catch (e) { } catch (e) {
assertTrue(false); assertTrue(false);
...@@ -34,7 +34,7 @@ try { ...@@ -34,7 +34,7 @@ try {
kExprBlock, 2, kExprNop, kExprNop // body kExprBlock, 2, kExprNop, kExprNop // body
); );
WASM.verifyFunction(data); _WASMEXP_.verifyFunction(data);
print("not ok"); print("not ok");
} catch (e) { } catch (e) {
print("ok: " + e); print("ok: " + e);
......
...@@ -6,13 +6,13 @@ ...@@ -6,13 +6,13 @@
function Foo() { } function Foo() { }
assertThrows(function() { WASM.verifyModule(); }) assertThrows(function() { _WASMEXP_.verifyModule(); })
assertThrows(function() { WASM.verifyModule(0); }) assertThrows(function() { _WASMEXP_.verifyModule(0); })
assertThrows(function() { WASM.verifyModule("s"); }) assertThrows(function() { _WASMEXP_.verifyModule("s"); })
assertThrows(function() { WASM.verifyModule(undefined); }) assertThrows(function() { _WASMEXP_.verifyModule(undefined); })
assertThrows(function() { WASM.verifyModule(1.1); }) assertThrows(function() { _WASMEXP_.verifyModule(1.1); })
assertThrows(function() { WASM.verifyModule(1/0); }) assertThrows(function() { _WASMEXP_.verifyModule(1/0); })
assertThrows(function() { WASM.verifyModule(null); }) assertThrows(function() { _WASMEXP_.verifyModule(null); })
assertThrows(function() { WASM.verifyModule(new Foo()); }) assertThrows(function() { _WASMEXP_.verifyModule(new Foo()); })
assertThrows(function() { WASM.verifyModule(new ArrayBuffer(0)); }) assertThrows(function() { _WASMEXP_.verifyModule(new ArrayBuffer(0)); })
assertThrows(function() { WASM.verifyModule(new ArrayBuffer(7)); }) assertThrows(function() { _WASMEXP_.verifyModule(new ArrayBuffer(7)); })
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
// Flags: --expose-wasm // Flags: --expose-wasm
assertFalse(undefined === WASM); assertFalse(undefined === _WASMEXP_);
assertFalse(undefined == WASM); assertFalse(undefined == _WASMEXP_);
assertEquals("function", typeof WASM.verifyModule); assertEquals("function", typeof _WASMEXP_.verifyModule);
assertEquals("function", typeof WASM.verifyFunction); assertEquals("function", typeof _WASMEXP_.verifyFunction);
assertEquals("function", typeof WASM.compileRun); assertEquals("function", typeof _WASMEXP_.compileRun);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment