Skip to content
Closed
Changes from 1 commit
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
Prev Previous commit
Next Next commit
squash: address next set of comments
  • Loading branch information
mhdawson committed Jun 16, 2017
commit d534bd35b1f109961c2f0ff97109618d0a8fe706
12 changes: 6 additions & 6 deletions src/node_api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -157,19 +157,19 @@ class HandleScopeWrapper {
class EscapableHandleScopeWrapper {
public:
explicit EscapableHandleScopeWrapper(v8::Isolate* isolate) :
scope(isolate), _escapeCalled(false) {}
bool escapeAlreadyCalled(void) {
return _escapeCalled;
scope(isolate), escape_called_(false) {}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Minuscule style nit: the colon should go on the next line and have 4 spaces of indent.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

fixed.

bool escape_called() const {
return escape_called_;
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Style issues: method should be bool escape_called() const {, the data member should be escape_called_.

template <typename T>
v8::Local<T> Escape(v8::Local<T> handle) {
_escapeCalled = true;
escape_called_ = true;
return scope.Escape(handle);
}

private:
v8::EscapableHandleScope scope;
bool _escapeCalled;
bool escape_called_;
};

napi_handle_scope JsHandleScopeFromV8HandleScope(HandleScopeWrapper* s) {
Expand Down Expand Up @@ -2218,7 +2218,7 @@ napi_status napi_escape_handle(napi_env env,

v8impl::EscapableHandleScopeWrapper* s =
v8impl::V8EscapableHandleScopeFromJsEscapableHandleScope(scope);
if (!s->escapeAlreadyCalled()) {
if (!s->escape_called()) {
*result = v8impl::JsValueFromV8LocalValue(
s->Escape(v8impl::V8LocalValueFromJsValue(escapee)));
return napi_clear_last_error(env);
Expand Down