Mercurial > MadButterfly
comparison nodejs/mbfly_njs.h @ 559:ef078d7c57b4 Android_Skia
Use internal field to store njs_runtime_t object.
Instead of using named property to keep reference of njs_runtime_t
object, the internal field of v8 object is used.
author | Thinker K.F. Li <thinker@branda.to> |
---|---|
date | Mon, 07 Jun 2010 11:42:45 +0800 |
parents | |
children | a3c13c2a4792 |
comparison
equal
deleted
inserted
replaced
558:d61133da2845 | 559:ef078d7c57b4 |
---|---|
1 #ifndef __MBFLY_NJS_H_ | |
2 #define __MBFLY_NJS_H_ | |
3 | |
4 #include <v8.h> | |
5 extern "C" { | |
6 #include <mb.h> | |
7 } | |
8 | |
9 #define THROW(x) \ | |
10 do { \ | |
11 v8::Handle<v8::Value> exc; \ | |
12 exc = v8::Exception::Error(v8::String::New(x)); \ | |
13 return v8::ThrowException(exc); \ | |
14 } while(0) | |
15 #define UNWRAP(o) v8::External::Unwrap((o)->GetInternalField(0)) | |
16 #define WRAP(o, v) (o)->SetInternalField(0, v8::External::Wrap(v)) | |
17 #define SET(o, n, v) (o)->Set(v8::String::New(n), v) | |
18 #define GET(o, n) (o)->Get(v8::String::New(n)) | |
19 | |
20 redraw_man_t *xnjsmb_rt_rdman(v8::Handle<v8::Object> mbrt); | |
21 | |
22 #endif /* __MBFLY_NJS_H_ */ |