From 4d2e0931db10dae89d3fc77104427693fd009296 Mon Sep 17 00:00:00 2001 From: Lennart Kats Date: Thu, 13 Sep 2012 17:07:21 +0300 Subject: [PATCH] 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];