Closed Bug 504474 Opened 15 years ago Closed 15 years ago

JS_ValueToBoolean is void

Categories

(Core :: JavaScript Engine, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: timeless, Assigned: timeless)

References

(Blocks 1 open bug)

Details

(Keywords: coverity)

Attachments

(1 file)

according to brendan JS_ValueToBoolean will never return JS_FALSE, so we can stop pretending it will. This will make Coverity happy since we're slightly inconsistent at this point.
Attachment #388844 - Flags: review?(brendan)
The API could be changed too, but at some cost to embedders. Probably better to focus on new C++ API.

/be
In any new API that was infallible, the cx param would go, since its presence implies fallibility -- it is used only to CHECK_REQUEST(cx) in the current API wrapper impl.

Could have new API in jsapi.h, but opt-in by name or ifdef. Worth it? Comments welcome.

/be
Attachment #388844 - Flags: review?(jorendorff)
Attachment #388844 - Flags: review?(brendan)
Attachment #388844 - Flags: review+
Comment on attachment 388844 [details] [diff] [review]
stop checking the return value

Just noticed the quickstub generation code uses PRBool to declare the out param, which works because JSBool is PRBool is int, but JSBool is better.

Looking mainly for jorendorff's blessing since I am weak reviewer for the quickstubs code, at best.

/be
Attachment #388844 - Flags: review?(jorendorff) → review+
http://hg.mozilla.org/mozilla-central/rev/2956e5255fc9
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: