silkapp / rest

Packages for defining APIs, running them, generating client code and documentation.
http://silkapp.github.io/rest
390 stars 52 forks source link

rest-gen: Put generated js api in a closure #139

Closed jumi99 closed 8 years ago

jumi99 commented 8 years ago

Some data (like urls & cookies) are stored in the prototype & properties of the generated api. This can cause a problem when you instantiate 2 api objects with different data, since cookies can get mixed up. This fixes it by putting the whole constructor in a closure so that a new function is used for each instantiation of the API.

hesselink commented 8 years ago

Cherry-picked as 67ca651698f70b8e194a715c7bc110c2cb2db22e.