Skip to content

bump goja - #7467

Merged
ehsandeep merged 1 commit into
devfrom
bump-goja-fork
Jun 20, 2026
Merged

bump goja#7467
ehsandeep merged 1 commit into
devfrom
bump-goja-fork

Conversation

@Mzack9999

@Mzack9999 Mzack9999 commented Jun 18, 2026

Copy link
Copy Markdown
Member

bumping goja version

Summary by CodeRabbit

  • Chores
    • Updated JavaScript runtime dependency versions from Mzack9999 fork to projectdiscovery fork across codebase
    • Bumped semantic versioning library from v3.4.0 to v3.5.0
    • Added regexp2 library as indirect dependency

@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

All goja and goja_nodejs import paths are migrated from github.com/Mzack9999 to github.com/projectdiscovery across go.mod and every consuming Go source and test file. go.mod also bumps github.com/Masterminds/semver/v3 to v3.5.0 and adds github.com/dlclark/regexp2/v2 v2.2.1 as a new indirect dependency.

Changes

goja/goja_nodejs Module Migration

Layer / File(s) Summary
go.mod dependency updates
go.mod
Bumps github.com/Masterminds/semver/v3 to v3.5.0, updates goja and goja_nodejs to new v0.0.0-202606... revisions, and adds indirect dependency github.com/dlclark/regexp2/v2 v2.2.1.
Import path rewrites across all source and test files
pkg/js/compiler/*.go, pkg/js/global/*.go, pkg/js/gojs/*.go, pkg/js/libs/*/*.go, pkg/js/utils/*.go, pkg/protocols/code/*.go, pkg/protocols/common/protocolstate/js.go, pkg/protocols/javascript/js.go, pkg/tmplexec/exec.go, pkg/tmplexec/flow/*.go
Replaces every github.com/Mzack9999/goja and github.com/Mzack9999/goja_nodejs import with the github.com/projectdiscovery/goja and github.com/projectdiscovery/goja_nodejs equivalents. No logic, exported APIs, or runtime behavior is changed.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Suggested reviewers

  • dwisiswant0

Poem

🐇 Hop, hop, a namespace swap!
From Mzack's path to our own map,
projectdiscovery/goja now rings true,
Thirty-odd files all shiny and new.
The rabbit approves — it's tidy and neat! 🌿

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'bump goja' clearly and concisely describes the main change in the PR: updating the goja dependency to a new version.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch bump-goja-fork

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
pkg/js/global/scripts_test.go (1)

11-28: ⚠️ Potential issue | 🔴 Critical

Fix undefined variable defaultImports before tests can run.

The test file has a compilation error at line 12: defaultImports is assigned but never declared. This needs to be either declared as a package-level variable, imported from another package, or handled differently in the test setup. This prevents the code from building and must be resolved.

Additionally, verify that all old import paths have been fully replaced across the codebase. Some files may still be using the legacy github.com/Mzack9999/ imports that need updating as part of this migration.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pkg/js/global/scripts_test.go` around lines 11 - 28, The TestScriptsRuntime
function references an undefined variable defaultImports at the beginning of the
function. Declare defaultImports as either a package-level variable before the
TestScriptsRuntime function definition or as a local variable within the test
function using the proper Go syntax (either var defaultImports = "" at the
package level or defaultImports := "" within the function). This will resolve
the compilation error and allow the test to build and run successfully.

Source: Coding guidelines

🧹 Nitpick comments (1)
go.mod (1)

103-104: ⚡ Quick win

Consider using tagged releases instead of pseudo-versions.

The pseudo-versions v0.0.0-20260618133720-acb73e419534 and v0.0.0-20260618132410-8519f75f703d reference specific commits rather than stable tagged releases. For production dependencies, tagged semantic versions are preferred for stability and reproducibility.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@go.mod` around lines 103 - 104, Replace the pseudo-version references for the
dependencies github.com/projectdiscovery/goja and
github.com/projectdiscovery/goja_nodejs with proper tagged semantic versions.
Check the repositories for available stable releases and update the version
strings in go.mod from the current commit-based pseudo-versions to the latest
stable tagged release versions to ensure better stability and reproducibility
for production dependencies.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@pkg/js/global/scripts_test.go`:
- Around line 11-28: The TestScriptsRuntime function references an undefined
variable defaultImports at the beginning of the function. Declare defaultImports
as either a package-level variable before the TestScriptsRuntime function
definition or as a local variable within the test function using the proper Go
syntax (either var defaultImports = "" at the package level or defaultImports :=
"" within the function). This will resolve the compilation error and allow the
test to build and run successfully.

---

Nitpick comments:
In `@go.mod`:
- Around line 103-104: Replace the pseudo-version references for the
dependencies github.com/projectdiscovery/goja and
github.com/projectdiscovery/goja_nodejs with proper tagged semantic versions.
Check the repositories for available stable releases and update the version
strings in go.mod from the current commit-based pseudo-versions to the latest
stable tagged release versions to ensure better stability and reproducibility
for production dependencies.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f46c57c8-ea98-42e3-9be5-2b27b86974c5

📥 Commits

Reviewing files that changed from the base of the PR and between c0b1f4b and b4e1780.

⛔ Files ignored due to path filters (30)
  • go.sum is excluded by !**/*.sum
  • pkg/js/generated/go/libbytes/bytes.go is excluded by !**/generated/**
  • pkg/js/generated/go/libdcerpc/dcerpc.go is excluded by !**/generated/**
  • pkg/js/generated/go/libdcom/dcom.go is excluded by !**/generated/**
  • pkg/js/generated/go/libfs/fs.go is excluded by !**/generated/**
  • pkg/js/generated/go/libgoconsole/goconsole.go is excluded by !**/generated/**
  • pkg/js/generated/go/libikev2/ikev2.go is excluded by !**/generated/**
  • pkg/js/generated/go/libkerberos/kerberos.go is excluded by !**/generated/**
  • pkg/js/generated/go/libkrbforge/krbforge.go is excluded by !**/generated/**
  • pkg/js/generated/go/libkrbroast/krbroast.go is excluded by !**/generated/**
  • pkg/js/generated/go/libldap/ldap.go is excluded by !**/generated/**
  • pkg/js/generated/go/libmssql/mssql.go is excluded by !**/generated/**
  • pkg/js/generated/go/libmysql/mysql.go is excluded by !**/generated/**
  • pkg/js/generated/go/libnet/net.go is excluded by !**/generated/**
  • pkg/js/generated/go/liboracle/oracle.go is excluded by !**/generated/**
  • pkg/js/generated/go/libpop3/pop3.go is excluded by !**/generated/**
  • pkg/js/generated/go/libpostgres/postgres.go is excluded by !**/generated/**
  • pkg/js/generated/go/librdp/rdp.go is excluded by !**/generated/**
  • pkg/js/generated/go/libredis/redis.go is excluded by !**/generated/**
  • pkg/js/generated/go/librsync/rsync.go is excluded by !**/generated/**
  • pkg/js/generated/go/libscmr/scmr.go is excluded by !**/generated/**
  • pkg/js/generated/go/libsecretsdump/secretsdump.go is excluded by !**/generated/**
  • pkg/js/generated/go/libsmb/smb.go is excluded by !**/generated/**
  • pkg/js/generated/go/libsmtp/smtp.go is excluded by !**/generated/**
  • pkg/js/generated/go/libssh/ssh.go is excluded by !**/generated/**
  • pkg/js/generated/go/libstructs/structs.go is excluded by !**/generated/**
  • pkg/js/generated/go/libtelnet/telnet.go is excluded by !**/generated/**
  • pkg/js/generated/go/libtsch/tsch.go is excluded by !**/generated/**
  • pkg/js/generated/go/libvnc/vnc.go is excluded by !**/generated/**
  • pkg/js/generated/go/libwmi/wmi.go is excluded by !**/generated/**
📒 Files selected for processing (35)
  • go.mod
  • pkg/js/compiler/compiler.go
  • pkg/js/compiler/compiler_test.go
  • pkg/js/compiler/non-pool.go
  • pkg/js/compiler/pool.go
  • pkg/js/compiler/session.go
  • pkg/js/global/helpers.go
  • pkg/js/global/scripts.go
  • pkg/js/global/scripts_test.go
  • pkg/js/gojs/gojs.go
  • pkg/js/gojs/set.go
  • pkg/js/libs/bytes/buffer.go
  • pkg/js/libs/dcerpc/dcerpc.go
  • pkg/js/libs/dcom/dcom.go
  • pkg/js/libs/goconsole/log.go
  • pkg/js/libs/kerberos/kerberosx.go
  • pkg/js/libs/krbroast/krbroast.go
  • pkg/js/libs/ldap/ldap.go
  • pkg/js/libs/scmr/scmr.go
  • pkg/js/libs/secretsdump/secretsdump.go
  • pkg/js/libs/smtp/smtp.go
  • pkg/js/libs/tsch/tsch.go
  • pkg/js/libs/wmi/wmi.go
  • pkg/js/libs/wmi/wmi_test.go
  • pkg/js/utils/nucleijs.go
  • pkg/js/utils/nucleijs_test.go
  • pkg/protocols/code/code.go
  • pkg/protocols/code/helpers.go
  • pkg/protocols/common/protocolstate/js.go
  • pkg/protocols/javascript/js.go
  • pkg/tmplexec/exec.go
  • pkg/tmplexec/flow/builtin/dedupe.go
  • pkg/tmplexec/flow/flow_executor.go
  • pkg/tmplexec/flow/flow_internal.go
  • pkg/tmplexec/flow/vm.go

@Mzack9999
Mzack9999 requested a review from ehsandeep June 18, 2026 15:41
@daviediao-code

Copy link
Copy Markdown

Reviewed this PR.

Assessment: Implementation looks solid and follows project conventions. Clean code quality.

Approved ✅

@ehsandeep
ehsandeep merged commit 1fe6025 into dev Jun 20, 2026
19 checks passed
@ehsandeep
ehsandeep deleted the bump-goja-fork branch June 20, 2026 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants