Closed Bug 240500 Opened 21 years ago Closed 21 years ago

JS_DefineFunctions APIDoc for return is wrong

Categories

(Core :: JavaScript Engine, defect)

x86
Windows 2000
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: timeless, Assigned: timeless)

References

()

Details

Attachments

(1 file)

Description JS_DefineFunctions creates one or more functions and makes them properties (methods) of a specified object, obj. fs is a pointer to the first element of an array of JSFunctionSpec. Each array element defines a single function: its name, the native C call wrapped by the function, the number of arguments passed to the function, and its attribute flags. The last element of the array must contain zero values. JS_DefineFunctions creates one function for each non-zero element in the array. JS_DefineFunctions always returns JS_TRUE, indicating it has created all functions specified in the array. That's a nice description, but it doesn't seem to correspond to the code: http://lxr.mozilla.org/seamonkey/source/js/src/jsapi.c#2978 2969 JS_DefineFunctions(JSContext *cx, JSObject *obj, JSFunctionSpec *fs) 2970 { 2971 JSFunction *fun; 2972 2973 CHECK_REQUEST(cx); 2974 for (; fs->name; fs++) { 2975 fun = JS_DefineFunction(cx, obj, fs->name, fs->call, fs->nargs, 2976 fs->flags); 2977 if (!fun) 2978 return JS_FALSE; ... which seems to return false occasionally. 2979 fun->extra = fs->extra; 2980 } 2981 return JS_TRUE; 2982 } Please don't ask me why I'm reading the api doc. Please don't ask me why I'm looking at perlconnect.
I'm not sure what's missing. Be explicit. /be
Assignee: pschwartau → timeless
Attached patch Fix docSplinter Review
Comment on attachment 146187 [details] [diff] [review] Fix doc so um, how does one update www.mozilla.org? Do i just run apidoc and commit the changed files?
Attachment #146187 - Flags: review?(brendan)
Comment on attachment 146187 [details] [diff] [review] Fix doc run make in js/docs, cp -p -r gen <cvsarea-for-website>/mozilla-org/html/js/spidermonkey/apidoc cd !$ cvs diff to verify cvs ci I'm hesitant to use bugzilla to fix jsref.xml, since it is so buggy. If you want review, mail me. File a bug if it helps, for history, to get many people reviewing together, etc. /be
Attachment #146187 - Flags: review?(brendan) → review+
mozilla/js/docs/jsref.xml 1.7 mozilla-org/html/js/spidermonkey/apidoc/gen/api-JS_DefineFunctions.html 1.7 mozilla-org/html/js/spidermonkey/apidoc/gen/complete.html 1.15
Status: UNCONFIRMED → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Summary: JS_DefineFunctions APIDoc appears to lie → JS_DefineFunctions APIDoc for return is wrong
Flags: testcase-
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: