Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src: remove const qualifier on Object::GetPropertyNames and Object::InstanceOf #992

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions napi-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -1315,7 +1315,7 @@ inline bool Object::Delete(uint32_t index) {
return result;
}

inline Array Object::GetPropertyNames() const {
inline Array Object::GetPropertyNames() {
napi_value result;
napi_status status = napi_get_property_names(_env, _value, &result);
NAPI_THROW_IF_FAILED(_env, status, Array());
Expand Down Expand Up @@ -1345,7 +1345,7 @@ inline bool Object::DefineProperties(
return true;
}

inline bool Object::InstanceOf(const Function& constructor) const {
inline bool Object::InstanceOf(const Function& constructor) {
bool result;
napi_status status = napi_instanceof(_env, _value, constructor, &result);
NAPI_THROW_IF_FAILED(_env, status, false);
Expand Down
7 changes: 3 additions & 4 deletions napi.h
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,7 @@ namespace Napi {
uint32_t index ///< Property / element index
);

Array GetPropertyNames() const; ///< Get all property names
Array GetPropertyNames(); ///< Get all property names

/// Defines a property on the object.
bool DefineProperty(
Expand All @@ -761,9 +761,8 @@ namespace Napi {
/// Checks if an object is an instance created by a constructor function.
///
/// This is equivalent to the JavaScript `instanceof` operator.
bool InstanceOf(
const Function& constructor ///< Constructor function
) const;
bool InstanceOf(const Function& constructor ///< Constructor function
);

template <typename Finalizer, typename T>
inline void AddFinalizer(Finalizer finalizeCallback, T* data);
Expand Down