-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Add type information to goog.global referenced objects #503
Add type information to goog.global referenced objects #503
Conversation
…unknown and blocking disambiguation on properties named "open" or "send".
@@ -1396,6 +1396,7 @@ goog.loadFileSync_ = function(src) { | |||
if (goog.global.CLOSURE_LOAD_FILE_SYNC) { | |||
return goog.global.CLOSURE_LOAD_FILE_SYNC(src); | |||
} else { | |||
/** @type {XMLHttpRequest} */ | |||
var xhr = new goog.global['XMLHttpRequest'](); |
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 wondering if we can just kill the bracket notation here instead.
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.
The other option would be to increase the bracket usage:
xhr['open']('get', src, false);
This is also occurring on Line 850 which doesn't use brackets.
You would also need to add a "goog.forwardDeclare" for this type, this is there to support projects using minimal externs. |
goog.loadFileSync_
.
Added the needed |
Add type information to goog.global referenced objects.
Add type information to goog.global referenced objects. ------------- Created by MOE: http://code.google.com/p/moe-java ------------- Created by MOE: http://code.google.com/p/moe-java MOE_MIGRATED_REVID=100492682
*** Reason for rollback *** Breaks test With this rollback, all tests pass. *** Original change description *** Merge pull request #503 from ChadKillingsworth/fix-unknown-type-in-base Add type information to goog.global referenced objects. ------------- Created by MOE: http://code.google.com/p/moe-java *** ------------- Created by MOE: http://code.google.com/p/moe-java MOE_MIGRATED_REVID=100526080
*** Reason for rollback *** Roll forward once is in to unbreak tests after this change. (I'm queuing these up since the presubmits are long.) *** Original change description *** Automated g4 rollback of changelist 100492682. *** Reason for rollback *** Breaks tests *** Original change description *** Merge pull request #503 from ChadKillingsworth/fix-unknown-type-in-base Add type information to goog.global referenced obj... *** ------------- Created by MOE: http://code.google.com/p/moe-java MOE_MIGRATED_REVID=100537995
The
xhr
object created via goog.global was an unknown type and thus blocked disambiguation on properties named "open" or "send".Fixes google/closure-compiler#1054