ext/v8/v8_macros.h in mustang-0.1.1 vs ext/v8/v8_macros.h in mustang-0.2.0
- old
+ new
@@ -25,6 +25,12 @@
static Local<T> unwrap(VALUE self) \
{ \
return v8_ref_get<T>(self); \
}
+#define PREVENT_CREATION_WITHOUT_CONTEXT() \
+ if (!Context::InContext()) { \
+ rb_raise(rb_eRuntimeError, "can't create V8 object without entering into context"); \
+ return Qnil; \
+ }
+
#endif//__V8_MACROS_H