Small fix for qmljs_delete_subscript
authorLars Knoll <lars.knoll@digia.com>
Sun, 14 Apr 2013 20:52:00 +0000 (22:52 +0200)
committerSimon Hausmann <simon.hausmann@digia.com>
Mon, 15 Apr 2013 08:48:32 +0000 (10:48 +0200)
Change-Id: I19f5ae0bb0a138756bb3396ebda6300eb8958b16
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
src/v4/qv4runtime.cpp

index 955236f..8787fcb 100644 (file)
@@ -182,11 +182,7 @@ Function *__qmljs_register_function(ExecutionContext *ctx, String *name,
 void __qmljs_delete_subscript(ExecutionContext *ctx, Value *result, const Value &base, const Value &index)
 {
     if (Object *o = base.asObject()) {
-        uint n = UINT_MAX;
-        if (index.isInteger())
-            n = index.integerValue();
-        else if (index.isDouble())
-            n = index.doubleValue();
+        uint n = index.asArrayIndex();
         if (n < UINT_MAX) {
             Value res = Value::fromBoolean(o->deleteIndexedProperty(ctx, n));
             if (result)