Smaller bug fixes to setting the length property for arrays
authorLars Knoll <lars.knoll@digia.com>
Mon, 14 Jan 2013 21:45:00 +0000 (22:45 +0100)
committerLars Knoll <lars.knoll@digia.com>
Tue, 15 Jan 2013 14:16:29 +0000 (15:16 +0100)
Change-Id: I5f93d8e6648aad162bfafbcc558bd77e8d59b50f
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
qmljs_objects.cpp
tests/TestExpectations

index 3ea7ede..04107d0 100644 (file)
@@ -483,9 +483,11 @@ bool Object::__defineOwnProperty__(ExecutionContext *ctx, String *name, Property
 
     if (isArray && name->isEqualTo(ctx->engine->id_length)) {
         PropertyDescriptor *lp = array.getLengthProperty();
+        if (desc->isEmpty() || desc->isSubset(lp))
+            return true;
         if (!lp->isWritable() || desc->type == PropertyDescriptor::Accessor || desc->isConfigurable() || desc->isEnumerable())
             goto reject;
-        bool succeeded = false;
+        bool succeeded = true;
         if (desc->type == PropertyDescriptor::Data) {
             bool ok;
             uint l = desc->value.asArrayLength(ctx, &ok);
index cb07b97..f030ff5 100644 (file)
@@ -823,7 +823,6 @@ S15.1.3.2_A5.3 failing
 15.2.3.6-3-66 failing
 15.2.3.6-3-94-1 failing
 15.2.3.6-3-94 failing
-15.2.3.6-4-163 failing
 15.2.3.6-4-188 failing
 15.2.3.6-4-189 failing
 15.2.3.6-4-20 failing