-
Notifications
You must be signed in to change notification settings - Fork 149
/
Copy pathtest.js
38 lines (38 loc) · 1.17 KB
/
test.js
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
// Generated by LiveScript 1.3.1
(function(){
var Worker, w, slice$ = [].slice;
Worker = require('./').Worker;
w = new Worker(function(){
importScripts('test-imported-script.js');
return this.onmessage = foo;
});
w.onmessage = function(arg$){
var result;
result = arg$.data.result;
return console.log(result + " is a prime");
};
w.onerror = function(arg$){
var message, this$ = this;
message = arg$.message;
console.log("Caught:", message);
return (typeof setImmediate != 'undefined' && setImmediate !== null
? setImmediate
: partialize$.apply(this, [setTimeout, [void 8, 100], [0]]))(function(){
return this$.terminate();
});
};
w.postMessage({
max: 100
});
function partialize$(f, args, where){
var context = this;
return function(){
var params = slice$.call(arguments), i,
len = params.length, wlen = where.length,
ta = args ? args.concat() : [], tw = where ? where.concat() : [];
for(i = 0; i < len; ++i) { ta[tw[0]] = params[i]; tw.shift(); }
return len < wlen && len ?
partialize$.apply(context, [f, ta, tw]) : f.apply(context, ta);
};
}
}).call(this);