forked from facebook/react
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathworker.js
More file actions
38 lines (32 loc) · 701 Bytes
/
worker.js
File metadata and controls
38 lines (32 loc) · 701 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/* jshint worker: true */
"use strict";
if (typeof console == 'undefined') {
this.console = {
error: function(e){
postMessage(JSON.stringify({
type: 'error',
message: e.message,
stack: e.stack
}));
},
log: function(message){
postMessage(JSON.stringify({
type: 'log',
message: message
}));
}
}
}
console.log('worker BEGIN');
// The UMD wrapper tries to store on `global` if `window` isn't available
var global = {};
importScripts("phantomjs-shims.js");
try {
importScripts("../../build/react.js");
} catch (e) {
console.error(e);
}
postMessage(JSON.stringify({
type: 'done'
}));
console.log('worker END');