-
Notifications
You must be signed in to change notification settings - Fork 30.3k
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
lib: simplify primordial safe generation #52479
Conversation
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
The following lint errors were triggered:
I can resolve this at a later point in time, as more edits to the file will probably be made
This array destructure occurs before the user is able to override it, but I can change it if needed
Defined here
Defined here
Defined here
Defined here
Defined here
Defined here
Defined here |
@aduh95, do you know the eslint comments to avoid some of these errors? |
You don't need ESLint commands, you need to refactor the code so it's valid JavaScript (when it comes to You can use |
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.
I'm not blocking, but I don't find this code more readable nor does the duplication bother me that much.
In my latest change, the code now matches the format for several other generations within the file |
const { | ||
SafePromise, | ||
} = primordials; |
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.
Note that SafePromise
used to not be on the primordials
object, it was only used locally on that file; it probably makes sense to keep it that way.
If it ain't broke... |
Simplify primordial generation using
of
ObjectEntriesCaution
For security reasons regarding prototype pollution, using
of
is generally considered bad practice, but at this point in time, the user does not have access to the prototype of ObjectEntries (object
).