diff options
Diffstat (limited to 'test/spec.js')
-rw-r--r-- | test/spec.js | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/test/spec.js b/test/spec.js index e6a4e7b1..68e56332 100644 --- a/test/spec.js +++ b/test/spec.js @@ -14,8 +14,17 @@ * limitations under the License. */ +/* polyfill from SM to D8 */ +if (typeof arguments == 'undefined') { + arguments = scriptArgs; +} + +if (typeof readbuffer == 'undefined') { + readbuffer = function(path) { return read(path, 'binary'); }; +} + if (arguments.length != 1) { - print('usage: d8 spec.js -- <filename.json>'); + print('usage: <exe> spec.js -- <filename.json>'); quit(0); } @@ -64,7 +73,7 @@ function createModule(a) { var memory = null; var u8a = new Uint8Array(a); var ffi = {spectest: {print: print}}; - var module = Wasm.instantiateModule(u8a.buffer, ffi); + var module = Wasm.instantiateModule(u8a, ffi); memory = module.memory; return module; } |