Skip to content
This repository has been archived by the owner on Oct 15, 2020. It is now read-only.

napi: fix property string length #408

Closed
wants to merge 1 commit into from
Closed

napi: fix property string length #408

wants to merge 1 commit into from

Conversation

obastemur
Copy link
Contributor

No description provided.

@@ -783,10 +783,10 @@ napi_status napi_define_class(napi_env env,

JsPropertyIdRef pid = nullptr;
JsValueRef prototype = nullptr;
CHECK_JSRT(JsCreatePropertyId("prototype", 10, &pid));
CHECK_JSRT(JsCreatePropertyId("prototype", 9, &pid));
Copy link
Member

@bnoordhuis bnoordhuis Oct 2, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a suggestion but you could use sizeof("prototype") - 1 as it's obviously correct and idiomatic. It's the style the code base uses elsewhere.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bnoordhuis sounds good.

@obastemur
Copy link
Contributor Author

Went a step further and created a macro.. well, in case we write "prototype", sizeof("proprotype") - 1 ..

MSLaguana pushed a commit that referenced this pull request Oct 2, 2017
PR-URL: #408
Reviewed-By: Jimmy Thomson <[email protected]>
@MSLaguana
Copy link
Contributor

Merged in 233d9dd

@MSLaguana MSLaguana closed this Oct 2, 2017
MSLaguana pushed a commit to MSLaguana/node-chakracore that referenced this pull request Oct 2, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants