OLD | NEW |
1 onmessage = function(msg) { | 1 self.importScripts('worker-common.js'); |
2 var proxy = msg.data[0]; | 2 |
3 var attrib = msg.data[1]; | 3 self.onmessage = function(msg) { |
| 4 var proxy = msg.data[0]; |
| 5 var attrib = msg.data[1]; |
| 6 |
| 7 awaitProxyInit(proxy).then((proxy) => { |
4 try { | 8 try { |
5 if (proxy.supports(attrib)) { | 9 if (proxy.supports(attrib)) { |
6 proxy[attrib] = 0; | 10 proxy[attrib] = 0; |
7 postMessage('success'); | 11 postMessage('success'); |
8 } else { | 12 } else { |
9 postMessage('error: Received non-supported attribute "' + attrib + '
"'); | 13 postMessage('error: Received non-supported attribute "' + attrib + '"'); |
10 } | 14 } |
11 } catch (e) { | 15 } catch (e) { |
12 postMessage('error: ' + e); | 16 postMessage('error: ' + e); |
13 } | 17 } |
| 18 }); |
14 } | 19 } |
OLD | NEW |