Closed oyvindkinsey closed 12 years ago
Hi Øyvind,
Thank you very much for the pull request. I ended up adopting a variant of your fix, which adds support for asynchronous module loaders and Node (this == exports
in Node, so JSON 3 will still bypass the native implementation).
The verbose typeof define === "function" && define.amd
check is actually necessary for compatibility with the RequireJS optimizer, which uses a hard-coded RegExp to check for the define
condition.
The fix will be part of v3.2.1, which I hope to release tomorrow. Sound good?
Thanks again! :star2:
Summary: This patch simplifies the process of selecting how to define the module, and also changes it so that JSON is also used as the base of the module when present.
Test Plan: Ran the unit test in /tests without failure.