From 224f1c61b92cb82442d84f8975cd63439728609d Mon Sep 17 00:00:00 2001 From: Roy Wright 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 40959d8..4f532c7 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 16d0994..22fbd2d 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(