diff options
Diffstat (limited to 'src/qml/jsruntime/qv4proxy.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4proxy.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/qml/jsruntime/qv4proxy.cpp b/src/qml/jsruntime/qv4proxy.cpp index d4f342c50e..19e46304af 100644 --- a/src/qml/jsruntime/qv4proxy.cpp +++ b/src/qml/jsruntime/qv4proxy.cpp @@ -277,9 +277,10 @@ PropertyAttributes ProxyObject::virtualGetOwnProperty(Managed *m, PropertyKey id ObjectPrototype::toPropertyDescriptor(scope.engine, trapResult, resultDesc, &resultAttributes); resultDesc->fullyPopulated(&resultAttributes); - // ### - //Let valid be IsCompatiblePropertyDescriptor(extensibleTarget, resultDesc, targetDesc). - //If valid is false, throw a TypeError exception. + if (!targetDesc->isCompatible(targetAttributes, resultDesc, resultAttributes)) { + scope.engine->throwTypeError(); + return Attr_Invalid; + } if (!resultAttributes.isConfigurable()) { if (targetAttributes == Attr_Invalid || !targetAttributes.isConfigurable()) { @@ -336,8 +337,10 @@ bool ProxyObject::virtualDefineOwnProperty(Managed *m, PropertyKey id, const Pro return false; } } else { - // ### - // if IsCompatiblePropertyDescriptor(extensibleTarget, Desc, targetDesc) is false throw a type error. + if (!targetDesc->isCompatible(targetAttributes, p, attrs)) { + scope.engine->throwTypeError(); + return false; + } if (settingConfigFalse && targetAttributes.isConfigurable()) { scope.engine->throwTypeError(); return false; |