|
|
|
@ -83,22 +83,34 @@ function Compiler (editor, queryParams, handleGithubCall, updateFiles) { |
|
|
|
|
function compilationFinished (data, missingInputs, source) { |
|
|
|
|
var noFatalErrors = true; // ie warnings are ok
|
|
|
|
|
|
|
|
|
|
function isValidError (error) { |
|
|
|
|
// The deferred import is not a real error
|
|
|
|
|
// FIXME: maybe have a better check?
|
|
|
|
|
if (/Deferred import/.exec(error)) { |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return utils.errortype(error) !== 'warning'; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (data['error'] !== undefined) { |
|
|
|
|
// Ignore warnings (and the 'Deferred import' error as those are generated by us as a workaround
|
|
|
|
|
if (utils.errortype(data['error']) !== 'warning' && /Deferred import/.exec(data['error']) === null) { |
|
|
|
|
if (isValidError(data['error'])) { |
|
|
|
|
noFatalErrors = false; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (data['errors'] !== undefined) { |
|
|
|
|
data['errors'].forEach(function (err) { |
|
|
|
|
// Ignore warnings and the 'Deferred import' error as those are generated by us as a workaround
|
|
|
|
|
if (utils.errortype(err) !== 'warning' && /Deferred import/.exec(err) === null) { |
|
|
|
|
if (isValidError(err)) { |
|
|
|
|
noFatalErrors = false; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (!noFatalErrors) { |
|
|
|
|
// There are fatal errors - abort here
|
|
|
|
|
self.lastCompilationResult = null; |
|
|
|
|
self.event.trigger('compilationFinished', [false, data, source]); |
|
|
|
|
} else if (missingInputs !== undefined && missingInputs.length > 0) { |
|
|
|
|
compile(missingInputs); |
|
|
|
|