javascript - Using JS 1.7+ keywords in a blob Worker -


my problem when i'm trying use javascript 1.7+ keywords, let, in web worker, source blob, silently fails. code use is

function myworker() {   let msg = 'hello';   postmessage(msg); }  let blob = new blob(   ['(' + myworker + ')();'],   {'type': 'text/javascript;version=1.8'} ); let url = url.createobjecturl(blob); let worker = new worker(url); worker.onmessage = function(msg) alert('got message: ' + msg.data); worker.postmessage(null); 

the same code works fine if replace first let keyword var. there way make firefox (i checked versions 21.0 , last stable 23.0) understand new js1.7+ in blob?


Comments

Popular posts from this blog

java - How to Configure JAXRS and Spring With Annotations -

visual studio - TFS will not accept changes I've made to a Java project -

php - Create image in codeigniter on the fly -