diff --git a/napi-inl.h b/napi-inl.h index 59362e704..85c380d6a 100644 --- a/napi-inl.h +++ b/napi-inl.h @@ -783,8 +783,8 @@ inline Object::PropertyLValue Object::operator [](const std::string return PropertyLValue(*this, utf8name); } -inline Object::PropertyLValue Object::operator [](uint32_t index) { - return PropertyLValue(*this, index); +inline Object::PropertyLValue Object::operator [](int index) { + return PropertyLValue(*this, index); } inline Value Object::operator [](const char* utf8name) const { @@ -795,7 +795,7 @@ inline Value Object::operator [](const std::string& utf8name) const { return Get(utf8name); } -inline Value Object::operator [](uint32_t index) const { +inline Value Object::operator [](int index) const { return Get(index); } diff --git a/napi.h b/napi.h index 531d1c358..bb7142546 100644 --- a/napi.h +++ b/napi.h @@ -395,8 +395,8 @@ namespace Napi { ); /// Gets or sets an indexed property or array element. - PropertyLValue operator []( - uint32_t index /// Property / element index + PropertyLValue operator []( + int index /// Property / element index ); /// Gets a named property. @@ -411,7 +411,7 @@ namespace Napi { /// Gets an indexed property or array element. Value operator []( - uint32_t index ///< Property / element index + int index ///< Property / element index ) const; /// Checks whether a property is present.