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

Side by Side Diff: chrome/test/data/wasm/wasm_serialization_worker.js

Issue 2255673003: [wasm] Support wasm module structured cloning. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: android/windows Created 4 years, 4 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
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 onmessage = function(e) {
6 var compiled_module = e.data;
7 var instance = new WebAssembly.Instance(compiled_module);
8 if (typeof instance === "undefined") {
jsbell 2016/08/18 16:48:02 nit: why not just `instance === undefined` ?
Mircea Trofin 2016/08/18 17:34:08 Acknowledged.
Mircea Trofin 2016/08/18 23:02:59 Done.
9 postMessage("error!");
10 return;
11 }
12 var entrypoint = instance.exports["increment"];
13
14 if (typeof entrypoint != "function") {
jsbell 2016/08/18 16:48:02 nit: might as well be consistent and use !==
Mircea Trofin 2016/08/18 17:34:08 Acknowledged.
Mircea Trofin 2016/08/18 23:02:59 Done.
15 postMessage("error!");
16 return;
17 }
18
19 var ret = entrypoint(42);
20 if (ret != 43) {
21 postMessage("didn't get 43");
jsbell 2016/08/18 16:48:02 Do you want a return after this postMessage too, s
Mircea Trofin 2016/08/18 17:34:08 Acknowledged.
Mircea Trofin 2016/08/18 23:02:59 Actually, don't need to post that string, can just
22 }
23 postMessage(ret);
24 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698