Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove new lines in function constructor #297

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bozokopic
Copy link

@bozokopic bozokopic commented May 10, 2024

I have noticed that exceptions raised from functions created by "new Function" have "invalid" line numbers in stacktrace.

For example:
(new Function("throw new Exception('abc');"))()
reports (<input>:3)

By removing two additional new line characters, exception reports line numbers matching code provided to Function constructor.

TooTallNate pushed a commit to TooTallNate/quickjs that referenced this pull request Jul 3, 2024
* Improve error handling

- throw RangeError for invalid string length
- throw RangeError for stack overflow with updated message
- fix case for `BigInt` error messages
- refine stack check for `next_token` and `json_next_token`
- throw SyntaxError for too many variables, arguments, parameters...
- v8.js: disable v8 specific tests
- v8.js: disable Realm object tests
- v8.js: disable MODULE tests
- v8.js: disable RegExp static properties tests
- use more precise error messages
- reorder property lookup in `js_obj_to_desc()` according to ECMA
- set global object's [Symbol.toStringTag] to "global"
- fix error message for duplicate parameter name in strict mode
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