From 9b6e7973796713bc920bf02f1a5b980adb34a337 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Fri, 6 Dec 2019 14:33:27 +0100 Subject: [PATCH] Revert "assert: fix line number calculation after V8 upgrade" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 5981fb7faa13de95550b01272ebfbd8a5220aadb. PR-URL: https://github.com/nodejs/node/pull/32116 Reviewed-By: Michaƫl Zasso Reviewed-By: Jiawen Geng Reviewed-By: Ruben Bridgewater --- common.gypi | 2 +- lib/assert.js | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/common.gypi b/common.gypi index ee45b238a61c58..12c9e65983663a 100644 --- a/common.gypi +++ b/common.gypi @@ -35,7 +35,7 @@ # Reset this number to 0 on major V8 upgrades. # Increment by one for each non-official patch applied to deps/v8. - 'v8_embedder_string': '-node.6', + 'v8_embedder_string': '-node.7', ##### V8 defaults for Node.js ##### diff --git a/lib/assert.js b/lib/assert.js index d01e9ccc2b29b4..45c4644279de33 100644 --- a/lib/assert.js +++ b/lib/assert.js @@ -278,7 +278,7 @@ function getErrMessage(message, fn) { const call = err.stack[0]; const filename = call.getFileName(); - let line = call.getLineNumber() - 1; + const line = call.getLineNumber() - 1; let column = call.getColumnNumber() - 1; let identifier; let code; @@ -298,9 +298,6 @@ function getErrMessage(message, fn) { return message; } code = String(fn); - // For functions created with the Function constructor, V8 does not count - // the lines containing the function header. - line += 2; identifier = `${code}${line}${column}`; }