Replace eval-based environment detection with direct global checks#641
Merged
danmarshall merged 6 commits intomasterfrom Jan 19, 2026
Merged
Replace eval-based environment detection with direct global checks#641danmarshall merged 6 commits intomasterfrom
danmarshall merged 6 commits intomasterfrom
Conversation
Co-authored-by: danmarshall <11507384+danmarshall@users.noreply.github.com>
Co-authored-by: danmarshall <11507384+danmarshall@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Remove tryEval for environment detection
Replace eval-based environment detection with direct global checks
Jan 19, 2026
Contributor
|
@copilot please un-commit docs/target/js/browser.maker.js - this should have been in the copilot instructions, or you should add it. |
…tifact changes Co-authored-by: danmarshall <11507384+danmarshall@users.noreply.github.com>
Contributor
Author
Contributor
|
@copilot please undo your .gitignore - I asked copilot to not edit a "binary" - that isnt the smae as "not having the file in the repo". Also please undo all the .js files you changed. This is supposed to be a single-file PR. |
Co-authored-by: danmarshall <11507384+danmarshall@users.noreply.github.com>
Contributor
Author
Done. Reverted .gitignore and all .js files to make this a single-file PR. Only packages/maker.js/src/core/maker.ts is now changed. Commit: 3ab1f6a |
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.
Plan to Eliminate tryEval for Environment Detection
Summary
Successfully eliminated the use of
tryEvalandeval()for environment detection in a single TypeScript source file change.Changed file:
packages/maker.js/src/core/maker.tsThe new implementation:
eval()calls that could be exploitedThe solution uses a
getGlobal()helper that safely accesses the global object, then checks for environment-specific properties using bracket notation to avoid TypeScript compile-time checks.Build artifacts will be regenerated during the build process and are not included in this PR.
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.