-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
refactor: re-use reserved names set #4304
Conversation
2bcd6e9
to
93b0276
Compare
Codecov Report
@@ Coverage Diff @@
## master #4304 +/- ##
==========================================
- Coverage 98.44% 98.44% -0.01%
==========================================
Files 205 205
Lines 7316 7314 -2
Branches 2084 2084
==========================================
- Hits 7202 7200 -2
Misses 55 55
Partials 59 59
Continue to review full report at Codecov.
|
e86d969
to
23dff43
Compare
src/utils/BUILTINS.ts
Outdated
'uneval' | ||
]); | ||
|
||
export default BUILTINS; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually looking at what we use this for, i.e. generating "safe" variable names, I do not think we need to keep global variables in this list. Their use is already tracked so that generated variable names are deconflicted. Looking at what is left then, I wonder if we could not just merge that into the RESERVED_WORDS
list (I actually only see NaN)
src/utils/identifierHelpers.ts
Outdated
|
||
const blacklisted = new Set(reservedWords.concat(builtins)); | ||
const blacklisted = new Set([...RESERVED_WORDS, ...BUILTINS]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you follow my suggestion of just merging the lists, then we do not need this awkwardly named variable any more. But please tell me if you think I am overlooking something.
@lukastaegert sorry, just saw this, makes sense to me. 👍 |
This PR contains:
Are tests included?
Breaking Changes?
List any relevant issue numbers:
Description