Last Comment Bug 641479 - "Assertion failure: !cx->isExceptionPending()" with JSON.parse
: "Assertion failure: !cx->isExceptionPending()" with JSON.parse
: assertion, testcase
Product: Core
Classification: Components
Component: JavaScript Engine (show other bugs)
: unspecified
: All All
-- critical (vote)
: ---
Assigned To: general
: Jason Orendorff [:jorendorff]
Depends on: 589664
Blocks: 630996
  Show dependency treegraph
Reported: 2011-03-14 06:25 PDT by Jan de Mooij [:jandem]
Modified: 2011-06-30 17:38 PDT (History)
5 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Description User image Jan de Mooij [:jandem] 2011-03-14 06:25:01 PDT
function f() {
    throw 2;
JSON.parse(f, f);
$ ./js test.js
Assertion failure: !cx->isExceptionPending(), at ../jsinterp.cpp:6178

In a release build this prints
uncaught exception: 2
Comment 1 User image Jeff Walden [:Waldo] (remove +bmo to email) 2011-04-08 12:48:07 PDT
The new parser fixes this.  I'm not 100% sure why the old parser was broken here, might also possibly be the scaffolding around the parsing code that was at fault (and got reorganized slightly in the rewrite).

We need to add this test before closing this out as WFM:

  var r = JSON.parse("function f() {\n throw 2;\n}", function() { throw 2; });
  throw new Error("didn't throw, returned " + r);
catch (e)
  assertEq(e instanceof SyntaxError, true);
Comment 2 User image Jeff Walden [:Waldo] (remove +bmo to email) 2011-06-30 17:38:46 PDT
Fixed by the new parser.

Note You need to log in before you can comment on or make changes to this bug.