Loading ...
Sorry, an error occurred while loading the content.

Re: json.js

Expand Messages
  • Julian Tonti-Filippini
    I wanted to modify json.js to add RegExp support so I added the following: RegExp.prototype.toJSONString = function () { return this.toString().toJSONString();
    Message 1 of 13 , Oct 3, 2007
    View Source
    • 0 Attachment
      I wanted to modify json.js to add RegExp support so I added the following:

      RegExp.prototype.toJSONString = function () {
      return this.toString().toJSONString();
      };

      ...and found that it didn't work under Firefox because the typeof
      RegExp is 'function' rather than 'object'. This required modification
      of the switch in Object.prototype.toJSONString to add a fall-through
      case for 'function'.

      My gut tells me that there's something criminally wrong about does
      this. Can someone tell me why?

      - Julian
    • Douglas Crockford
      A new version of json.js is available. It corrects a problem in parseJSON where it was possible to have the contents of one of the caller s variables included
      Message 2 of 13 , Oct 5, 2007
      View Source
      • 0 Attachment
        A new version of json.js is available. It corrects a problem in
        parseJSON where it was possible to have the contents of one of the
        caller's variables included in the decoded value.

        http://www.JSON.org/json.js
      • Douglas Crockford
        A design error in Firefox could allow parseJSON to include an eval function object in the resulting JSON object. This situation will now raise an exception.
        Message 3 of 13 , Oct 10, 2007
        View Source
        • 0 Attachment
          A design error in Firefox could allow parseJSON to include an eval
          function object in the resulting JSON object. This situation will now
          raise an exception.

          http://www.JSON.org/json.js
        Your message has been successfully submitted and would be delivered to recipients shortly.