From 800e0a3d01a763b0cc6d4aa9590ff157f054de05 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Sun, 14 Apr 2013 22:52:00 +0200 Subject: Small fix for qmljs_delete_subscript Change-Id: I19f5ae0bb0a138756bb3396ebda6300eb8958b16 Reviewed-by: Simon Hausmann --- src/v4/qv4runtime.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/v4/qv4runtime.cpp b/src/v4/qv4runtime.cpp index 955236f8b5..8787fcba66 100644 --- a/src/v4/qv4runtime.cpp +++ b/src/v4/qv4runtime.cpp @@ -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) -- cgit v1.2.3