Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

17
LINES

< > BotCompany Repo | #1013909 // jsWorkerFromString - saves in variable workerCode

JavaX fragment (include)

static S jsWorkerFromString(S code) {
  ret "var workerCode = " + jsQuote(code) + [[;

  window.URL = window.URL || window.webkitURL;
  
  var blob;
  try {
      blob = new Blob([workerCode], {type: 'application/javascript'});
  } catch (e) { // Backwards-compatibility
      window.BlobBuilder = window.BlobBuilder || window.WebKitBlobBuilder || window.MozBlobBuilder;
      blob = new BlobBuilder();
      blob.append(workerCode);
      blob = blob.getBlob();
  }
  var worker = new Worker(URL.createObjectURL(blob));
]];
}

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1013909
Snippet name: jsWorkerFromString - saves in variable workerCode
Eternal ID of this version: #1013909/2
Text MD5: c329b10c49d252e81b2d9e5a25d388c3
Author: stefan
Category: javax / html
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-10-03 18:41:24
Source code size: 542 bytes / 17 lines
Pitched / IR pitched: No / No
Views / Downloads: 409 / 437
Version history: 1 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)