Skip to content

fix: handle read-only Error.prepareStackTrace safely#2443

Open
raashish1601 wants to merge 1 commit into
pinojs:mainfrom
raashish1601:spark/caller-readonly-stacktrace
Open

fix: handle read-only Error.prepareStackTrace safely#2443
raashish1601 wants to merge 1 commit into
pinojs:mainfrom
raashish1601:spark/caller-readonly-stacktrace

Conversation

@raashish1601
Copy link
Copy Markdown

Summary\n\n- Guard Error.prepareStackTrace assignment in lib/caller.js so environments with read-only accessors do not throw.\n- Restore Error.prepareStackTrace in a inally block and keep undefined fallback behavior when the legacy stack path cannot be used.\n- Add regression coverage in est/caller.test.js for the read-only prepareStackTrace case using proxyquire.\n\n## Validation\n\n-

px eslint lib/caller.js test/caller.test.js\n-
ode --test test/caller.test.js\n-
pm run test (note: fails on Windows locally because est/fixtures/ts/transpile.cjs invokes mv, unavailable on this environment)

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.

1 participant