Bug 41662 - [Qt] QScriptEngine should have an API for wrapping a C function
Summary: [Qt] QScriptEngine should have an API for wrapping a C function
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC All
: P2 Enhancement
Assignee: Nobody
URL:
Keywords: Qt, QtTriaged
Depends on: 42174 42242
Blocks: 31863
  Show dependency treegraph
 
Reported: 2010-07-06 01:45 PDT by Kent Hansen
Modified: 2011-07-07 07:52 PDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kent Hansen 2010-07-06 01:45:54 PDT
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").
Comment 1 Caio Marcelo de Oliveira Filho 2010-07-08 01:00:09 PDT
I'm working on this one, but have no permissions to set the "Assigned To" field.
Comment 2 Caio Marcelo de Oliveira Filho 2010-07-13 09:52:19 PDT
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.
Comment 3 Jędrzej Nowacki 2011-07-07 07:52:11 PDT
Porting QtScript API over JSC C API will not be continued.