bestiejs / json3

A JSON polyfill. No longer maintained.
https://bestiejs.github.io/json3
Other
1.02k stars 150 forks source link

define.amd is changed to define.c in compressed version #22

Closed JieC closed 11 years ago

JieC commented 11 years ago
typeof define&&define.c

In json3.min.js, define.amd is changed to define.c by the compressor. As a result, the 'define' check always return false unless there is a define.c object

ghost commented 11 years ago

Ah, yes—I forgot to use square brackets, so Closure Compiler is munging the property name. Fix forthcoming; will update the cdnjs versions the next time I cut a release. Thanks!

Edit: This would probably need to be in a post-build step, à la Lo-Dash—given that r.js specifically checks for define.amd, rather than define["amd"].

ghost commented 11 years ago

Added a post-build step to ensure that the define pragma is not munged. This will go out with the next release.