Merge pull request #1036 from ajaxorg/worker-api-compatibility
[Trivial] Update worker API compatibility
This commit is contained in:
commit
2a41a7e929
2 changed files with 8 additions and 3 deletions
|
|
@ -1,8 +1,13 @@
|
||||||
"no use strict";
|
"no use strict";
|
||||||
|
|
||||||
var console = {
|
var console = {
|
||||||
log: function(msgs) {
|
log: function() {
|
||||||
postMessage({type: "log", data: arguments.join(" ")});
|
var msgs = Array.prototype.slice.call(arguments, 0);
|
||||||
|
postMessage({type: "log", data: msgs});
|
||||||
|
},
|
||||||
|
error: function() {
|
||||||
|
var msgs = Array.prototype.slice.call(arguments, 0);
|
||||||
|
postMessage({type: "log", data: msgs});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
var window = {
|
var window = {
|
||||||
|
|
|
||||||
|
|
@ -84,7 +84,7 @@ var WorkerClient = function(topLevelNamespaces, mod, classname) {
|
||||||
var msg = e.data;
|
var msg = e.data;
|
||||||
switch(msg.type) {
|
switch(msg.type) {
|
||||||
case "log":
|
case "log":
|
||||||
window.console && console.log && console.log(msg.data);
|
window.console && console.log && console.log.apply(console, msg.data);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "event":
|
case "event":
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue