Skip to content
Browse files

Ensure that the `JSON.parse` feature test correctly detects native im…

…plementations. Closes #9.
1 parent d80409c commit 7e083f2cbfb773a04958c9819ca81bbb93c8aebf @kitcambridge kitcambridge committed Apr 28, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/json3.js
View
4 lib/json3.js
@@ -16,7 +16,7 @@
// implementations are spec-compliant. `stringifySupported` is defined after
// the date test, as it depends upon it. Based on work by Ken Snyder.
stringifySupported, Escapes, toPaddedString, quote, serialize,
- parseSupported = typeof JSON3.parse == "function", fromCharCode, Unescapes, Parser, walk, lex, get,
+ parseSupported, fromCharCode, Unescapes, Parser, walk, lex, get,
// Test the `Date#getUTC*` methods. Based on work by @Yaffle.
value = new Date(-3509827334573292), floor, Months, getDay;
@@ -130,7 +130,7 @@
}
// Test `JSON.parse`.
- if (parseSupported) {
+ if ((parseSupported = typeof JSON3.parse == "function")) {
try {
// FF 3.1b1, b2 will throw an exception if a bare literal is provided.
// Conforming implementations should also coerce the initial argument to

0 comments on commit 7e083f2

Please sign in to comment.
Something went wrong with that request. Please try again.