From 3e18c49657bcb0f2504def3d7d6d900f0c25e357 Mon Sep 17 00:00:00 2001 From: Michael Dawson Date: Tue, 13 Jun 2017 00:40:00 -0400 Subject: n-api: avoid crash in napi_escape_scope() V8 will crash if escape is called twice on the same scope. Add checks to avoid crashing if napi_escape_scope() is called to try and do this. Add test that tries to call napi_create_scope() twice. PR-URL: https://github.com/nodejs/node/pull/13651 Reviewed-By: Jason Ginchereau Reviewed-By: Colin Ihrig Reviewed-By: James M Snell Reviewed-By: Anna Henningsen Reviewed-By: Ben Noordhuis --- src/node_api_types.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/node_api_types.h') diff --git a/src/node_api_types.h b/src/node_api_types.h index 4bf1b82631..43102c519c 100644 --- a/src/node_api_types.h +++ b/src/node_api_types.h @@ -67,7 +67,7 @@ typedef enum { napi_generic_failure, napi_pending_exception, napi_cancelled, - napi_status_last + napi_escape_called_twice } napi_status; typedef napi_value (*napi_callback)(napi_env env, -- cgit v1.2.3