Missing JSContext* parameter and wrong return mechanism in JSAPI functions

RESOLVED FIXED

Status

RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: mozillabugs, Unassigned)

Tracking

Details

(Reporter)

Description

6 years ago
The documentation for at least the following functions is missing the JSContext* parameter that the actual API in jsapi.h requires:
https://developer.mozilla.org/en-US/docs/SpiderMonkey/JSAPI_Reference/JS_ConcatStrings
https://developer.mozilla.org/en-US/docs/SpiderMonkey/JSAPI_Reference/JS_CompareStrings
The last page has additional problems: It shows the function as returning an integer with the result of the comparison, while in reality that integer is returned via a jsval* argument, and the function's return value is a JSBool.
(Reporter)

Comment 2

6 years ago
Sorry, I was wrong about the jsval* argument - it's actually a int32_t*. The source to match here is really jsapi.h.
I feel quite stupid now :) I looked at the source and realised the int32_t, then came back and read this, and I'm used to JS_* functions taking jsvals as the last argument, so I went and put that.

Fixed now.
(Reporter)

Comment 4

6 years ago
The signatures look good to me now.
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Component: Documentation → General
Product: Mozilla Developer Network → Developer Documentation
You need to log in before you can comment on or make changes to this bug.