UNPKG

dojo

Version:

Dojo core is a powerful, lightweight library that makes common tasks quicker and easier. Animate elements, manipulate the DOM, and query with easy CSS syntax, all without sacrificing performance.

30 lines (29 loc) 792 B
// summary: // Console polyfill for webworkers. // description: // Webworkers do not have access to the console as of writing (except in Chrome). This polyfills // the console by passing messages back to the browser window for it to reflect to the console. // This should make debugging of test failure a bit easier. if(!self.console){ console = { _sendMessage: function(type, message){ self.postMessage({ type: "console", consoleType: type, value: message }); }, log: function(message){ console._sendMessage("log", message); }, error: function(message){ console._sendMessage("error", message); }, warn: function(message){ console._sendMessage("warn", message); }, info: function(message){ console._sendMessage("info", message); } } }