From 020ac4a628debf7ce44429fd22c5bdff7c88a50a 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 Fixes: https://github.com/nodejs/node-addon-api/issues/380 PR-URL: https://github.com/nodejs/node-addon-api/pull/415 Reviewed-By: Gabriel Schulhof Reviewed-By: Michael Dawson --- 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 40959d8e1..4f532c77b 100644 --- a/napi-inl.h +++ b/napi-inl.h @@ -1078,7 +1078,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(