[Webkit-unassigned] [Bug 42174] [Qt] Implement QScriptEngine::newFunction() parts that doesn't depend on QScriptContext

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Jul 25 23:57:48 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=42174


Jędrzej Nowacki <jedrzej.nowacki at nokia.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #62488|review?                     |
               Flag|                            |




--- Comment #7 from Jędrzej Nowacki <jedrzej.nowacki at nokia.com>  2010-07-25 23:57:48 PST ---
(From update of attachment 62488)
(In reply to comment #5)
> The property "constructor" of the newly created prototype fails because of bug 40631 (can't change the property flags).
Typo, it should be "bug 40613" ;-)

JavaScriptCore/qt/api/qscriptfunction.cpp:112
 +          return *new QScriptValuePrivate(engine, QScriptValue::UndefinedValue);
JavaScriptCore/qt/api/qscriptfunction.cpp:121
 +          return *new QScriptValuePrivate(engine, QScriptValue::UndefinedValue);
JavaScriptCore/qt/api/qscriptfunction.cpp:57
 +          return *new QScriptValuePrivate(engine, QScriptValue::UndefinedValue);
JavaScriptCore/qt/api/qscriptfunction.cpp:48
 +          return *new QScriptValuePrivate(engine, QScriptValue::UndefinedValue);
You should use engine->makeJSValue(QScriptValue::UndefinedValue) here. It would be faster and it wouldn't cause a memory leak.

JavaScriptCore/qt/api/qscriptfunction.cpp:109
 +      QScriptValuePrivate* result = QScriptValuePrivate::get(data->fun(0, QScriptEnginePrivate::get(engine), data->arg));
JavaScriptCore/qt/api/qscriptfunction.cpp:45
 +      QScriptValuePrivate* result = QScriptValuePrivate::get(data->fun(0, QScriptEnginePrivate::get(engine)));
Can you add comment about 0 value?

JavaScriptCore/qt/api/qscriptfunction.cpp:86
 +  JSClassRef qt_createNativeFunctionClass()
JavaScriptCore/qt/api/qscriptfunction.cpp:150
 +  JSClassRef qt_createNativeFunctionWithArgClass()
Why you need these functions? Can't you use JSClassCreate directly?

JavaScriptCore/qt/api/qscriptengine_p.cpp:112
 +  QScriptValuePrivate* QScriptEnginePrivate::newFunction_helper(JSObjectRef funJS, QScriptValuePrivate* prototype)
Could you rename it? Underscore should be avoided. I think that newFunction is the correct name.

JavaScriptCore/qt/tests/qscriptengine/tst_qscriptengine.cpp:128
 +              QEXPECT_FAIL("", "JSCallbackObject::getOwnPropertyDescriptor() doesn't return correct information yet", Continue);
Can you provide a bug number? I have seen that the bug 33946 got fixed, maybe it works now :-)

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list