update all indirect references to native strings
[nit.git] / contrib / pep8analysis / www / worker.js
1 // load
2 var Module = {
3 'print': function(text) {
4 postMessage({'type': 'stdout', 'data': text})
5 },
6 'TOTAL_MEMORY': 512000000
7 }
8 importScripts("pep8analysis.js")
9 run_analysis = Module.cwrap('pep8analysis_web___CString_run_analysis', null, ['string'])
10
11 function show_graph(data) {
12 postMessage({'type':"show_graph", 'data': data})
13 }
14
15 // notify UI it's ready
16 postMessage({'type':"ready"})
17
18 // wait for code to analyze
19 self.onmessage = function(event){
20 try {
21 run_analysis(event.data)
22 postMessage({'type':"complete"})
23 } catch(e) {
24 console.log(e)
25 postMessage({'type':"exception", 'data': e.toString()})
26 }
27 }