-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Error on a constant declaration for HTMLAudioElement #3488
Comments
Created Google internal issue http://b/143219987 |
Is there any particular reason you can't write it as |
Hi @kjin. a.readyState<HTMLMediaElement.HAVE_CURRENT_DATA instead of a.readyState<a.HAVE_CURRENT_DATA It may count when I have lots of references to this kind of constants. I know, this is really ugly and over-engineering |
Funnily... The warning doesn't trigger in some cases : As today, I have to write it there But the warning won't trigger there |
Ah, got it. I do see that the HTML5 externs file does contain existing examples where constants exist on both a class and its prototype (like |
I've landed a change to add all of the constants on |
This addresses #3488. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=276597408
When I have an
audiotag
typed as anHTMLAudioElement
, and i'm checkingaudiotag.readyState < audiotag.HAVE_CURRENT_DATA
, closure in ADVANCED_OPTIMIZATIONS mode doesn't like it :As I'm reading,
HAVE_CURRENT_DATA
is defined here : https://github.com/google/closure-compiler/blob/master/externs/browser/html5.js#L1944But not on
HTMLMediaElement.prototype
. So we cannot even useHTMLAudioElement.HAVE_CURRENT_DATA
.As I can read in https://developer.mozilla.org/en-US/docs/Web/API/HTMLAudioElement :
Perhaps I'm wrong, but as any browsers is accepting my
audiotag.HAVE_CURRENT_DATA
, may be those declarations must be changed into :The text was updated successfully, but these errors were encountered: