diff options
author | Lars Knoll <lars.knoll@digia.com> | 2012-12-04 13:46:48 -0800 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2012-12-05 01:04:21 +0100 |
commit | 46953ed4d0a03d07c7d1c0e4aeeb5b0258909097 (patch) | |
tree | d5e6ffc0ffa8592d1c3a06a66814c7f5f14b5a28 /qmljs_engine.cpp | |
parent | b725f76711e8350b3d52921c851e693145b7251c (diff) |
Get rid of the ActivationObject
Also implement __qmljs_xxx_activation_property
in a more correct way.
Change-Id: I60c330bccca21fad99930987ed78153114a80c7d
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'qmljs_engine.cpp')
-rw-r--r-- | qmljs_engine.cpp | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/qmljs_engine.cpp b/qmljs_engine.cpp index 027cc33a9d..661781001d 100644 --- a/qmljs_engine.cpp +++ b/qmljs_engine.cpp @@ -176,9 +176,20 @@ ExecutionEngine::ExecutionEngine(EvalISelFactory *factory) glo->__put__(rootContext, identifier(QStringLiteral("TypeError")), typeErrorCtor); glo->__put__(rootContext, identifier(QStringLiteral("URIError")), uRIErrorCtor); glo->__put__(rootContext, identifier(QStringLiteral("Math")), Value::fromObject(newMathObject(rootContext))); - glo->__put__(rootContext, identifier(QStringLiteral("undefined")), Value::undefinedValue()); - glo->__put__(rootContext, identifier(QStringLiteral("NaN")), Value::fromDouble(nan(""))); - glo->__put__(rootContext, identifier(QStringLiteral("Infinity")), Value::fromDouble(INFINITY)); + + PropertyDescriptor pd; + pd.type = PropertyDescriptor::Data; + pd.writable = PropertyDescriptor::Unset; + pd.enumberable = PropertyDescriptor::Unset; + pd.configurable = PropertyDescriptor::Unset; + + pd.value = Value::undefinedValue(); + glo->__defineOwnProperty__(rootContext, identifier(QStringLiteral("undefined")), &pd); + pd.value = Value::fromDouble(nan("")); + glo->__defineOwnProperty__(rootContext, identifier(QStringLiteral("NaN")), &pd); + pd.value = Value::fromDouble(INFINITY); + glo->__defineOwnProperty__(rootContext, identifier(QStringLiteral("Infinity")), &pd); + glo->__put__(rootContext, identifier(QStringLiteral("eval")), Value::fromObject(new EvalFunction(rootContext))); // TODO: parseInt [15.1.2.2] @@ -369,9 +380,9 @@ Object *ExecutionEngine::newMathObject(ExecutionContext *ctx) return object; } -Object *ExecutionEngine::newActivationObject(ExecutionContext *ctx) +Object *ExecutionEngine::newActivationObject() { - return new ActivationObject(ctx); + return new Object(); } Object *ExecutionEngine::newForEachIteratorObject(Object *o) |