joshtynjala commented on issue #649: Externs warning
URL: https://github.com/apache/royale-asjs/issues/649#issuecomment-571175819
 
 
   > When compiling HelloWorld, we get the following warning:
   > WARNING: externs/dialogPolyfill.js:19: WARNING - accessing name 
dialogPolyfill in externs has no effect. Perhaps you forgot to add a var 
keyword?
   
   As best I can tell, there are no issues from the way that we generated 
JavaScript code. However, I agree that this warning is annoying.
   
   I think that the fix is to do exactly as it suggests and add a `var` keyword 
before the name of the variable, like this:
   
   ```
   var dialogPolyfill = function() {
   };
   ```
   
   Technically, it's not required for valid JavaScript, since it creates a 
global variable either way, but it seems that Closure compiler prefers being 
explicit with the `var` keyword. Presumably, Closure compiler would not change 
its minifying behavior if we added `var`, but I'll check before I make the 
change.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to