Add parserless build mode#1021
Merged
bnoordhuis merged 1 commit intoquickjs-ng:masterfrom Apr 10, 2025
Merged
Conversation
Closed
Contributor
Author
|
meson builds fail because QJS_ENABLE_PARSER is undefined, and now that I think about it, the amalgamation is affected in the same way. Maybe I should rename it to QJS_DISABLE_PARSER... |
Contributor
I was going to suggest that :-) |
Add a QJS_DISABLE_PARSER build option that disables the JS source code parser. The JSON parser is unaffected. Useful if you want to execute bytecode but not parse source code, e.g., for hardening reasons, or due to running in a constrained environment. Shrinks a release build by about 15%. Fixes: quickjs-ng#976
Contributor
Author
|
openbsd failure was infrastructural, restarted. |
saghul
approved these changes
Apr 10, 2025
graham
pushed a commit
to graham/quickjs
that referenced
this pull request
Apr 11, 2025
Add a QJS_DISABLE_PARSER build option that disables the JS source code parser. The JSON parser is unaffected. Useful if you want to execute bytecode but not parse source code, e.g., for hardening reasons, or due to running in a constrained environment. Shrinks a release build by about 15%. Fixes: quickjs-ng#976
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add a QJS_ENABLE_PARSER build option that enables/disables the parser.
Useful if you want to execute bytecode but not parse source code, e.g., for hardening reasons, or due to running in a constrained environment.
Shrinks a release build by about 15%.
Fixes: #976
I decided not to shuffle code around for now but that's maybe not a bad idea in the future, to reduce ifdef soup.