| 46 | |
| 47 | #define LOOP_MAX 1000000 |
| 48 | Value stressEscapeFromScope(const CallbackInfo& info) { |
| 49 | Value result; |
| 50 | for (int i = 0; i < LOOP_MAX; i++) { |
| 51 | EscapableHandleScope scope(info.Env()); |
| 52 | char buffer[128]; |
| 53 | snprintf(buffer, 128, "%d", i); |
| 54 | std::string name = std::string("inner-scope") + std::string(buffer); |
| 55 | Value newValue = String::New(info.Env(), name.c_str()); |
| 56 | if (i == (LOOP_MAX - 1)) { |
| 57 | result = scope.Escape(newValue); |
| 58 | } |
| 59 | } |
| 60 | return result; |
| 61 | } |
| 62 | |
| 63 | Value doubleEscapeFromScope(const CallbackInfo& info) { |
| 64 | Value result; |