Skip to content

Commit

Permalink
test: remove dep on later C++ feature
Browse files Browse the repository at this point in the history
Test failed to compile on sunos, remove dependency
on std::to_string()

PR-URL: nodejs/node-addon-api#267
Reviewed-By: Gabriel Schulhof <[email protected]>
Reviewed-By: Nicola Del Gobbo <[email protected]>
  • Loading branch information
kevindavies8 committed May 8, 2018
1 parent ba1c82f commit 07e0865
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/handlescope.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#include "napi.h"
#include "string.h"
#include <stdio.h>
#include <stdlib.h>

using namespace Napi;

Expand All @@ -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);
Expand Down

0 comments on commit 07e0865

Please sign in to comment.