Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
0.6.1
-
None
-
all
-
Patch Available
Description
The JavaScript compiler currently generates code that will clobber an already-existing namespace. It should check if the namespace exists before initializing it to {}. Example code pre-patch, assuming the .thrift file has the declaration namespace js CompanyName.ModuleName:
var CompanyName = {};
CompanyName.ModuleName = {}
Becomes this after patch:
if (typeof CompanyName === 'undefined') CompanyName = {}; if (typeof CompanyName.ModuleName === 'undefined') CompanyName.ModuleName = {};