File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change 6868
6969 var defaults = {
7070 ie10shim : ! isNode ,
71- path : ( isNode ? __dirname + '/' : '' ) + 'eval.js' ,
71+ path : ( isNode ? __dirname + '/' : 'lib/ ' ) + 'eval.js' ,
7272 maxWorkers : isNode ? require ( 'os' ) . cpus ( ) . length : 4
7373 } ;
7474
7979 this . operation . resolve ( null , this . data ) ;
8080 }
8181
82- Parallel . getWorkerSource = function ( cb ) {
82+ Parallel . prototype . getWorkerSource = function ( cb ) {
8383 if ( isNode ) {
8484 return 'process.on("message", function(e) {process.send(JSON.stringify((' + cb . toString ( ) + ')(JSON.parse(e).data)))})' ;
8585 } else {
8989
9090 Parallel . prototype . _spawnWorker = function ( cb ) {
9191 var wrk ;
92+ var src = this . getWorkerSource ( cb ) ;
9293 if ( isNode ) {
9394 wrk = new Worker ( this . options . path ) ;
94- wrk . postMessage ( Parallel . getWorkerSource ( cb ) ) ;
95+ wrk . postMessage ( src ) ;
9596 } else {
9697 try {
97- var blob = new Blob ( [ Parallel . getWorkerSource ( cb ) ] , { type : 'text/javascript' } ) ;
98+ var blob = new Blob ( [ src ] , { type : 'text/javascript' } ) ;
9899 var url = URL . createObjectURL ( blob ) ;
99100
100101 wrk = new Worker ( url ) ;
101102 } catch ( e ) {
102103 if ( this . options . ie10shim ) { // blob/url unsupported, cross-origin error
103- worker = new Worker ( this . options . path ) ;
104- worker . postMessage ( str ) ;
104+ wrk = new Worker ( this . options . path ) ;
105+ wrk . postMessage ( src ) ;
105106 } else {
106107 throw e ;
107108 }
You can’t perform that action at this time.
0 commit comments