From 386c2aeb742a06f7a6ec183e23d7ca5d74afb18a Mon Sep 17 00:00:00 2001 From: Michael Dawson Date: Tue, 8 May 2018 11:51:38 -0400 Subject: [PATCH] test: remove dep on later C++ feature Test failed to compile on sunos, remove dependency on std::to_string() PR-URL: https://github.com/nodejs/node-addon-api/pull/267 Reviewed-By: Gabriel Schulhof Reviewed-By: Nicola Del Gobbo --- test/handlescope.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/handlescope.cc b/test/handlescope.cc index a976d3a8f..9c958850d 100644 --- a/test/handlescope.cc +++ b/test/handlescope.cc @@ -1,5 +1,7 @@ #include "napi.h" #include "string.h" +#include +#include using namespace Napi; @@ -25,7 +27,9 @@ Value stressEscapeFromScope(const CallbackInfo& info) { Value result; for (int i = 0; i < LOOP_MAX; i++) { EscapableHandleScope scope(info.Env()); - std::string name = std::string("inner-scope") + std::to_string(i); + char buffer[128]; + snprintf(buffer, 128, "%d", i); + std::string name = std::string("inner-scope") + std::string(buffer); Value newValue = String::New(info.Env(), name.c_str()); if (i == (LOOP_MAX -1)) { result = scope.Escape(newValue);