From 522f09d0579cd62ee9acdf5613b732fb4bb0fb04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Sun, 12 Apr 2020 13:45:15 +0200 Subject: [PATCH] deps: V8: cherry-pick dc3a90be6ca7 Original commit message: [debug] Revert to old line number behavior for new Function() Reverting https://chromium-review.googlesource.com/c/v8/v8/+/1741660 This fixed one bug but caused a lot of others and on balance I think reverting it is the lesser evil. This also fixed generator-relocation.js because (function*(){}).constructor is the function constructor and we try to set a breakpoint on line 3. Bug: chromium:109362, chromium:1028689 Fixes: v8:9721 Change-Id: I1bfe6ec57ce77ea7292df91266311f5c0194947e Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1940259 Commit-Queue: Peter Marshall Reviewed-by: Yang Guo Cr-Commit-Position: refs/heads/master@{#65232} Refs: https://github.com/v8/v8/commit/dc3a90be6ca7f7160e1865f289e76c7bc32f78c4 Revert "assert: fix line number calculation after V8 upgrade" This reverts commit 5981fb7faa13de95550b01272ebfbd8a5220aadb. Fixes: https://github.com/nodejs/node/issues/32688 --- common.gypi | 2 +- deps/v8/src/builtins/builtins-function.cc | 11 ----------- deps/v8/test/cctest/test-api-stack-traces.cc | 10 +++++----- deps/v8/test/debugger/debugger.status | 3 --- .../runtime/evaluate-new-function-error-expected.txt | 6 +++--- deps/v8/test/mjsunit/regress/regress-crbug-109362.js | 8 ++++---- lib/assert.js | 5 +---- 7 files changed, 14 insertions(+), 31 deletions(-) diff --git a/common.gypi b/common.gypi index 954a824ab01885..e05da1680f2d69 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.30', + 'v8_embedder_string': '-node.31', ##### V8 defaults for Node.js ##### diff --git a/deps/v8/src/builtins/builtins-function.cc b/deps/v8/src/builtins/builtins-function.cc index f75014d0346266..f9a356f94bf6f6 100644 --- a/deps/v8/src/builtins/builtins-function.cc +++ b/deps/v8/src/builtins/builtins-function.cc @@ -93,17 +93,6 @@ MaybeHandle CreateDynamicFunction(Isolate* isolate, function->shared().set_name_should_print_as_anonymous(true); } - // The spec says that we have to wrap code created via the function - // constructor in e.g. 'function anonymous(' as above, including with extra - // line breaks. Ths is confusing when reporting stack traces from the eval'd - // code as the line number of the error is always reported with 2 extra line - // breaks e.g. line 1 is reported as line 3. We fix this up here by setting - // line_offset which is read by stack trace code. - Handle