diff options
author | Lars Knoll <lars.knoll@qt.io> | 2018-08-01 22:19:57 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2018-08-02 20:25:24 +0000 |
commit | 2291588304b6c057ad8fe0551aa76f33a4055917 (patch) | |
tree | f1a2e0fae9d31531744c5a0fc6093736cdeb8f7a /src/qml/jsruntime/qv4lookup.cpp | |
parent | 245cb6b6a3e5a04dc43a3c4ce15831f68309e97f (diff) |
Fix writing to properties of primitive data
In strict mode, this should throw a type error and not do
an implicit toObject conversion.
Change-Id: I7b8cdf1125978b9d9a047d9da84f23b547cb4a75
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4lookup.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4lookup.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4lookup.cpp b/src/qml/jsruntime/qv4lookup.cpp index daa5b2dfbd..95a431bd9b 100644 --- a/src/qml/jsruntime/qv4lookup.cpp +++ b/src/qml/jsruntime/qv4lookup.cpp @@ -511,6 +511,9 @@ bool Lookup::setterGeneric(Lookup *l, ExecutionEngine *engine, Value &object, co if (object.isObject()) return l->resolveSetter(engine, static_cast<Object *>(&object), value); + if (engine->currentStackFrame->v4Function->isStrict()) + return false; + Scope scope(engine); ScopedObject o(scope, RuntimeHelpers::convertToObject(scope.engine, object)); if (!o) // type error |