JS_CallFunctionName should return the same as JS_CallFunctionValue

RESOLVED FIXED

Status

()

Core
JavaScript Engine
--
minor
RESOLVED FIXED
11 years ago
11 years ago

People

(Reporter: Mads Bondo Dydensborg, Assigned: brendan)

Tracking

({fixed1.8.0.2, fixed1.8.1})

Trunk
fixed1.8.0.2, fixed1.8.1
Points:
---
Bug Flags:
blocking1.8.0.2 +
in-testsuite -

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [tcn-dl])

Attachments

(1 attachment)

(Reporter)

Description

11 years ago
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
(Assignee)

Comment 1

11 years ago
Whoops -- easily fixed.  Thanks for pointing this typo out.

/be
Assignee: general → brendan
Status: UNCONFIRMED → NEW
Ever confirmed: true
(Assignee)

Comment 2

11 years ago
Created attachment 212684 [details] [diff] [review]
fix 

Trivial, I'm checking in.

/be
Attachment #212684 - Flags: review?(mrbkap)
Comment on attachment 212684 [details] [diff] [review]
fix 

Yes.
Attachment #212684 - Flags: review?(mrbkap) → review+
(Assignee)

Updated

11 years ago
Attachment #212684 - Flags: approval1.8.0.2?
Attachment #212684 - Flags: approval-branch-1.8.1+
(Assignee)

Comment 4

11 years ago
Fixed on trunk.

/be
Blocks: 309169
Status: NEW → RESOLVED
Last Resolved: 11 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+
(Assignee)

Comment 6

11 years ago
Fixed on 1.8* branches.

/be
Keywords: fixed1.8.0.2, fixed1.8.1

Updated

11 years ago
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.