Skip to content
This repository has been archived by the owner on Jun 13, 2019. It is now read-only.

Commit

Permalink
Bindings: Clean up handles header
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriel Schulhof committed Jan 17, 2018
1 parent 257dde7 commit 9aac92e
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions src/structures/handles.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,7 @@

#include <map>
#include <memory>

#include "../common.h"
extern "C" {
#include <ocstack.h>
}
#include "common.h"

napi_value JSHandle_constructor(napi_env env, napi_callback_info info);

Expand Down Expand Up @@ -62,18 +58,15 @@ class JSHandle {
}

static std::string Get(napi_env env, napi_value jsValue, jsType **cData) {
napi_valuetype theType;
NAPI_CALL_RETURN(env, napi_typeof(env, jsValue, &theType));
if (theType != napi_object) {
return LOCAL_MESSAGE("Not an object");
}
J2C_VALIDATE_VALUE_TYPE_RETURN(env, jsValue, napi_object, "Handle");

napi_value jsConstructor;
HELPER_CALL_RETURN(InitClass(env, &jsConstructor));
bool isInstanceOf;
NAPI_CALL_RETURN(
env, napi_instanceof(env, jsValue, jsConstructor, &isInstanceOf));
if (!isInstanceOf) {
return LOCAL_MESSAGE(std::string("Not an object of type ") +
return LOCAL_MESSAGE(std::string("Handle is not an object of type ") +
jsType::jsClassName());
}
void *nativeDataRaw;
Expand Down

0 comments on commit 9aac92e

Please sign in to comment.