Commit ffb72f81 authored by Anna Henningsen's avatar Anna Henningsen Committed by Rod Vagg
Browse files

deps: cherry-pick 09b53ee from upstream V8

Original commit message:

    [api] Make running scripts in AddMessageListener callback work in debug mode

    The existance of an `AllowJavascriptExecutionDebugOnly` scope in
    `Isolate::ReportPendingMessages()` indicates that the API supports
    running arbitrary JS code in a `AddMessageListener` callback.

    Currently, this can fail in debug mode: The
    `!isolate->external_caught_exception()` condition is checked when
    entering API methods inside such a handler. However, if there is
    a verbose `TryCatch` active when the exception occurs, this
    check fails, and when calling `ToString()` on the exception object
    leaves a pending exception itself, the flag is re-set to `true`.

    Fix this problem by clearing the flag and the pending exception if
    there was one during `ToString()`. This matches the code a few lines
    up in `messages.cc`, so the exception state is now consistent
    during the callback.

    This currently makes a Node.js test fail in debug mode
    (`parallel/test-error-reporting`).

    Bug: node:7144
    Bug: node:17016
    Change-Id: I060d00fea3e9a497f4df34c6ff8d6e29ebe96321
    Reviewed-on: https://chromium-review.googlesource.com/718096


    Commit-Queue: Yang Guo <yangguo@chromium.org>
Reviewed-by: default avatarYang Guo <yangguo@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#49466}

Refs: https://github.com/v8/v8/commit/09b53eef4ca65a48e74fe0b199b2ee892a4321ed

PR-URL: https://github.com/nodejs/node/pull/21767
Refs: https://github.com/v8/v8/commit/09b53eef4ca65a48e74fe0b199b2ee892a4321ed


Reviewed-By: default avatarRuben Bridgewater <ruben@bridgewater.de>
Reviewed-By: default avatarMyles Borins <myles.borins@gmail.com>
parent 6f545d19
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment