diff --git a/src/node_jsvmapi.cc b/src/node_jsvmapi.cc index 2991063621..19d4618e78 100644 --- a/src/node_jsvmapi.cc +++ b/src/node_jsvmapi.cc @@ -537,7 +537,7 @@ void napi_clear_last_error() { } const napi_extended_error_info* napi_get_last_error_info() { - static_assert(sizeof(error_messages) / sizeof(*error_messages) == napi_status_last, + static_assert(sizeof(error_messages) / sizeof(*error_messages) == napi_status_last, "Count of error messages must match count of error values"); assert(static_last_error.error_code < napi_status_last); @@ -594,7 +594,7 @@ napi_status napi_create_function( napi_status napi_create_constructor( napi_env e, - char* utf8name, + const char* utf8name, napi_callback cb, void* data, int property_count, diff --git a/src/node_jsvmapi.h b/src/node_jsvmapi.h index 0acab22e88..7d06d34323 100644 --- a/src/node_jsvmapi.h +++ b/src/node_jsvmapi.h @@ -66,13 +66,13 @@ NODE_EXTERN void napi_module_register(void* mod); #if defined(_MSC_VER) #pragma section(".CRT$XCU", read) -#define NODE_C_CTOR(fn) \ +#define NODE_ABI_CTOR(fn) \ static void __cdecl fn(void); \ __declspec(dllexport, allocate(".CRT$XCU")) \ void (__cdecl*fn ## _)(void) = fn; \ static void __cdecl fn(void) #else -#define NODE_C_CTOR(fn) \ +#define NODE_ABI_CTOR(fn) \ static void fn(void) __attribute__((constructor)); \ static void fn(void) #endif @@ -91,7 +91,7 @@ NODE_EXTERN void napi_module_register(void* mod); priv, \ NULL \ }; \ - NODE_C_CTOR(_register_ ## modname) { \ + NODE_ABI_CTOR(_register_ ## modname) { \ napi_module_register(&_module); \ } \ } @@ -287,7 +287,7 @@ NODE_EXTERN napi_status napi_wrap(napi_env e, napi_value jsObject, void* nativeO NODE_EXTERN napi_status napi_unwrap(napi_env e, napi_value jsObject, void** result); NODE_EXTERN napi_status napi_create_constructor(napi_env e, - char* utf8name, + const char* utf8name, napi_callback cb, void* data, int property_count, diff --git a/test/addons-abi/test_exception/test.js b/test/addons-abi/test_exception/test.js index cd55c6bfd4..bc6866ab93 100644 --- a/test/addons-abi/test_exception/test.js +++ b/test/addons-abi/test_exception/test.js @@ -1,6 +1,5 @@ 'use strict'; -try { var test_exception = require( "./build/Release/test_exception" ); var assert = require( "assert" ); var theError = new Error( "Some error" ); @@ -47,9 +46,3 @@ assert.strictEqual( undefined, caughtError, // Test that the exception state remains clear when no exception is thrown assert.strictEqual( test_exception.wasPending(), false, "VM was not marked as having an exception pending when none was allowed through" ); - -} -catch (e) { - console.log(e); - process.stdin.resume(); -} diff --git a/vcbuild.bat b/vcbuild.bat index 560db96784..3f914ead30 100644 --- a/vcbuild.bat +++ b/vcbuild.bat @@ -39,7 +39,7 @@ set enable_vtune_arg= set configure_flags= set build_addons= set dll= -set build_addon_abi= +set build_addons_abi= :next-arg if "%1"=="" goto args-done @@ -58,15 +58,10 @@ if /i "%1"=="nosnapshot" set nosnapshot=1&goto arg-ok if /i "%1"=="noetw" set noetw=1&goto arg-ok if /i "%1"=="noperfctr" set noperfctr=1&goto arg-ok if /i "%1"=="licensertf" set licensertf=1&goto arg-ok -<<<<<<< HEAD -if /i "%1"=="test" set test_args=%test_args% addons addon-abi doctool known_issues message parallel sequential -J&set jslint=1&set build_addons=1&goto arg-ok -if /i "%1"=="test-ci" set test_args=%test_args% %test_ci_args% -p tap --logfile test.tap addons addon-abi doctool inspector known_issues message sequential parallel&set cctest_args=%cctest_args% --gtest_output=tap:cctest.tap&set build_addons=1&goto arg-ok -======= -if /i "%1"=="test" set test_args=%test_args% addons addons-abi doctool known_issues message parallel sequential -J&set jslint=1&set build_addons=1&set build_addon_abi=1&goto arg-ok -if /i "%1"=="test-ci" set test_args=%test_args% %test_ci_args% -p tap --logfile test.tap addons addons-abi doctool known_issues message sequential parallel&set build_addons=1&set build_addon_abi=1&goto arg-ok ->>>>>>> 6e481bb... Change naming addon-abi to addons-abi +if /i "%1"=="test" set test_args=%test_args% addons addons-abi doctool known_issues message parallel sequential -J&set jslint=1&set build_addons=1&set build_addons_abi=1&goto arg-ok +if /i "%1"=="test-ci" set test_args=%test_args% %test_ci_args% -p tap --logfile test.tap addons addons-abi doctool inspector known_issues message sequential parallel&set cctest_args=%cctest_args% --gtest_output=tap:cctest.tap&set build_addons=1&set build_addons_abi=1&goto arg-ok if /i "%1"=="test-addons" set test_args=%test_args% addons&set build_addons=1&goto arg-ok -if /i "%1"=="test-addons-abi" set test_args=%test_args% addons-abi&set build_addon_abi=1&goto arg-ok +if /i "%1"=="test-addons-abi" set test_args=%test_args% addons-abi&set build_addons_abi=1&goto arg-ok if /i "%1"=="test-simple" set test_args=%test_args% sequential parallel -J&goto arg-ok if /i "%1"=="test-message" set test_args=%test_args% message&goto arg-ok if /i "%1"=="test-gc" set test_args=%test_args% gc&set buildnodeweak=1&goto arg-ok @@ -320,17 +315,7 @@ if not exist "%node_exe%" ( echo Failed to find node.exe goto build-addons-abi ) -echo Building add-ons - -:build-addons-abi -if not defined build_addons_abi goto run-tests -if not exist "%node_exe%" ( - echo Failed to find node.exe - goto run-tests -) -echo Building add-ons - - +echo Building addons :: clear for /d %%F in (test\addons\??_*) do ( rd /s /q %%F @@ -346,8 +331,14 @@ for /d %%F in (test\addons\*) do ( --nodedir="%cd%" if !errorlevel! neq 0 exit /b !errorlevel! ) -if not defined build_addon_abi goto run-tests -echo Building add-ons + +:build-addons-abi +if not defined build_addons_abi goto run-tests +if not exist "%node_exe%" ( + echo Failed to find node.exe + goto run-tests +) +echo Building addons-abi :: clear for /d %%F in (test\addons-abi\??_*) do ( rd /s /q %%F