@zundel: if we did want flyweight literals, we could always manage them at class level for the whole process rather than at the JsProgram level, like Integer.valueOf() works.
@cromwellian: I'm not sure to what degree the source info correlations are useful and important. I guess my plan was to chip away at this and see if anyone pushes back. It's easy enough to re-add if people scream. http://gwt-code-reviews.appspot.com/1342801/diff/1/6 File dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaScriptAST.java (left): http://gwt-code-reviews.appspot.com/1342801/diff/1/6#oldcode1596 dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaScriptAST.java:1596: JsName entryName = topScope.findExistingName("$entry"); Good point... ok, I think what I need to do here then is explicitly declare "$entry" to be in the topScope, and remove it from the root scope entirely. Done. http://gwt-code-reviews.appspot.com/1342801/diff/1/8 File dev/core/src/com/google/gwt/dev/js/JsInliner.java (right): http://gwt-code-reviews.appspot.com/1342801/diff/1/8#newcode610 dev/core/src/com/google/gwt/dev/js/JsInliner.java:610: */ I'm just abusing JsCatchScope as a convenient, lightweight way to get a dummy name I can use... the only other options were to create a new scope type, or else make the JsName constructor public. How offensive is this? http://gwt-code-reviews.appspot.com/1342801/diff/1/14 File dev/core/src/com/google/gwt/dev/js/JsSymbolResolver.java (right): http://gwt-code-reviews.appspot.com/1342801/diff/1/14#newcode40 dev/core/src/com/google/gwt/dev/js/JsSymbolResolver.java:40: name = program.getScope().declareName(ident); Because the root scope is now immutable, and you're not allowed to write into it. It represents, essentially, browser built-ins. The top program scope represents your program. It doesn't make a functional difference where these unresolved names live, because they're... well.. unresolved and assumed to be external references. http://gwt-code-reviews.appspot.com/1342801/diff/1/21 File dev/core/src/com/google/gwt/dev/js/ast/JsNestingScope.java (right): http://gwt-code-reviews.appspot.com/1342801/diff/1/21#newcode2 dev/core/src/com/google/gwt/dev/js/ast/JsNestingScope.java:2: * Copyright 2008 Google Inc. On 2011/02/03 14:40:57, zundel wrote:
2011
Done. http://gwt-code-reviews.appspot.com/1342801/diff/1/22 File dev/core/src/com/google/gwt/dev/js/ast/JsNormalScope.java (right): http://gwt-code-reviews.appspot.com/1342801/diff/1/22#newcode2 dev/core/src/com/google/gwt/dev/js/ast/JsNormalScope.java:2: * Copyright 2008 Google Inc. On 2011/02/03 14:40:57, zundel wrote:
2011
Done. http://gwt-code-reviews.appspot.com/1342801/diff/1/26 File dev/core/src/com/google/gwt/dev/js/ast/JsRootName.java (right): http://gwt-code-reviews.appspot.com/1342801/diff/1/26#newcode43 dev/core/src/com/google/gwt/dev/js/ast/JsRootName.java:43: public void setObfuscatable(boolean isObfuscatable) { I'm removing $entry from the root scope, so that all root names are immutable and non-obfuscatable. http://gwt-code-reviews.appspot.com/1342801/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
