Commit b8dae132 authored by Toon Verwaest's avatar Toon Verwaest Committed by V8 LUCI CQ

Reland [json] Set options to share on JSON.parse error script

This ensures that the unhandledrejection callback fires.

Bug: chromium:1219363
Change-Id: I367d9a90132443e8ec94c1db380b9ef3160625c7
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3326242Reviewed-by: 's avatarCamillo Bruni <cbruni@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78321}
parent 6b1fb003
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include "src/common/globals.h" #include "src/common/globals.h"
#include "src/common/message-template.h" #include "src/common/message-template.h"
#include "src/debug/debug.h" #include "src/debug/debug.h"
#include "src/execution/frames-inl.h"
#include "src/numbers/conversions.h" #include "src/numbers/conversions.h"
#include "src/numbers/hash-seed-inl.h" #include "src/numbers/hash-seed-inl.h"
#include "src/objects/field-type.h" #include "src/objects/field-type.h"
...@@ -274,6 +275,17 @@ void JsonParser<Char>::ReportUnexpectedToken(JsonToken token) { ...@@ -274,6 +275,17 @@ void JsonParser<Char>::ReportUnexpectedToken(JsonToken token) {
if (isolate()->NeedsSourcePositionsForProfiling()) { if (isolate()->NeedsSourcePositionsForProfiling()) {
Script::InitLineEnds(isolate(), script); Script::InitLineEnds(isolate(), script);
} }
StackTraceFrameIterator it(isolate_);
if (!it.done() && it.is_javascript()) {
FrameSummary summary = it.GetTopValidFrame();
script->set_eval_from_shared(summary.AsJavaScript().function()->shared());
if (summary.script()->IsScript()) {
script->set_origin_options(
Script::cast(*summary.script()).origin_options());
}
}
// We should sent compile error event because we compile JSON object in // We should sent compile error event because we compile JSON object in
// separated source file. // separated source file.
isolate()->debug()->OnCompileError(script); isolate()->debug()->OnCompileError(script);
......
Markdown is supported
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