[Webkit-unassigned] [Bug 198574] New: JSON.parse throws incorrect exception when called w/o arguments

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jun 5 11:19:48 PDT 2019


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

            Bug ID: 198574
           Summary: JSON.parse throws incorrect exception when called w/o
                    arguments
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: All
                OS: All
            Status: NEW
          Severity: Minor
          Priority: P2
         Component: JavaScriptCore
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: shvaikalesh at gmail.com

Test case:
  JSON.parse()

Expected:
  SyntaxError: JSON Parse error: Unexpected identifier "undefined"

Actual:
  Error: JSON.parse requires at least one parameter

ECMA-262: https://tc39.github.io/ecma262/#sec-json.parse
No matter how many arguments are passed, `JSON.parse` always coerces first arg to string (step 1) and attempts to parse it (step 2).
Other browsers throw SyntaxError.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20190605/89149760/attachment-0001.html>


More information about the webkit-unassigned mailing list