Plugin embed cleanup
This commit is contained in:
@@ -26,12 +26,17 @@ namespace {
|
||||
}
|
||||
}
|
||||
|
||||
#define SET_FUNCTION(object, name, fn)\
|
||||
object->Set(String::NewFromUtf8(isolate, name).ToLocalChecked(),\
|
||||
FunctionTemplate::New(isolate, fn, Local<v8::Value>(), Local<v8::Signature>(), 0,\
|
||||
v8::ConstructorBehavior::kThrow, v8::SideEffectType::kHasNoSideEffect, nullptr))
|
||||
|
||||
void plugin_embed(Isolate *_isolate, Local<ObjectTemplate> global) {
|
||||
isolate = _isolate;
|
||||
Isolate::Scope isolate_scope(isolate);
|
||||
HandleScope handle_scope(isolate);
|
||||
|
||||
Local<ObjectTemplate> krom_texsynth = ObjectTemplate::New(isolate);
|
||||
krom_texsynth->Set(String::NewFromUtf8(isolate, "inpaint").ToLocalChecked(), FunctionTemplate::New(isolate, krom_texsynth_inpaint));
|
||||
SET_FUNCTION(krom_texsynth, "inpaint", krom_texsynth_inpaint);
|
||||
global->Set(String::NewFromUtf8(isolate, "Krom_texsynth").ToLocalChecked(), krom_texsynth);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user