Skip to content

fix(source-map-consumer): validate line and column arguments - #558

Open
user-Param wants to merge 7 commits into
mozilla:masterfrom
user-Param:fix/450-originalpositionfor-null-args
Open

user-Param wants to merge 7 commits into
mozilla:masterfrom
user-Param:fix/450-originalpositionfor-null-args

Conversation

@user-Param

Copy link
Copy Markdown

Fixes #450 - originalPositionFor was not validating that line and column arguments are provided. When called with null/undefined or missing line/column, needle.generatedLine would be undefined, and undefined < 1 evaluates to false, allowing NaN to propagate into native code. Now throws a clear error when line or column is missing.

@user-Param

Copy link
Copy Markdown
Author

All 190 tests pass. The fix is minimal and focused. Would appreciate a review!

@user-Param

Copy link
Copy Markdown
Author

@hbenl Could you please review this PR? All 190 tests pass and the fix addresses a real issue. Thank you!

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.

TypeError: Cannot read property 'indexOf' of null

2 participants