Bug 41662
Summary: | [Qt] QScriptEngine should have an API for wrapping a C function | ||
---|---|---|---|
Product: | WebKit | Reporter: | Kent Hansen <kent.hansen> |
Component: | JavaScriptCore | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED WONTFIX | ||
Severity: | Enhancement | CC: | cmarcelo, jedrzej.nowacki |
Priority: | P2 | Keywords: | Qt, QtTriaged |
Version: | 528+ (Nightly build) | ||
Hardware: | PC | ||
OS: | All | ||
Bug Depends on: | 42174, 42242 | ||
Bug Blocks: | 31863 |
Kent Hansen
See http://doc.trolltech.com/latest/qscriptengine.html#newFunction
This provides functionality similar to JSObjectMakeFunctionWithCallback() and JSObjectMakeConstructor() in the JSC C API.
Implementing this feature also requires implementing the QScriptContext class (see http://doc.trolltech.com/latest/qscriptcontext.html), which provides the arguments, callee and this-object for a particular invocation of the function.
In QtScript, the same type of callback is used for both normal functions and constructors; QScriptContext::isCalledAsConstructor() can be used to query whether the function was called as a constructor (e.g. as operand to "new").
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Caio Marcelo de Oliveira Filho
I'm working on this one, but have no permissions to set the "Assigned To" field.
Caio Marcelo de Oliveira Filho
Following Jedrzej suggestion, I'm going to split this in smaller tasks (bugs), and make them all depend on this bug.
What I want is to split up the QScriptContext parts from the "callback" support (bug 42174), since the former may need some extensions on the JSC C API.
Jędrzej Nowacki
Porting QtScript API over JSC C API will not be continued.