mirror of
https://github.com/tc39/test262.git
synced 2025-07-24 06:25:30 +02:00
Fix unexpected pass on ShadowRealm wrapped function (#3312)
This commit is contained in:
parent
cba42e88c7
commit
d52b510a33
@ -16,6 +16,12 @@ assert.sameValue(
|
|||||||
const r = new ShadowRealm();
|
const r = new ShadowRealm();
|
||||||
const wrappedFunction = r.evaluate('() => {}');
|
const wrappedFunction = r.evaluate('() => {}');
|
||||||
|
|
||||||
|
assert.sameValue(
|
||||||
|
typeof wrappedFunction,
|
||||||
|
'function',
|
||||||
|
'This test must fail if wrappedFunction is not a function'
|
||||||
|
);
|
||||||
|
|
||||||
assert.throws(TypeError, () => wrappedFunction(1, globalThis), 'globalThis');
|
assert.throws(TypeError, () => wrappedFunction(1, globalThis), 'globalThis');
|
||||||
assert.throws(TypeError, () => wrappedFunction(1, []), 'array literal');
|
assert.throws(TypeError, () => wrappedFunction(1, []), 'array literal');
|
||||||
assert.throws(TypeError, () => wrappedFunction(1, {
|
assert.throws(TypeError, () => wrappedFunction(1, {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user