Ignore strict errors in JSON.parse with reviver

RESOLVED FIXED in Firefox 40

Status

()

Core
JavaScript Engine
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: jorendorff, Assigned: jorendorff)

Tracking

(Blocks: 1 bug)

unspecified
mozilla40
x86_64
Linux
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox40 fixed)

Details

Attachments

(1 attachment)

(Assignee)

Description

3 years ago
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.
(Assignee)

Comment 1

3 years ago
Created attachment 8584769 [details] [diff] [review]
In JSON.parse with a reviver callback, ignore failure when defining properties

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)

Updated

3 years ago
Assignee: nobody → jorendorff
Status: NEW → ASSIGNED
(Assignee)

Updated

3 years ago
Blocks: 694100
Attachment #8584769 - Flags: review?(jwalden+bmo) → review+
(Assignee)

Comment 2

3 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/a9f10724b83b
Backed out (along with every other patch from that massive push) in https://hg.mozilla.org/integration/mozilla-inbound/rev/386c8b5b73c0 for talos other timeouts:
https://treeherder.mozilla.org/#/jobs?repo=mozilla-inbound&revision=3fc49391f7fe&filter-searchStr=talos oth
Flags: needinfo?(jorendorff)
(Assignee)

Comment 4

3 years ago
https://treeherder.mozilla.org/#/jobs?repo=try&revision=fdf3d03ce361
(Assignee)

Updated

3 years ago
Flags: needinfo?(jorendorff)
(Assignee)

Comment 5

3 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/3b22618eb4b3
https://hg.mozilla.org/mozilla-central/rev/3b22618eb4b3
Status: ASSIGNED → RESOLVED
Last Resolved: 3 years ago
status-firefox40: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla40
Blocks: 1105914
You need to log in before you can comment on or make changes to this bug.