Convert FindEnumStringIndex to JSAPI signature convention.

RESOLVED FIXED in Firefox 52

Status

()

RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: arai, Assigned: Waldo)

Tracking

Trunk
mozilla52
Points:
---

Firefox Tracking Flags

(firefox52 fixed)

Details

Attachments

(1 attachment)

(Reporter)

Description

2 years ago
(In reply to Jeff Walden [:Waldo] (remove +bmo to email) from bug 1289050 comment #43)
> >  template<bool InvalidValueFatal>
> >  inline int
> >  FindEnumStringIndex(JSContext* cx, JS::Handle<JS::Value> v, const EnumEntry* values,
> >                      const char* type, const char* sourceDescription, bool* ok)
> 
> It would be good to file a followup bug to convert this to the JSAPI
> signature convention of returning false on failure, filling the index in an
> outparam.  This is in a bunch of JSAPI-using code, and the oddball
> convention makes the code harder to read -- plus you have oddities like
> being forced to set an outparam *and* return a value that should never be
> examined (like |return 0| when ToString fails is a perfectly reasonable
> return value, but you have to know the caller will never look at it because
> of the |*ok = false;| to know it's fine).
(Assignee)

Comment 1

2 years ago
Created attachment 8796427 [details] [diff] [review]
Patch
(Assignee)

Updated

2 years ago
Assignee: nobody → jwalden+bmo
Status: NEW → ASSIGNED
(Assignee)

Updated

2 years ago
Component: JavaScript Engine → DOM
(Assignee)

Updated

2 years ago
Attachment #8796427 - Attachment description: Unbuilt patch → Patch
Attachment #8796427 - Flags: review?(peterv)

Comment 3

2 years ago
Pushed by jwalden@mit.edu:
https://hg.mozilla.org/integration/mozilla-inbound/rev/83fd09630531
FindEnumStringIndex should follow JSAPI interface conventions.  r=bz

Comment 4

2 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/83fd09630531
Status: ASSIGNED → RESOLVED
Last Resolved: 2 years ago
status-firefox52: affected → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla52
You need to log in before you can comment on or make changes to this bug.