File tree Expand file tree Collapse file tree 3 files changed +27
-1
lines changed
test/cases/parsing/sequence-expression-asi Expand file tree Collapse file tree 3 files changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -3096,11 +3096,13 @@ class JavascriptParser extends Parser {
30963096 currentStatement . expression === expression )
30973097 ) {
30983098 const old = /** @type {StatementPathItem } */ ( this . statementPath . pop ( ) ) ;
3099+ const prev = this . prevStatement ;
30993100 for ( const expr of expression . 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 ) ;
Original file line number Diff line number Diff line change 1+ export const fn = ( num ) => {
2+ return num ;
3+ } ;
Original file line number Diff line number Diff line change 1+ import { fn } from "./a"
2+
3+ function d ( ) { }
4+
5+ var num = 1
6+ d ( ) , fn ( ) ;
7+
8+ export const b = 2
9+ d ( ) , fn ( ) ;
10+
11+ export default ( function Foo ( ) { } )
12+ d ( ) , fn ( ) ;
13+
14+ export const c = 3
15+ function foo ( ) {
16+ d ( ) , fn ( ) ;
17+ }
18+
19+ it ( "should work" , function ( ) {
20+ expect ( fn ( num ) ) . toBe ( 1 ) ;
21+ } ) ;
You can’t perform that action at this time.
0 commit comments