| 444 | //=== HandleScope ============================================================== |
| 445 | |
| 446 | class HandleScope { |
| 447 | v8::HandleScope scope; |
| 448 | |
| 449 | public: |
| 450 | #if NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION |
| 451 | inline HandleScope() : scope(v8::Isolate::GetCurrent()) {} |
| 452 | inline static int NumberOfHandles() { |
| 453 | return v8::HandleScope::NumberOfHandles(v8::Isolate::GetCurrent()); |
| 454 | } |
| 455 | #else |
| 456 | inline HandleScope() : scope() {} |
| 457 | inline static int NumberOfHandles() { |
| 458 | return v8::HandleScope::NumberOfHandles(); |
| 459 | } |
| 460 | #endif |
| 461 | |
| 462 | private: |
| 463 | // Make it hard to create heap-allocated or illegal handle scopes by |
| 464 | // disallowing certain operations. |
| 465 | HandleScope(const HandleScope &); |
| 466 | void operator=(const HandleScope &); |
| 467 | void *operator new(size_t size); |
| 468 | void operator delete(void *, size_t) { |
| 469 | abort(); |
| 470 | } |
| 471 | }; |
| 472 | |
| 473 | class EscapableHandleScope { |
| 474 | public: |
nothing calls this directly
no outgoing calls
no test coverage detected