I love what Google Closure does, and after discovering what Javascript Objects can do (Speed! as fast or faster than local vars), I love them too. But when Google Closure (Advanced option) renames the variables, objects change from the normal expected Object syntax into simple global var syntax:
Example: var Obj = {a: 0, b: 0, c: 0) format that instead instead comes out like this real case:
var u = 0, v = 0, w = 0, x = 4769.83, y = 0, p = document.getElementById("new"), q = document.getElementById("old"), z = document.getElementById("res"), m = document.getElementById("res2"), A = document.getElementById("tb0"), n = document.getElementById("yrs"), B = 0, C = 0, D = 0, E = 0, F = 0, G = 0, H = 1, I = 0, J = 0, K = 0, L = /^20\d\d/, M = 0, N = 0, O = document.getElementById("tab").rows, r = "object" !== typeof f || -1 == P(f[0], 18) && -1 == P(f[1], 0) ? 0 : 1;
This changed syntax is no different than it were just ordinary global varibles (no semicolon object key definition references, and no periods of u.b key object access syntax). How can this be? What do I not understand? It is still Javascrip code, but nothing suggests Objects. I don't understand how they can still be Objects (without the semicolons and periods of keys). It seems the opposite of the Closure goals.
But when the Google Closure Simple option choice (no renaming) runs, it leaves the object syntax in place, exactly recognizable. So why discard that in Advanced?
Is there any explanation, or better, any work around, about this issue?
--
---
You received this message because you are subscribed to the Google Groups "Closure Compiler Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to closure-compiler-d...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/closure-compiler-discuss/cf83ab3d-3b16-4696-967a-76d7575d5b36n%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/closure-compiler-discuss/f060cc61-69d1-4958-8f18-f9be564c8da9n%40googlegroups.com.