This commit is contained in:
Cassie Tarakajian 2016-10-08 19:18:38 -04:00
parent d8ad4849e4
commit 37bb45cc37
2 changed files with 4 additions and 2 deletions

View file

@ -27,6 +27,7 @@ class Console extends React.Component {
if (nextProps.isPlaying && !this.props.isPlaying) {
this.children = [];
} else if (nextProps.consoleEvent !== this.props.consoleEvent && this.props.isPlaying) {
console.log(nextProps.consoleEvent);
nextProps.consoleEvent.forEach(consoleEvent => {
if (consoleEvent.source === 'sketch') {
const args = consoleEvent.arguments;

View file

@ -101,11 +101,12 @@ function hijackConsoleErrorsScript(offs) {
var fileInfo = getScriptOff(lineNumber);
data = msg + ' (' + fileInfo[1] + ': line ' + fileInfo[0] + ')';
}
window.parent.postMessage({
window.parent.postMessage([{
method: 'error',
arguments: data,
source: 'sketch'
}, '*');
}], '*');
return false;
};
</script>`;