Losing type information - "Property get never defined on formData of type FormData"
See original GitHub issueHi all,
I’m getting some strange compiler warnings. It’s like the compiler forgets the externs for FormData - see here:
[npm 04/13/17 2:30:27] nps-plugin/index.js:150: WARNING - Property get never defined on formData of type FormData
[npm 04/13/17 2:30:27] this.userName || formData.get('user_name'),
[npm 04/13/17 2:30:27] ^^^^^^^^^^^^
[npm 04/13/17 2:30:27]
[npm 04/13/17 2:30:27] nps-plugin/index.js:152: WARNING - Property get never defined on formData of type FormData
[npm 04/13/17 2:30:27] formData.get('score'),
[npm 04/13/17 2:30:27] ^^^^^^^^^^^^
[npm 04/13/17 2:30:27]
[npm 04/13/17 2:30:27] nps-plugin/index.js:153: WARNING - Property get never defined on formData of type FormData
[npm 04/13/17 2:30:27] this.productId || formData.get('product_id'),
[npm 04/13/17 2:30:27] ^^^^^^^^^^^^
[npm 04/13/17 2:30:27]
[npm 04/13/17 2:30:27] nps-plugin/index.js:154: WARNING - Property get never defined on formData of type FormData
[npm 04/13/17 2:30:27] formData.get('comments')));
I’m not sure if it’s related, but the properties on the Form elements elements
property seem to be obfuscated as well:
I have to use form.elements['score'].value
rather than what I had before, which was form.elements.score.value
. Come to think of it, since the “score” element is dynamically defined (and thusly the compiler’d have no way of preserving the token), I have no idea why that was working before…
Here’s my compiler info:
VERSION: 20161201.0.0
FLAGS: java -jar node_modules/google-closure-compiler/compiler.jar –js=“nps-plugin/index.js” –js=“node_modules/google-closure-library/closure/goog/.js” –js=“!node_modules/google-closure-library/closure/goog/_test.js” –dependency_mode=STRICT –compilation_level=ADVANCED_OPTIMIZATIONS –entry_point=lnkd.NpsPlugin –output_wrapper=“(function(){%output%})();” –new_type_inf –jscomp_warning=newCheckTypes –jscomp_off=newCheckTypesExtraChecks –hide_warnings_for=node_modules/google-closure-library/ –output_manifest=“build/report/manifest.MF” –js_output_file=nps-plugin.js
Let me know if you can help… thanks so much!
Issue Analytics
- State:
- Created 6 years ago
- Comments:10 (4 by maintainers)
Top GitHub Comments
It looks like our externs may be missing definitions: https://github.com/google/closure-compiler/blob/8ac08c03cd695b84f8a79ac3a1338172df00003f/externs/browser/w3c_xml.js#L444
Can you file an issue internally, with steps for me how to build your project and reproduce the error?