Merge pull request #950 from ajaxorg/worker-api-compatibility
(Trivial) Worker API compatibility
This commit is contained in:
commit
6e3cad23f6
1 changed files with 5 additions and 2 deletions
|
|
@ -1,8 +1,8 @@
|
|||
"no use strict";
|
||||
|
||||
var console = {
|
||||
log: function(msg) {
|
||||
postMessage({type: "log", data: msg});
|
||||
log: function(msgs) {
|
||||
postMessage({type: "log", data: arguments.join(" ")});
|
||||
}
|
||||
};
|
||||
var window = {
|
||||
|
|
@ -30,6 +30,9 @@ var normalizeModule = function(parentId, moduleName) {
|
|||
};
|
||||
|
||||
var require = function(parentId, id) {
|
||||
if (!id.charAt)
|
||||
throw new Error("worker.js require() accepts only (parentId, id) as arguments");
|
||||
|
||||
var id = normalizeModule(parentId, id);
|
||||
|
||||
var module = require.modules[id];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue