Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions src/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -839,7 +839,12 @@ var AMDLoader;
catch (_e) {
recorder.record(61 /* CachedDataMissed */, cachedDataPath);
}
var script = new that._vm.Script(scriptSource, options);
var script;
try {
script = new that._vm.Script(scriptSource, options);
} catch (err) {
throw new Error(`Error compiling ${filename}. ${err}`);
}
var compileWrapper = script.runInThisContext(options);
// run script
var dirname = that._path.dirname(filename);
Expand Down Expand Up @@ -902,7 +907,12 @@ var AMDLoader;
NodeScriptLoader.prototype._createAndEvalScript = function (moduleManager, contents, options, callback, errorback) {
var recorder = moduleManager.getRecorder();
recorder.record(31 /* NodeBeginEvaluatingScript */, options.filename);
var script = new this._vm.Script(contents, options);
var script;
try {
script = new this._vm.Script(contents, options);
} catch (err) {
throw new Error(`Error compiling ${options.filename}. ${err}`);
}
var ret = script.runInThisContext(options);
var globalDefineFunc = moduleManager.getGlobalAMDDefineFunc();
var receivedDefineCall = false;
Expand Down