fix console.error crash (#532)
This commit is contained in:
parent
6faf52f61e
commit
193b15e074
1 changed files with 5 additions and 3 deletions
|
@ -187,10 +187,12 @@ class Editor extends React.Component {
|
|||
if (this.props.runtimeErrorWarningVisible) {
|
||||
this.props.consoleEvents.forEach((consoleEvent) => {
|
||||
if (consoleEvent.method === 'error') {
|
||||
if (consoleEvent.arguments.indexOf(')') > -1) {
|
||||
const n = consoleEvent.arguments.replace(')', '').split(' ');
|
||||
const lineNumber = parseInt(n[n.length - 1], 10) - 1;
|
||||
this._cm.addLineClass(lineNumber, 'background', 'line-runtime-error');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue