Merge pull request #950 from ajaxorg/worker-api-compatibility

(Trivial) Worker API compatibility
This commit is contained in:
Harutyun Amirjanyan 2012-09-17 06:44:51 -07:00
commit 6e3cad23f6

View file

@ -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];