#ifdef HAVE_CONFIG_H #include #endif #include #include #include namespace efl { namespace eina { namespace js { EAPI void register_destroy_accessor(v8::Isolate *isolate, v8::Handle global, v8::Handle name) { typedef void (*deleter_t)(void*); auto f = [](compatibility_callback_info_type info) -> compatibility_return_type { if (info.Length() != 1 || !info[0]->IsObject()) return compatibility_return(); v8::Handle o = info[0]->ToObject(); deleter_t deleter = compatibility_get_pointer_internal_field(o, 1); deleter(compatibility_get_pointer_internal_field<>(o, 0)); return compatibility_return(); }; global->Set(name, compatibility_new(isolate, f)->GetFunction()); } } } } // namespace efl { namespace js {