Closed Bug 1148568 Opened 9 years ago Closed 9 years ago

Ignore strict errors in JSON.parse with reviver

Categories

(Core :: JavaScript Engine, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla40
Tracking Status
firefox40 --- fixed

People

(Reporter: jorendorff, Assigned: jorendorff)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

ES6 draft rev 36, 24.3.1.1 InternalizeJSONProperty, specifies that certain errors are ignored.

> 3.  If newElement is undefined, then
>     a.  Let status be val.[[Delete]](ToString(I)).
> 4.  Else
>     a.  Let status be CreateDataProperty(val, ToString(I), newElement).
>     b.  NOTE This algorithm intentionally does not throw an exception
>         if status is false.
> 5.  ReturnIfAbrupt(status).

We already get it right for the deletes, but until bug 1113369 landed, we didn't have a way to do this for the CreateDataProperty call.
Switch to StandardDefineProperty while we're at it. I don't think the "CreateDataProperty" operation given in the spec is quite worth making into a function on its own, since the standard almost exclusively uses it in cases where it "can't fail", and (a) that is unpossible for us; (b) this is not one of those cases anyway.
Attachment #8584769 - Flags: review?(jwalden+bmo)
Assignee: nobody → jorendorff
Status: NEW → ASSIGNED
Blocks: es6
Attachment #8584769 - Flags: review?(jwalden+bmo) → review+
Flags: needinfo?(jorendorff)
https://hg.mozilla.org/mozilla-central/rev/3b22618eb4b3
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla40
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: