-
Notifications
You must be signed in to change notification settings - Fork 27.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix imports in default arguments in functions (vercel/turborepo#3292)
- Loading branch information
Showing
33 changed files
with
237,706 additions
and
1 deletion.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
crates/next-dev/tests/integration/turbopack/basic/default-args/index.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 @@ | ||
import { named } from "./module.js"; | ||
|
||
function Fun({ value = named }) { | ||
return value; | ||
} | ||
|
||
it("support imports in default arguments", () => { | ||
expect(Fun({})).toBe("named"); | ||
}); |
1 change: 1 addition & 0 deletions
1
crates/next-dev/tests/integration/turbopack/basic/default-args/module.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 @@ | ||
export const named = "named"; |
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
66 changes: 66 additions & 0 deletions
66
crates/turbopack-ecmascript/tests/analyzer/graph/1/graph-effects.snapshot
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,66 @@ | ||
[ | ||
Call { | ||
func: FreeVar( | ||
Require, | ||
), | ||
args: [ | ||
Variable( | ||
( | ||
Atom('x' type=static), | ||
#1, | ||
), | ||
), | ||
], | ||
ast_path: [ | ||
Program( | ||
Module, | ||
), | ||
Module( | ||
Body( | ||
2, | ||
), | ||
), | ||
ModuleItem( | ||
ModuleDecl, | ||
), | ||
ModuleDecl( | ||
ExportDecl, | ||
), | ||
ExportDecl( | ||
Decl, | ||
), | ||
Decl( | ||
Fn, | ||
), | ||
FnDecl( | ||
Function, | ||
), | ||
Function( | ||
Body, | ||
), | ||
BlockStmt( | ||
Stmts( | ||
0, | ||
), | ||
), | ||
Stmt( | ||
Expr, | ||
), | ||
ExprStmt( | ||
Expr, | ||
), | ||
Expr( | ||
Call, | ||
), | ||
], | ||
span: Span { | ||
lo: BytePos( | ||
54, | ||
), | ||
hi: BytePos( | ||
64, | ||
), | ||
ctxt: #0, | ||
}, | ||
}, | ||
] |
1 change: 1 addition & 0 deletions
1
crates/turbopack-ecmascript/tests/analyzer/graph/2/graph-effects.snapshot
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 @@ | ||
[] |
Oops, something went wrong.