Closure Compiler issues warning with namespaced enum

穿精又带淫゛_ 提交于 2019-12-06 02:56:27

The compiler expects to collapse the enum value into single variables:

NS.type.FOO becomes NS$type$FOO. The "NS" that you exported would not contain what you expect.

I suspect you want something like this:

window['NS'] = {}; // an external namespace object.
window['NS']['foobar'] = NS.foobar; // add 'foobar' to the external namespace.
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!