Commit cbcecc2f authored by Sigurd Schneider's avatar Sigurd Schneider Committed by Commit Bot

[test] Add a simple repro for the referenced bug

Bug: v8:7659
Change-Id: Ib4a44eef02398482a969084f5004d6096e1fd979
Reviewed-on: https://chromium-review.googlesource.com/1017100Reviewed-by: 's avatarGeorg Neis <neis@chromium.org>
Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52675}
parent 9a9fdbff
......@@ -17786,6 +17786,35 @@ TEST(PromiseRejectCallback) {
CHECK_EQ(7, promise_reject_msg_column_number);
}
void PromiseRejectCallbackConstructError(
v8::PromiseRejectMessage reject_message) {
v8::Local<v8::Context> context = CcTest::isolate()->GetCurrentContext();
CHECK_EQ(v8::Promise::PromiseState::kRejected,
reject_message.GetPromise()->State());
USE(v8::Script::Compile(context, v8_str("new Error('test')"))
.ToLocalChecked()
->Run(context));
}
TEST(PromiseRejectCallbackConstructError) {
i::FLAG_allow_natives_syntax = true;
LocalContext env;
v8::Isolate* isolate = env->GetIsolate();
v8::HandleScope scope(isolate);
isolate->SetPromiseRejectCallback(PromiseRejectCallbackConstructError);
ResetPromiseStates();
CompileRun(
"function f(p) {"
" p.catch(() => {});"
"}"
"f(Promise.reject());"
"f(Promise.reject());"
"%OptimizeFunctionOnNextCall(f);"
"let p = Promise.reject();"
"f(p);");
}
void AnalyzeStackOfEvalWithSourceURL(
const v8::FunctionCallbackInfo<v8::Value>& args) {
......
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