From e111d3c020a4a56c33ee901a1afa1826a0edab7e Mon Sep 17 00:00:00 2001 From: Cassie Tarakajian Date: Tue, 1 Aug 2017 15:03:48 -0400 Subject: [PATCH] fix line number for runtime errors --- client/modules/IDE/components/PreviewFrame.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/modules/IDE/components/PreviewFrame.jsx b/client/modules/IDE/components/PreviewFrame.jsx index c29d2e54..314090c7 100644 --- a/client/modules/IDE/components/PreviewFrame.jsx +++ b/client/modules/IDE/components/PreviewFrame.jsx @@ -34,8 +34,8 @@ function getAllScriptOffsets(htmlFile) { } else { endFilenameInd = htmlFile.indexOf('.js', ind + startTag.length + 3); filename = htmlFile.substring(ind + startTag.length, endFilenameInd); - // the length of hijackConsoleErrorsScript is 35 lines, already needed a -1 offset. - lineOffset = htmlFile.substring(0, ind).split('\n').length + 34; + // the length of hijackConsoleErrorsScript is 31 lines + lineOffset = htmlFile.substring(0, ind).split('\n').length + 31; offs.push([lineOffset, filename]); lastInd = ind + 1; }