Closed Bug 480850 (JS_New) Opened 11 years ago Closed 10 years ago
JSAPI should support creating objects given a constructor Function
We've known this is a missing API for a long time now. Because FUN_CLASP is for good reasons non-public, it's far from straightforward for JSAPI applications to implement this. (I don't know that it's even possible without eval/JS_EvaluateScript.)
I file this now because we've got an embedder rolling his own--and suffering: http://github.com/meh/lulzjs/blob/93ea51e4a174cf5a3f1c0df9029cb38327de664d/js/lulzjs/lulzjs.cpp#L21-64 Note the bug obtaining `klass`. :( Incidentally, the crazy consequences of (unintentionally) creating objects with js_FunctionClass are surprisingly hard to diagnose.
Assignee: general → jorendorff
(memo to myself) Ash pointed out this is missing CHECK_REQUEST.
jorendorff: any reason (other than the missing CHECK_REQUEST mentioned in comment 3) that this isn't up for review/checkin?
I need this, and it works for me. Let's get it in?
Severity: normal → enhancement
I'll post a patch with jsapi-test in the next couple hours.
Attachment #432616 - Flags: review?(mrbkap) → review+
What additional review does this patch need?
It landed in tracemonkey last week. http://hg.mozilla.org/tracemonkey/rev/869bebcf1f21
Also pushed to projects/electrolysis: http://hg.mozilla.org/projects/electrolysis/rev/faa984df7f45
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.