From b02ba2b3d03c990b8a3fc23e28c73beeb9feca55 Mon Sep 17 00:00:00 2001 From: Lennart Kats Date: Thu, 13 Sep 2012 16:49:46 +0300 Subject: [PATCH 1/2] Add varargs console.log to worker --- lib/ace/worker/worker.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ace/worker/worker.js b/lib/ace/worker/worker.js index 2e1853df..102d8cd0 100644 --- a/lib/ace/worker/worker.js +++ b/lib/ace/worker/worker.js @@ -1,8 +1,8 @@ "no use strict"; var console = { - log: function(msg) { - postMessage({type: "log", data: msg}); + log: function(msgs) { + postMessage({type: "log", data: arguments.join(" ")}); } }; var window = { From 4d2e0931db10dae89d3fc77104427693fd009296 Mon Sep 17 00:00:00 2001 From: Lennart Kats Date: Thu, 13 Sep 2012 17:07:21 +0300 Subject: [PATCH 2/2] Add sanity check for require([module], function(){}) form --- lib/ace/worker/worker.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/ace/worker/worker.js b/lib/ace/worker/worker.js index 102d8cd0..0e7270a3 100644 --- a/lib/ace/worker/worker.js +++ b/lib/ace/worker/worker.js @@ -30,6 +30,9 @@ var normalizeModule = function(parentId, moduleName) { }; var require = function(parentId, id) { + if (!id.charAt) + throw new Error("worker.js require() accepts only (parentId, id) as arguments"); + var id = normalizeModule(parentId, id); var module = require.modules[id];