-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(es/compat): Skip
getter
and setter
as FlowHelper function
do (
#9580) **Related issue:** - Closes: #9579 - #9161 (comment)
- Loading branch information
1 parent
fc0ba2a
commit 14cfd70
Showing
5 changed files
with
70 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
swc_ecma_compat_es2015: patch | ||
swc_core: patch | ||
--- | ||
|
||
fix(es/compat): Skip `getter` and `setter` as FlowHelper `function` do |
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,19 @@ | ||
{ | ||
"jsc": { | ||
"parser": { | ||
"syntax": "typescript", | ||
"tsx": true | ||
}, | ||
"target": "es5", | ||
"loose": false, | ||
"minify": { | ||
"compress": false, | ||
"mangle": false | ||
} | ||
}, | ||
"module": { | ||
"type": "es6" | ||
}, | ||
"minify": false, | ||
"isModule": true | ||
} |
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,21 @@ | ||
function expectA(a) { | ||
console.log(a.b === 1) | ||
} | ||
|
||
export function test() { | ||
// any loop | ||
for (let i = 0; i < 1; i++) { | ||
const a = { | ||
get b() { | ||
return 1 | ||
} | ||
} | ||
const c = 2 | ||
; () => { | ||
// create any arrow function that references value in loop | ||
c | ||
} | ||
// We expect a.b to be 1 | ||
expectA(a) | ||
} | ||
} |
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,18 @@ | ||
function expectA(a) { | ||
console.log(a.b === 1); | ||
} | ||
export function test() { | ||
var _loop = function(i) { | ||
var a = { | ||
get b () { | ||
return 1; | ||
} | ||
}; | ||
var c = 2; | ||
(function() { | ||
c; | ||
}); | ||
expectA(a); | ||
}; | ||
for(var i = 0; i < 1; i++)_loop(i); | ||
} |
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