diff options
author | Jukka Jylänki <jujjyl@gmail.com> | 2013-11-04 14:07:02 +0200 |
---|---|---|
committer | Jukka Jylänki <jujjyl@gmail.com> | 2013-11-04 14:07:02 +0200 |
commit | 8a419cd95dad82f649f16d339dbbe3de3bb0db32 (patch) | |
tree | b029447e18f5dd13c9ff9777f92e594f3c6b6bb6 /src/proxyWorker.js | |
parent | a9ef49d8c97dcaed3cc7778acf61de978efdd5ff (diff) |
Give names to most manually assigned functions in the .js files, in form "var x = function()" -> "function x()" so that error stack traces and profiling stack traces are more informative and do not contain anonymous functions.
Diffstat (limited to 'src/proxyWorker.js')
-rw-r--r-- | src/proxyWorker.js | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/proxyWorker.js b/src/proxyWorker.js index 29b2528d..5d34b900 100644 --- a/src/proxyWorker.js +++ b/src/proxyWorker.js @@ -2,12 +2,12 @@ function EventListener() { this.listeners = {}; - this.addEventListener = function(event, func) { + this.addEventListener = function addEventListener(event, func) { if (!this.listeners[event]) this.listeners[event] = []; this.listeners[event].push(func); }; - this.fireEvent = function(event) { + this.fireEvent = function fireEvent(event) { event.preventDefault = function(){}; if (event.type in this.listeners) { @@ -22,17 +22,17 @@ var window = this; var windowExtra = new EventListener(); for (var x in windowExtra) window[x] = windowExtra[x]; -window.close = function() { +window.close = function window_close() { postMessage({ target: 'window', method: 'close' }); }; var document = new EventListener(); -document.createElement = function(what) { +document.createElement = function document_createElement(what) { switch(what) { case 'canvas': { var canvas = new EventListener(); - canvas.ensureData = function() { + canvas.ensureData = function canvas_ensureData() { if (!canvas.data || canvas.data.width !== canvas.width || canvas.data.height !== canvas.height) { canvas.data = { width: canvas.width, @@ -42,7 +42,7 @@ document.createElement = function(what) { postMessage({ target: 'canvas', op: 'resize', width: canvas.width, height: canvas.height }); } }; - canvas.getContext = function(type) { + canvas.getContext = function canvas_getContext(type) { assert(type == '2d'); return { getImageData: function(x, y, w, h) { @@ -63,7 +63,7 @@ document.createElement = function(what) { }; }; canvas.boundingClientRect = {}; - canvas.getBoundingClientRect = function() { + canvas.getBoundingClientRect = function canvas_getBoundingClientRect() { return { width: canvas.boundingClientRect.width, height: canvas.boundingClientRect.height, @@ -89,10 +89,10 @@ Module.canvas = document.createElement('canvas'); Module.setStatus = function(){}; -Module.print = function(x) { +Module.print = function Module_print(x) { postMessage({ target: 'stdout', content: x }); }; -Module.printErr = function(x) { +Module.printErr = function Module_printErr(x) { postMessage({ target: 'stderr', content: x }); }; @@ -112,7 +112,7 @@ function messageResender() { } } -onmessage = function(message) { +onmessage = function onmessage(message) { if (!calledMain) { if (!messageBuffer) { messageBuffer = []; |