v8/test/mjsunit/regress/regress-crbug-1339722-3.js
Joyee Cheung 81c14eb85d [runtime] return when failed access callback doesn't throw
When the failed access callback is configured but it doesn't throw,
we should return instead of expecting an exception, otherwise
it would crash because there isn't one.

This patch also adds --throw-on-failed-access-check and
--noop-on-failed-access-check in d8 to mimic the behavior
of the failed access check callback in chromium.

Bug: chromium:1339722
Change-Id: Ie1db9d2fb364c6f8259eb9b8d81a21071c280a80
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3737305
Commit-Queue: Joyee Cheung <joyee@igalia.com>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/main@{#81557}
2022-07-06 14:01:36 +00:00

19 lines
569 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.
// Flags: --throw-on-failed-access-check
d8.file.execute('test/mjsunit/regress/regress-crbug-1321899.js');
// Attached global should have access
const realm = Realm.createAllowCrossRealmAccess();
const globalProxy = Realm.global(realm);
checkHasAccess(globalProxy);
// Access should fail after detaching
Realm.navigate(realm);
checkNoAccess(globalProxy, /Error in failed access check callback/);