[Webkit-unassigned] [Bug 28752] New: this in JSON.parse reviver is the global object

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Aug 26 15:40:38 PDT 2009


https://bugs.webkit.org/show_bug.cgi?id=28752

           Summary: this in JSON.parse reviver is the global object
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: PC
               URL: http://lucassmith.name/pub/browser_bugs/wk/reviver_thi
                    s.html
        OS/Version: Mac OS X 10.5
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: JavaScriptCore
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: lsmith at lucassmith.name


ES 5 spec states that the Walk abstract function calls the reviver function's
[[Call]] "passing holder as the this value"

Currently WebKit's JSON.parse implementation passes the global object as this.

Aside from the spec violation, this also prevents the reviver from creating
additional properties on the object or referencing other properties of the
current object for value determination during parse.  Any new properties
created are added to the global object.

I noted this while reviewing my YUI examples for the JSON Utility (which defers
to native implementations if present).
http://developer.yahoo.com/yui/examples/json/json_convert_values.html

Note: The page behaves correctly because it is either (if viewed before 9/2/09)
using version 2.7.0 which is not leveraging native behavior , or it is (if
viewed after 9/2/09) using version 2.8.0 and is configured NOT to use native
behavior specifically because of this bug.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list