Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
efec7ab9
Commit
efec7ab9
authored
Oct 20, 2025
by
Luke Sandberg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update a test and fix a comment
parent
744e3624
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
10 deletions
+3
-10
magic-identifier.test.ts
packages/next/src/shared/lib/magic-identifier.test.ts
+1
-9
magic-identifier.ts
packages/next/src/shared/lib/magic-identifier.ts
+2
-1
No files found.
packages/next/src/shared/lib/magic-identifier.test.ts
View file @
efec7ab9
...
@@ -78,21 +78,13 @@ describe('deobfuscateModuleId', () => {
...
@@ -78,21 +78,13 @@ describe('deobfuscateModuleId', () => {
describe
(
'removeFreeCallWrapper'
,
()
=>
{
describe
(
'removeFreeCallWrapper'
,
()
=>
{
test
(
'removes (0, ) wrapper'
,
()
=>
{
test
(
'removes (0, ) wrapper'
,
()
=>
{
expect
(
removeFreeCallWrapper
(
'(0, foo
)'
)).
toBe
(
'foo
'
)
expect
(
removeFreeCallWrapper
(
'(0, foo
.bar)'
)).
toBe
(
'foo.bar
'
)
})
})
test
(
'removes (0 , ) wrapper with spaces'
,
()
=>
{
test
(
'removes (0 , ) wrapper with spaces'
,
()
=>
{
expect
(
removeFreeCallWrapper
(
'(0 , foo.bar)'
)).
toBe
(
'foo.bar'
)
expect
(
removeFreeCallWrapper
(
'(0 , foo.bar)'
)).
toBe
(
'foo.bar'
)
})
})
test
(
'handles nested expressions'
,
()
=>
{
expect
(
removeFreeCallWrapper
(
'(0 , __TURBOPACK__imported__module__$5b$project$5d$__.foo)'
)
).
toBe
(
'__TURBOPACK__imported__module__$5b$project$5d$__.foo'
)
})
test
(
'leaves non-free-call expressions unchanged'
,
()
=>
{
test
(
'leaves non-free-call expressions unchanged'
,
()
=>
{
expect
(
removeFreeCallWrapper
(
'(foo, bar)'
)).
toBe
(
'(foo, bar)'
)
expect
(
removeFreeCallWrapper
(
'(foo, bar)'
)).
toBe
(
'(foo, bar)'
)
expect
(
removeFreeCallWrapper
(
'foo()'
)).
toBe
(
'foo()'
)
expect
(
removeFreeCallWrapper
(
'foo()'
)).
toBe
(
'foo()'
)
...
...
packages/next/src/shared/lib/magic-identifier.ts
View file @
efec7ab9
...
@@ -137,7 +137,8 @@ export function removeFreeCallWrapper(text: string): string {
...
@@ -137,7 +137,8 @@ export function removeFreeCallWrapper(text: string): string {
* 3. Removing free call wrappers
* 3. Removing free call wrappers
*/
*/
export
function
deobfuscateText
(
text
:
string
):
string
{
export
function
deobfuscateText
(
text
:
string
):
string
{
// First, remove free call wrappers, by doing this
// First, remove free call wrappers, doing this first is important since the demangling might
// introduce whitespace character that complicate the matching.
let
result
=
removeFreeCallWrapper
(
text
)
let
result
=
removeFreeCallWrapper
(
text
)
// Then decode magic identifiers and clean up module IDs
// Then decode magic identifiers and clean up module IDs
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment