bestiejs / json3

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

fix loading when both `define` and `exports` exist #33

Closed ansis closed 11 years ago

ansis commented 11 years ago

We ran into problems when users tried to use mapbox.js, which uses browserify, on a site with requirejs. Since define was defined, nothing was added to exports.

With this change, if both define and exports are present it will load it with both systems.

ghost commented 11 years ago

I think that's a reasonable change—JSON 3 has had an interesting history with module exports (see #26 and #14), but this looks solid. Thank you!

calhoun137 commented 9 years ago

Thank you so much for this PR!!!!!! It solved a 3 day nightmare <3