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

Commit

Permalink
n-api: Added jsrt implementation for napi_get_version
Browse files Browse the repository at this point in the history
PR-URL: #274
Reviewed-By: Kyle Farnung <kfarnung@microsoft.com>
Reviewed-By: Hitesh Kanwathirtha <hiteshk@microsoft.com>
  • Loading branch information
kunalspathak authored and kfarnung committed Jun 5, 2017
1 parent 09e9f4a commit 99c3ef5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/node_api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
#include "uv.h"
#include "node_api.h"

#define NAPI_VERSION 1

static
napi_status napi_set_last_error(napi_env env, napi_status error_code,
uint32_t engine_error_code = 0,
Expand Down
2 changes: 2 additions & 0 deletions src/node_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
#include <stdbool.h>
#include "node_api_types.h"

#define NAPI_VERSION 1

#ifdef _WIN32
#ifdef BUILDING_NODE_EXTENSION
#ifdef EXTERNAL_NAPI
Expand Down
6 changes: 6 additions & 0 deletions src/node_api_jsrt.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2006,6 +2006,12 @@ napi_status napi_get_typedarray_info(napi_env env,
return napi_ok;
}

napi_status napi_get_version(napi_env env, uint32_t* result) {
CHECK_ARG(result);
*result = NAPI_VERSION;
return napi_ok;
}

namespace uvimpl {

napi_status ConvertUVErrorCode(int code) {
Expand Down

0 comments on commit 99c3ef5

Please sign in to comment.