0

I am building a large app using the Google Closure Library. I am getting data from a MongoDB-PHP environment via JSONP. Request go through a load balancing test which determines the most suitable server to get the data from, then returns the corresponding JSON data.

The problem is when I build the application with the closure builder, the parameters of the JSONP.send method modify, so instead of sending what I should send, I am sending random parameters. How can I force the compiler to keep those object property names as I wrote them, without making any changes? thanks

flavian
  • 28,161
  • 11
  • 65
  • 105

1 Answers1

2

Assuming you are using ADVANCED optimizations, you are running into problems with property renaming. You can read about it here:

https://developers.google.com/closure/compiler/docs/api-tutorial3

The easiest thing to do is use SIMPLE optimizations, otherwise you need to build the parameters with quoted properties:

var params = { 'aParam': 1 };
John
  • 5,443
  • 15
  • 21