Skip to content

Commit

Permalink
fix ?noworker=1 mode
Browse files Browse the repository at this point in the history
  • Loading branch information
nightwing committed Mar 21, 2018
1 parent bcebf55 commit 904c80f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 17 deletions.
23 changes: 7 additions & 16 deletions plugins/c9.ide.language.jsonalyzer/worker/jsonalyzer_worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,23 +118,14 @@ worker.loadPlugin = function(modulePath, contents, callback) {
return callback("Could not load language handler " + modulePath + ": " + e);
}
}
var handler;
try {
handler = require(modulePath);

require([modulePath], function(handler) {
if (!handler)
throw new Error("Unable to load required module: " + modulePath);
} catch (e) {
if (isInWebWorker)
return callback("Could not load language handler " + modulePath + ": " + e);

// In ?noworker=1 debugging mode, synchronous require doesn't work
return require([modulePath], function(handler) {
if (!handler)
return callback("Could not load language handler " + modulePath);
callback(null, handler);
});
}
callback(null, handler);
return callback("Could not load language handler " + modulePath);
callback(null, handler);
}, function(err) {
callback(err);
});
};

worker.handlesLanguage = function(language, part) {
Expand Down
2 changes: 1 addition & 1 deletion plugins/node_modules/ace/lib/ace/worker/worker_client.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 904c80f

Please sign in to comment.