v8/test/mjsunit/regress/regress-crbug-1239907.js
Camillo Bruni 6a34897e54 [d8] Guard async hooks against stack overflows
Drive-by-fix: Use switch statement in AsyncHooks::PromiseHookDispatch

Bug: chromium:1239907
Change-Id: I882956bfed92b56e1e8d885bdc68e205dd80c135
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3097882
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#76339}
2021-08-17 09:23:15 +00:00

17 lines
492 B
JavaScript

// Copyright 2021 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --expose-async-hooks --ignore-unhandled-promises --stack-size=100
async_hooks.createHook({ promiseResolve() { throw new Error(); } }).enable()
import("./does_not_exist.js").then();
function target() {
isFinite.__proto__.__proto__ = new Proxy(target, {
get() { return Promise.resolve(); }
})
}
target();