v8/test/mjsunit/async-hooks/regress-crbug-1337629.js
Maya Lekova 1de7e24902 [d8] Handle exceptions on async_hooks.createHook
Before we assumed that no exception can be thrown when specifying a
function to be used as an async hook, but that's not the case when e.g.
the object passed to createHook is a proxy trapping on property access
and the trap throws an exception.

Bug: chromium:1337629
Change-Id: I7bd7893cd274afb6e642ed18aacb9e203f7fdd96
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3714233
Commit-Queue: Maya Lekova <mslekova@chromium.org>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#81258}
2022-06-21 08:54:53 +00:00

12 lines
332 B
JavaScript

// Copyright 2022 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.
const failing_proxy = new Proxy({}, new Proxy({}, {
get() {
throw "No trap should fire";
}
}));
assertThrows(() => async_hooks.createHook(failing_proxy));