Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: NodePath.get is always non nullish
- Loading branch information
Showing
6 changed files
with
60 additions
and
3 deletions.
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
9 changes: 9 additions & 0 deletions
9
...plugin-proposal-optional-chaining/test/fixtures/general/in-function-params-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,9 @@ | ||
function f(a = x?.y) {} | ||
|
||
function g({ a, b = a?.c }) {} | ||
|
||
function h(a, { b = a.b?.c?.d.e }) {} | ||
|
||
function i(a, { b = (a.b?.c?.d).e }) {} | ||
|
||
function j(a, { b = a?.b?.c().d.e }) {} |
3 changes: 3 additions & 0 deletions
3
...in-proposal-optional-chaining/test/fixtures/general/in-function-params-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 }]] | ||
} |
34 changes: 34 additions & 0 deletions
34
...lugin-proposal-optional-chaining/test/fixtures/general/in-function-params-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,34 @@ | ||
function f(a = (() => { | ||
var _x; | ||
|
||
return (_x = x) == null ? void 0 : _x.y; | ||
})()) {} | ||
|
||
function g({ | ||
a, | ||
b = a == null ? void 0 : a.c | ||
}) {} | ||
|
||
function h(a, { | ||
b = (() => { | ||
var _a$b, _a$b$c; | ||
|
||
return (_a$b = a.b) == null ? void 0 : (_a$b$c = _a$b.c) == null ? void 0 : _a$b$c.d.e; | ||
})() | ||
}) {} | ||
|
||
function i(a, { | ||
b = (() => { | ||
var _a$b2, _a$b2$c; | ||
|
||
return (_a$b2 = a.b) == null ? void 0 : (_a$b2$c = _a$b2.c) == null ? void 0 : _a$b2$c.d; | ||
})().e | ||
}) {} | ||
|
||
function j(a, { | ||
b = (() => { | ||
var _a$b3; | ||
|
||
return a == null ? void 0 : (_a$b3 = a.b) == null ? void 0 : _a$b3.c().d.e; | ||
})() | ||
}) {} |
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
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