Bug 42242
| Summary: | [Qt] Implement QScriptEngine::newFunction() parts that depend on QScriptContext | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Kent Hansen <kent.hansen> |
| Component: | JavaScriptCore | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED WONTFIX | ||
| Severity: | Normal | CC: | cmarcelo, jedrzej.nowacki |
| Priority: | P2 | Keywords: | Qt, QtTriaged |
| Version: | 528+ (Nightly build) | ||
| Hardware: | All | ||
| OS: | All | ||
| Bug Depends on: | |||
| Bug Blocks: | 41662 | ||
Kent Hansen
As a start, a QScriptContext can be constructed in our custom JSObjectCallAsFunctionCallback, passing the function, thisObject, argumentCount, and arguments to it; e.g.
QScriptContext *QScriptEnginePrivate::createContext(function, thisObject, argumentCount, arguments);
This would be sufficient to implement QScriptContext::argument(), QScriptContext::argumentCount(), QScriptContext::callee(), and QScriptContext::thisObject().
Ideally retrieving the information could be delegated to JSContextRef, but it doesn't have the API for it currently. The above approach should cover 95% of the use-cases for QScriptContext wrt. QScriptEngine::newFunction(), however.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Caio Marcelo de Oliveira Filho
Porting QtScript API over JSC C API will not be continued.