From 91c25d2365344442c0f461c3c348cec810991042 Mon Sep 17 00:00:00 2001 From: Philipp Renoth Date: Wed, 26 Dec 2018 16:54:20 +0100 Subject: [PATCH] src: make `Object::GetPropertyNames()` const Closes: https://github.com/nodejs/node-addon-api/issues/380 --- napi-inl.h | 2 +- napi.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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(