bestiejs / json3

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

Less aggressive feature tests #73

Open ghost opened 9 years ago

ghost commented 9 years ago

The parse feature tests currently detect and ban extensions to the JSON grammar:

// Safari <= 5.1.2 and FF 3.1b1 allow unescaped tabs in strings.

// FF 4.0 and 4.0.1 allow leading `+` signs and leading
// decimal points. FF 4.0, 4.0.1, and IE 9-10 also allow
// certain octal literals.

// FF 4.0, 4.0.1, and Rhino 1.7R3-R4 allow trailing decimal
// points. These environments, along with FF 3.1b1 and 2,
// also allow trailing commas in JSON objects and arrays.

Let's consider removing these. They add weight, test for edge cases, and penalize modern environments. JSON that includes trailing decimals, commas, or octal literals is already non-portable.

bnjmnt4n commented 9 years ago

Sure.