add optional chaining and nullish coalescing support#11198
add optional chaining and nullish coalescing support#11198vankop wants to merge 3 commits intowebpack:masterfrom
Conversation
|
For maintainers only:
|
|
|
||
| exports[`StatsTestCases should print correct stats for filter-warnings 1`] = ` | ||
| "Hash: 2220740a2bcff63070922220740a2bcff63070922220740a2bcff63070922220740a2bcff63070922220740a2bcff63070922220740a2bcff63070922220740a2bcff63070922220740a2bcff63070922220740a2bcff63070922220740a2bcff63070922220740a2bcff63070922220740a2bcff63070922220740a2bcff6307092 | ||
| "Hash: 73a3198368d23afbbd6573a3198368d23afbbd6573a3198368d23afbbd6573a3198368d23afbbd6573a3198368d23afbbd6573a3198368d23afbbd6573a3198368d23afbbd6573a3198368d23afbbd6573a3198368d23afbbd6573a3198368d23afbbd6573a3198368d23afbbd6573a3198368d23afbbd6573a3198368d23afbbd65 |
There was a problem hiding this comment.
don't know why hashes changed
- add handleStrictEqualityComparison callback - add handleAbstractEqualityComparison callback - rework evaluateIdentifier interface - add tests
|
|
||
| if (!process.version.startsWith("v14")) return; | ||
|
|
||
| const value10 = "" ?? require("fail"); |
There was a problem hiding this comment.
Test is passing, but since we render "" ?? false need to find a way to load this tests in Node.js < 14. Maybe use babel before load or move this to configCases and handle there with babel.
| }); | ||
|
|
||
| it("should evaluate module.hot to nullish", () => { | ||
| if (module.hot ?? true) { |
There was a problem hiding this comment.
Should I move this to configCases since this does not work with TestCasesHot?
| @@ -0,0 +1,5 @@ | |||
| it("should handle optional members", () => { | |||
| expect( | |||
| module.hot?.accept((() => {throw new Error("fail")})()) | |||
There was a problem hiding this comment.
Should I move this to configCases since this does not work with TestCasesHot?
|
|
||
| it("should correctly render defined data #2", () => { | ||
| const val1 = _VALUE_?._PROP_?._DEFINED_; | ||
| const val2 = _VALUE_?._PROP_?._UNDEFINED_; |
There was a problem hiding this comment.
Should I keep this test case? Same problem
Test is passing, but since we render "" ?? false need to find a way to load this tests in Node.js < 14. Maybe use babel before load or move this to configCases and handle there with babel.
| devtool: false, | ||
| target: "web", | ||
| plugins: [ | ||
| new DefinePlugin({ |
There was a problem hiding this comment.
this import leads to typing errors..
abd8905 to
4bfe6be
Compare
|
Thanks for this! Looking forward to a merge so I can use vanilla javascript lol |
What kind of change does this PR introduce?
closes #11186
closes #10227
Did you add tests for your changes?
yes
Does this PR introduce a breaking change?
no
What needs to be documented once your changes are merged?
nothing