Add JSAPI for binding functions

RESOLVED FIXED in mozilla14

Status

()

Core
JavaScript Engine
P1
normal
RESOLVED FIXED
5 years ago
4 years ago

People

(Reporter: bz, Assigned: bz)

Tracking

Trunk
mozilla14
Points:
---
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

I want this for bug 726949.
Assignee: general → bzbarsky
OS: Mac OS X → All
Priority: -- → P1
Hardware: x86 → All
Created attachment 608590 [details] [diff] [review]
Add JSAPI for doing the equivalent of Function.prototype.bind.
Attachment #608590 - Flags: review?(jorendorff)
Whiteboard: [need review]
Comment on attachment 608590 [details] [diff] [review]
Add JSAPI for doing the equivalent of Function.prototype.bind.

Looks good.

Please change the functions JS_BindCallable and js_fun_bind to have return type JSObject * rather than an out parameter.

Can we have a jsapi-test? See js/src/jsapi-tests/README.
Attachment #608590 - Flags: review?(jorendorff) → review+
> Please change the functions JS_BindCallable and js_fun_bind to have return type 
> JSObject* rather than an out parameter.

And use an out param boolean to communicate failure state?  That seems odd for the JS engine...

> Can we have a jsapi-test?

Probably, once I have time to work on this again.
Per irc comments, just use NULL return to indicate failure.
Created attachment 611562 [details] [diff] [review]
Updated to comments, no tests yet
Attachment #608590 - Attachment is obsolete: true
http://hg.mozilla.org/mozilla-central/rev/f381c497e47a with JSAPI test.
Flags: in-testsuite+
Whiteboard: [need review]
Target Milestone: --- → mozilla14
Er, https://hg.mozilla.org/integration/mozilla-inbound/rev/f381c497e47a
https://hg.mozilla.org/mozilla-central/rev/f381c497e47a
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.