-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Slowly migrate AMP to a state where we can obfuscate all properties. #9875
Conversation
src/utils/object.js
Outdated
if (opt_initial) { | ||
return /** @type {!JsonObject} */ (opt_initial); | ||
} | ||
return /** @type {!JsonObject} */ ({}); |
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.
should we do Object.create(null) here
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.
Good call. Just made the function pass through to map
Uses the type system to ensure that objects that must be treated as non-obfuscateable are using bracket notation for property access. This is a first PR of many.
*/ | ||
this.config_ = /** @type {JSONType} */ ({}); | ||
this.config_ = /** @type {JsonObject} */ ({}); |
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.
would it be better to call dict()
here? (besides the implication of adding additional code to the binary)
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.
yes
LGTM |
Uses the type system to ensure that objects that must be treated as non-obfuscateable are using bracket notation for property access.
This is a first PR of many. Part of #9876