diff options
author | Lars Knoll <lars.knoll@qt.io> | 2018-08-28 16:59:16 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2018-08-29 07:03:03 +0000 |
commit | 9eb51ca0b26fc17c62b06211728f609863113a42 (patch) | |
tree | d4fe27ba114e56f1714ed89565cf4a9cf2f8545a /src/qml/jsruntime/qv4arrayobject.cpp | |
parent | ce1cd6468ad402003b7e7f3166c26485dd0bb9b1 (diff) |
Fix remaining test failures for Array.isArray
Change-Id: I6258cae2933392c260ce4c4d7f90a2838d91cd51
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4arrayobject.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4arrayobject.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/qml/jsruntime/qv4arrayobject.cpp b/src/qml/jsruntime/qv4arrayobject.cpp index c162a38e9d..042d296276 100644 --- a/src/qml/jsruntime/qv4arrayobject.cpp +++ b/src/qml/jsruntime/qv4arrayobject.cpp @@ -49,6 +49,7 @@ #include "qv4string_p.h" #include "qv4symbol_p.h" #include <QtCore/qscopedvaluerollback.h> +#include "qv4proxy_p.h" using namespace QV4; @@ -157,11 +158,12 @@ void ArrayPrototype::init(ExecutionEngine *engine, Object *ctor) ReturnedValue ArrayPrototype::method_isArray(const FunctionObject *, const Value *, const Value *argv, int argc) { - bool isArray = argc && argv[0].as<ArrayObject>(); - return Encode(isArray); + if (!argc || !argv->objectValue()) + return Encode(false); + return Encode(argv->objectValue()->isArray()); } -ScopedObject createObjectFromCtorOrArray(Scope &scope, ScopedFunctionObject ctor, bool useLen, int len) +static ScopedObject createObjectFromCtorOrArray(Scope &scope, ScopedFunctionObject ctor, bool useLen, int len) { ScopedObject a(scope, Primitive::undefinedValue()); |