diff --git a/napi-inl.h b/napi-inl.h index b831f34c9..49f86e0f7 100644 --- a/napi-inl.h +++ b/napi-inl.h @@ -1060,7 +1060,7 @@ inline bool Object::Delete(uint32_t index) { return result; } -inline Array Object::GetPropertyNames() { +inline Array Object::GetPropertyNames() const { napi_value result; napi_status status = napi_get_property_names(_env, _value, &result); NAPI_THROW_IF_FAILED(_env, status, Array()); diff --git a/napi.h b/napi.h index 16d09943a..22fbd2de9 100644 --- a/napi.h +++ b/napi.h @@ -601,7 +601,7 @@ namespace Napi { uint32_t index ///< Property / element index ); - Array GetPropertyNames(); ///< Get all property names + Array GetPropertyNames() const; ///< Get all property names /// Defines a property on the object. void DefineProperty(