Skip to content

Commit 386c2ae

Browse files
committed
test: remove dep on later C++ feature
Test failed to compile on sunos, remove dependency on std::to_string() PR-URL: #267 Reviewed-By: Gabriel Schulhof <[email protected]> Reviewed-By: Nicola Del Gobbo <[email protected]>
1 parent 437514e commit 386c2ae

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

test/handlescope.cc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#include "napi.h"
22
#include "string.h"
3+
#include <stdio.h>
4+
#include <stdlib.h>
35

46
using namespace Napi;
57

@@ -25,7 +27,9 @@ Value stressEscapeFromScope(const CallbackInfo& info) {
2527
Value result;
2628
for (int i = 0; i < LOOP_MAX; i++) {
2729
EscapableHandleScope scope(info.Env());
28-
std::string name = std::string("inner-scope") + std::to_string(i);
30+
char buffer[128];
31+
snprintf(buffer, 128, "%d", i);
32+
std::string name = std::string("inner-scope") + std::string(buffer);
2933
Value newValue = String::New(info.Env(), name.c_str());
3034
if (i == (LOOP_MAX -1)) {
3135
result = scope.Escape(newValue);

0 commit comments

Comments
 (0)