0

I am using google closure compiler to minify the following code using the "ADVANCED_OPTIMIZATIONS" compilation level:

function(response){
    console.log(response.data.data.message)
}

In this case I would expect the code to compile to:

function(a){
    console.log(a.a.a.a)
}

but instead it looks like this after compiling:

function(a){
    console.log(a.data.data.a)
}

can someone explain why this is?

one thing that stands out to me here is that the variables that were not renamed are both called "data". this stood out to me because my IDE detects "data" as a predefined js var, but I can't think of a good reason why google closure compiler would not rename an object property called "data".

trickpatty
  • 433
  • 7
  • 18
  • 1
    Possible duplicate of [Why does Closure Compiler not rename objects with certain names?](http://stackoverflow.com/questions/12671041/why-does-closure-compiler-not-rename-objects-with-certain-names) – JJJ Feb 04 '16 at 17:20
  • I believe you are correct... what do I do now....? should I delete my question? :/ @Juhana – trickpatty Feb 04 '16 at 17:22
  • Click on "yes" where it asks if the duplicate helped you. – JJJ Feb 04 '16 at 17:25
  • I don't see that option... just going to delete the question as it seems like the answer was very easy to find. thanks @Juhana – trickpatty Feb 04 '16 at 17:26
  • It's the big yellow box below your question. – JJJ Feb 04 '16 at 17:27
  • very odd... refreshed many times and still no option to mark that question as having the answer. I don't see any yellow box... – trickpatty Feb 04 '16 at 17:53

0 Answers0