Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
86 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
...plugin-proposal-optional-chaining/test/fixtures/general/optional-eval-call-loose/input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
var foo; | ||
|
||
/* indirect eval calls */ | ||
eval?.(foo); | ||
|
||
(eval)?.(foo); | ||
|
||
eval?.()(); | ||
|
||
eval?.().foo; | ||
|
||
/* direct eval calls */ | ||
|
||
eval()?.(); | ||
|
||
eval()?.foo; | ||
|
||
/* plain function calls */ | ||
|
||
foo.eval?.(foo); | ||
|
||
eval.foo?.(foo); |
3 changes: 3 additions & 0 deletions
3
...in-proposal-optional-chaining/test/fixtures/general/optional-eval-call-loose/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"plugins": [["proposal-optional-chaining", { "loose": true }]] | ||
} |
17 changes: 17 additions & 0 deletions
17
...lugin-proposal-optional-chaining/test/fixtures/general/optional-eval-call-loose/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
var _eval, _eval2; | ||
|
||
var foo; | ||
/* indirect eval calls */ | ||
|
||
eval == null ? void 0 : (0, eval)(foo); | ||
eval == null ? void 0 : (0, eval)(foo); | ||
eval == null ? void 0 : (0, eval)()(); | ||
eval == null ? void 0 : (0, eval)().foo; | ||
/* direct eval calls */ | ||
|
||
(_eval = eval()) == null ? void 0 : _eval(); | ||
(_eval2 = eval()) == null ? void 0 : _eval2.foo; | ||
/* plain function calls */ | ||
|
||
foo.eval == null ? void 0 : foo.eval(foo); | ||
eval.foo == null ? void 0 : eval.foo(foo); |
22 changes: 22 additions & 0 deletions
22
...babel-plugin-proposal-optional-chaining/test/fixtures/general/optional-eval-call/input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
var foo; | ||
|
||
/* indirect eval calls */ | ||
eval?.(foo); | ||
|
||
(eval)?.(foo); | ||
|
||
eval?.()(); | ||
|
||
eval?.().foo; | ||
|
||
/* direct eval calls */ | ||
|
||
eval()?.(); | ||
|
||
eval()?.foo; | ||
|
||
/* plain function calls */ | ||
|
||
foo.eval?.(foo); | ||
|
||
eval.foo?.(foo); |
17 changes: 17 additions & 0 deletions
17
...abel-plugin-proposal-optional-chaining/test/fixtures/general/optional-eval-call/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
var _eval, _eval2, _foo$eval, _eval$foo; | ||
|
||
var foo; | ||
/* indirect eval calls */ | ||
|
||
eval === null || eval === void 0 ? void 0 : (0, eval)(foo); | ||
eval === null || eval === void 0 ? void 0 : (0, eval)(foo); | ||
eval === null || eval === void 0 ? void 0 : (0, eval)()(); | ||
eval === null || eval === void 0 ? void 0 : (0, eval)().foo; | ||
/* direct eval calls */ | ||
|
||
(_eval = eval()) === null || _eval === void 0 ? void 0 : _eval(); | ||
(_eval2 = eval()) === null || _eval2 === void 0 ? void 0 : _eval2.foo; | ||
/* plain function calls */ | ||
|
||
(_foo$eval = foo.eval) === null || _foo$eval === void 0 ? void 0 : _foo$eval.call(foo, foo); | ||
(_eval$foo = eval.foo) === null || _eval$foo === void 0 ? void 0 : _eval$foo.call(eval, foo); |