|
Revision 19856, 0.6 kB
(checked in by tokuhirom, 5 years ago)
|
|
nspr things moved to ext/nspr =)
|
| Line | |
|---|
| 1 | #include <nspr/nspr.h> |
|---|
| 2 | #include <iostream> |
|---|
| 3 | #include <sstream> |
|---|
| 4 | |
|---|
| 5 | inline v8::Handle<v8::Value> throw_nspr(const char *header) { |
|---|
| 6 | v8::HandleScope handle_scope; |
|---|
| 7 | std::ostringstream e; |
|---|
| 8 | e << "NSPR ERROR(" << header << "):" << PR_ErrorToString(PR_GetError(), PR_LANGUAGE_I_DEFAULT); |
|---|
| 9 | return v8::ThrowException(v8::String::New(e.str().c_str())); |
|---|
| 10 | } |
|---|
| 11 | |
|---|
| 12 | inline v8::Handle<v8::Value> throw_nspr() { |
|---|
| 13 | v8::HandleScope handle_scope; |
|---|
| 14 | std::ostringstream e; |
|---|
| 15 | e << "NSPR ERROR:" << PR_ErrorToString(PR_GetError(), PR_LANGUAGE_I_DEFAULT); |
|---|
| 16 | return v8::ThrowException(v8::String::New(e.str().c_str())); |
|---|
| 17 | } |
|---|
| 18 | |
|---|