We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0abf9c2 commit a2709e7Copy full SHA for a2709e7
test/es12/optional-calls.js
@@ -110,6 +110,16 @@ const tests = [
110
assert.areEqual(42, (specialObj?.b)?.().c);
111
}
112
},
113
+ {
114
+ name: "Optional call of root function",
115
+ body(){
116
+ assert.areEqual(42, eval?.("42"));
117
+
118
+ globalThis.doNotUseThisBadGlobalFunction = () => 42;
119
+ assert.areEqual(42, doNotUseThisBadGlobalFunction?.());
120
+ assert.areEqual(42, eval("doNotUseThisBadGlobalFunction?.()"));
121
+ }
122
+ },
123
{
124
name: "Optional call in eval (function)",
125
body() {
0 commit comments