1de7e24902
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}
12 lines
332 B
JavaScript
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));
|