diff options
author | Lars Knoll <[email protected]> | 2013-09-26 13:05:25 +0200 |
---|---|---|
committer | The Qt Project <[email protected]> | 2013-09-28 13:33:58 +0200 |
commit | 62d1b5a08aa2c21c95a2a77afbe34c38ed37a2aa (patch) | |
tree | d9e542dfb9d7fa5d8e1c71633f6cd18cf234b5e6 /src/qml/jsruntime/qv4engine.cpp | |
parent | 112531bc23494ba3c5cf2e0a51b2d654be28dbfd (diff) |
Fix API for Object::define*Property
use ValueRef instead of const Value &.
Change-Id: I3fd0ca829870db27f036825d713c53dc0600be07
Reviewed-by: Simon Hausmann <[email protected]>
Diffstat (limited to 'src/qml/jsruntime/qv4engine.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4engine.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/qml/jsruntime/qv4engine.cpp b/src/qml/jsruntime/qv4engine.cpp index 4b02f89b88..62d8a2cf0c 100644 --- a/src/qml/jsruntime/qv4engine.cpp +++ b/src/qml/jsruntime/qv4engine.cpp @@ -124,6 +124,8 @@ ExecutionEngine::ExecutionEngine(QQmlJS::EvalISelFactory *factory) jsStackBase = (SafeValue *)jsStack->base(); jsStackTop = jsStackBase; + Scope scope(this); + identifierTable = new IdentifierTable(this); emptyClass = new (classPool.allocate(sizeof(InternalClass))) InternalClass(this); @@ -277,15 +279,16 @@ ExecutionEngine::ExecutionEngine(QQmlJS::EvalISelFactory *factory) globalObject->defineDefaultProperty(QStringLiteral("SyntaxError"), syntaxErrorCtor); globalObject->defineDefaultProperty(QStringLiteral("TypeError"), typeErrorCtor); globalObject->defineDefaultProperty(QStringLiteral("URIError"), uRIErrorCtor); - globalObject->defineDefaultProperty(QStringLiteral("Math"), Value::fromObject(new (memoryManager) MathObject(this))); - globalObject->defineDefaultProperty(QStringLiteral("JSON"), Value::fromObject(new (memoryManager) JsonObject(this))); + ScopedObject o(scope); + globalObject->defineDefaultProperty(QStringLiteral("Math"), (o = new (memoryManager) MathObject(this))); + globalObject->defineDefaultProperty(QStringLiteral("JSON"), (o = new (memoryManager) JsonObject(this))); globalObject->defineReadonlyProperty(QStringLiteral("undefined"), Primitive::undefinedValue()); globalObject->defineReadonlyProperty(QStringLiteral("NaN"), Primitive::fromDouble(std::numeric_limits<double>::quiet_NaN())); globalObject->defineReadonlyProperty(QStringLiteral("Infinity"), Primitive::fromDouble(Q_INFINITY)); evalFunction = new (memoryManager) EvalFunction(rootContext); - globalObject->defineDefaultProperty(QStringLiteral("eval"), Value::fromObject(evalFunction)); + globalObject->defineDefaultProperty(QStringLiteral("eval"), (o = evalFunction)); globalObject->defineDefaultProperty(QStringLiteral("parseInt"), GlobalFunctions::method_parseInt, 2); globalObject->defineDefaultProperty(QStringLiteral("parseFloat"), GlobalFunctions::method_parseFloat, 1); @@ -298,7 +301,6 @@ ExecutionEngine::ExecutionEngine(QQmlJS::EvalISelFactory *factory) globalObject->defineDefaultProperty(QStringLiteral("escape"), GlobalFunctions::method_escape, 1); globalObject->defineDefaultProperty(QStringLiteral("unescape"), GlobalFunctions::method_unescape, 1); - Scope scope(this); Scoped<String> name(scope, newString(QStringLiteral("thrower"))); thrower = newBuiltinFunction(rootContext, name, throwTypeError)->getPointer(); } |