-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SQUASHED: AUTO-COMMIT-src-worker-meta-worker.js,AUTO-COMMIT-src-worker-systemjs-worker.js,AUTO-COMMIT-test-worker-systemjs-worker-test.js,AUTO-COMMIT-test-worker-systemjs-worker-test-sum-request-worker.js,
- Loading branch information
1 parent
aa24439
commit b868c9c
Showing
4 changed files
with
17 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,12 @@ | ||
|
||
|
||
|
||
export async function onrequest(msg) { | ||
if (msg.name === "sum") { | ||
var array = msg.arguments | ||
let result = array[0] + array[1] | ||
export async function onrequest(name, a, b) { | ||
if (name === "sum") { | ||
let result = a + b | ||
|
||
return result | ||
} | ||
throw new Error("request not understood: " + msg) | ||
throw new Error("request not understood: " + arguments) | ||
} | ||
|
||
|
||
// export function onmessage(evt) { | ||
// if(evt.data && evt.data.message === "systemjs-worker-request") { | ||
// if (evt.data.name === "sum") { | ||
// var array = evt.data.arguments | ||
// let result = array[0] + array[1] | ||
// // console.log("ON MESSAGE result " + result) | ||
// return postMessage({message: "systemjs-worker-response", name: evt.data.name, id: evt.data.id, response: result}) | ||
// } | ||
// return postMessage({error: "unhandled systemjs-worker-request " + evt}) | ||
// } | ||
// return postMessage({error: "could not handle message " + evt}) | ||
// } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters