ClojureScript and closure: how to protect attributes from being renamed by closure

こ雲淡風輕ζ 提交于 2019-12-05 13:40:22

The closure compiler is allowed to rename directly accessed attributes that aren't specified in externs or exports.

See https://developers.google.com/closure/compiler/docs/api-tutorial3#propnames

Specifically, (aset x "y" z) translates to x["y"] = z, which is exempt from minimizing, while (set! (.-y x) z) translates to x.y = z and can be minimized unless x.y is specified as extern or exported.

I would assume that the mozDash property isn't specified in the externs file(s) you're using for Canvas.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!