Closed Bug 328037 Opened 19 years ago Closed 19 years ago

JS_CallFunctionName should return the same as JS_CallFunctionValue

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
minor

Tracking

()

RESOLVED FIXED

People

(Reporter: mbd, Assigned: brendan)

References

Details

(Keywords: fixed1.8.0.2, fixed1.8.1, Whiteboard: [tcn-dl])

Attachments

(1 file)

User-Agent: Mozilla/5.0 (compatible; Konqueror/3.2; Linux) KHTML/3.2.3 (like Gecko) Build Identifier: cvs If you look at the source to current CVS js, here is the last lines for JS_CallFunctionName: ok = js_InternalCall(cx, obj, fval, argc, argv, rval); LAST_FRAME_CHECKS(cx, ok); return JS_TRUE; and, for JS_CallFunctionValue ok = js_InternalCall(cx, obj, fval, argc, argv, rval); LAST_FRAME_CHECKS(cx, ok); return ok; I think JS_CallFunctionName should return ok, not JS_TRUE. This is based on reading the docs. The difference is most clear, if your code throws an unhandled exception. A work around is to call JS_GetProperty for the name, then call JS_CallFunctionValue. This will allow calls to function that throws, to return JS_FALSE. Reproducible: Always
Whoops -- easily fixed. Thanks for pointing this typo out. /be
Assignee: general → brendan
Status: UNCONFIRMED → NEW
Ever confirmed: true
Attached patch fix Splinter Review
Trivial, I'm checking in. /be
Attachment #212684 - Flags: review?(mrbkap)
Attachment #212684 - Flags: review?(mrbkap) → review+
Attachment #212684 - Flags: approval1.8.0.2?
Attachment #212684 - Flags: approval-branch-1.8.1+
Fixed on trunk. /be
Blocks: js1.6rc1
Status: NEW → RESOLVED
Closed: 19 years ago
Flags: blocking1.8.0.2?
Resolution: --- → FIXED
Comment on attachment 212684 [details] [diff] [review] fix approved for 1.8.0 branch, a=dveditz
Attachment #212684 - Flags: approval1.8.0.2? → approval1.8.0.2+
Flags: blocking1.8.0.2? → blocking1.8.0.2+
Fixed on 1.8* branches. /be
Flags: testcase-
Please provide guidance for testing this fix.
Whiteboard: [tcn-dl]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: