parent
3f821ffb32
commit
d0832ea4b7
1 changed files with 7 additions and 2 deletions
|
@ -192,10 +192,15 @@ class Editor extends React.Component {
|
||||||
if (this.props.runtimeErrorWarningVisible && this._cm.getDoc().modeOption === 'javascript') {
|
if (this.props.runtimeErrorWarningVisible && this._cm.getDoc().modeOption === 'javascript') {
|
||||||
this.props.consoleEvents.forEach((consoleEvent) => {
|
this.props.consoleEvents.forEach((consoleEvent) => {
|
||||||
if (consoleEvent.method === 'error') {
|
if (consoleEvent.method === 'error') {
|
||||||
if (consoleEvent.data[0].indexOf(')') > -1) {
|
if (consoleEvent.data &&
|
||||||
|
consoleEvent.data[0] &&
|
||||||
|
consoleEvent.data[0].indexOf &&
|
||||||
|
consoleEvent.data[0].indexOf(')') > -1) {
|
||||||
const n = consoleEvent.data[0].replace(')', '').split(' ');
|
const n = consoleEvent.data[0].replace(')', '').split(' ');
|
||||||
const lineNumber = parseInt(n[n.length - 1], 10) - 1;
|
const lineNumber = parseInt(n[n.length - 1], 10) - 1;
|
||||||
this._cm.addLineClass(lineNumber, 'background', 'line-runtime-error');
|
if (!Number.isNaN(lineNumber)) {
|
||||||
|
this._cm.addLineClass(lineNumber, 'background', 'line-runtime-error');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue