Fix PropertyKey::isArrayIndex

PropertyKey::asArrayIndex has a hole at UINT_MAX, so make isArrayIndex
have the same hole.

Change-Id: I85d0f14680c27d018644056960d75d94aee68646
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
This commit is contained in:
Erik Verbruggen 2019-02-19 11:17:17 +01:00 committed by Simon Hausmann
parent 56d6d905c2
commit 407e2769c7
1 changed files with 1 additions and 1 deletions

View File

@ -114,7 +114,7 @@ public:
static PropertyKey fromArrayIndex(uint idx) { PropertyKey key; key.val = ArrayIndexMask | static_cast<quint64>(idx); return key; }
bool isStringOrSymbol() const { return isManaged() && val != 0; }
uint asArrayIndex() const { return (isManaged() || val == 0) ? std::numeric_limits<uint>::max() : static_cast<uint>(val & 0xffffffff); }
uint isArrayIndex() const { return !isManaged() && val != 0; }
uint isArrayIndex() const { return !isManaged() && val != 0 && static_cast<uint>(val & 0xffffffff) != std::numeric_limits<uint>::max(); }
bool isValid() const { return val != 0; }
static PropertyKey fromStringOrSymbol(Heap::StringOrSymbol *b)
{ PropertyKey key; key.setM(b); return key; }