jsonary-js / jsonary

Quickly assemble clients for JSON-based APIs (powered by JSON Schema)
http://jsonary.com/
MIT License
122 stars 14 forks source link

clousure compiler warnings #145

Open Ognian opened 10 years ago

Ognian commented 10 years ago

I'm using my new grunt knowledge to squeeze jsonary thru googles closure compiler. Although everything looks good and the resulting jsonary works good, I'm getting 4 warnings which I think are worth to look into:

Compiling public/src/jsonary/node-package/core/jsonary-core.js,public/src/jsonary/renderers/plain.jsonary.js,public/src/jsonary/renderers/string-formats.js,public/src/lims/lims_jsonary/markdown.js,public/src/lims/lims_jsonary/defaultJSFunction.js,public/src/lims/lims_jsonary/csv-file-picker.js,public/src/jsonary/renderers/contributed/x-display-order.js,public/src/jsonary/plugins/jsonary.render.generate.js,public/src/jsonary/plugins/jsonary.render.table.js,public/src/jsonary/renderers/contributed/adaptive-table.js,public/src/jsonary/renderers/contributed/validation.js,public/src/jsonary4lims/jsonary4lims.js -> public/shared/jsonary4lims/compiled.js
>> public/src/jsonary/node-package/core/jsonary-core.js:1987: WARNING - unreachable code
>>          if (timeLimit == undefined) {
>>          ^
>> 
>> public/src/jsonary/node-package/core/jsonary-core.js:3065: WARNING - Suspicious code. This code lacks side-effects. Is there a bug?
>>                      if (basicType == "object") {
>>                      ^
>> 
>> public/src/jsonary/node-package/core/jsonary-core.js:6143: WARNING - unreachable code
>>          for (var i = 0; i < candidates.length; i++) {
>>                                                 ^
>> 
>> public/src/jsonary/node-package/core/jsonary-core.js:6365: WARNING - Suspicious code. The result of the 'eq' operator is not being used.
>>              origValue == origValue.value();
>>              ^
>> 
>> 0 error(s), 4 warning(s)
>> Complete: 188617
geraintluff commented 10 years ago

Thanks, I'll have a look at these - some of them do indeed look suspicious.