douglascrockford/JSON-js — pull request #54 by rtfeldman (2014-02-04 19:10:17+00:00)
Title: Move escapable regexps into feature detection check

Currently, including `json.js` or `json2.js` in a page being viewed in Internet Explorer 8 yields an "invalid character range" error because the escapable characters regexp is always instantiated even when it is not used because the browser already has native JSON support.

This pull request simply moves the regexp instantiation into the feature detection `if` block, so it will only be executed in situations where it will be used.

This fixes the IE8 issue and presumably slightly improves performance in browsers with native JSON support.