diff options
author | Lars Knoll <lars.knoll@qt.io> | 2018-04-26 11:48:04 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2018-05-02 14:20:21 +0000 |
commit | c7fe748850383c5afcc18acf5568be0badd95c93 (patch) | |
tree | 99d5fc744b154b879496822a655859d491327224 /src/qml/jsruntime/qv4dateobject.cpp | |
parent | 440a25388b55d465873647b3dc9f470ed68e917e (diff) |
Cleanup creation code for builtin functions
Centralize the code in FunctionObject::createBuiltinFunction and setup
function names and length properties there.
Change-Id: I21f1d42b475070ee091d96d97387149af1dc47f2
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4dateobject.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4dateobject.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/qml/jsruntime/qv4dateobject.cpp b/src/qml/jsruntime/qv4dateobject.cpp index 394a7f3de3..8ad4ee8116 100644 --- a/src/qml/jsruntime/qv4dateobject.cpp +++ b/src/qml/jsruntime/qv4dateobject.cpp @@ -852,9 +852,7 @@ void DatePrototype::init(ExecutionEngine *engine, Object *ctor) QString toGmtString(QStringLiteral("toGMTString")); ScopedString us(scope, engine->newIdentifier(toUtcString)); ScopedString gs(scope, engine->newIdentifier(toGmtString)); - ExecutionContext *global = engine->rootContext(); - ScopedFunctionObject toUtcGmtStringFn(scope, FunctionObject::createBuiltinFunction(global, us, method_toUTCString)); - toUtcGmtStringFn->defineReadonlyConfigurableProperty(engine->id_length(), Primitive::fromInt32(0)); + ScopedFunctionObject toUtcGmtStringFn(scope, FunctionObject::createBuiltinFunction(engine, us, method_toUTCString, 0)); defineDefaultProperty(us, toUtcGmtStringFn); defineDefaultProperty(gs, toUtcGmtStringFn); } |