Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5ac3d7f

Browse files
fix: unexpected asi generation with sequence expression
2 parentsf46a03c +b8c03d4 commit5ac3d7f

File tree

3 files changed

+27
-1
lines changed

3 files changed

+27
-1
lines changed

‎lib/javascript/JavascriptParser.js‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3096,11 +3096,13 @@ class JavascriptParser extends Parser {
30963096
currentStatement.expression===expression)
30973097
){
30983098
constold=/**@type {StatementPathItem} */(this.statementPath.pop());
3099+
constprev=this.prevStatement;
30993100
for(constexprofexpression.expressions){
31003101
this.statementPath.push(expr);
31013102
this.walkExpression(expr);
3102-
this.statementPath.pop();
3103+
this.prevStatement=this.statementPath.pop();
31033104
}
3105+
this.prevStatement=prev;
31043106
this.statementPath.push(old);
31053107
}else{
31063108
this.walkExpressions(expression.expressions);
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
exportconstfn=(num)=>{
2+
returnnum;
3+
};
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import{fn}from"./a"
2+
3+
functiond(){}
4+
5+
varnum=1
6+
d(),fn();
7+
8+
exportconstb=2
9+
d(),fn();
10+
11+
exportdefault(functionFoo(){})
12+
d(),fn();
13+
14+
exportconstc=3
15+
functionfoo(){
16+
d(),fn();
17+
}
18+
19+
it("should work",function(){
20+
expect(fn(num)).toBe(1);
21+
});

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp