chore: remove native_mate (Part 1) (#20085)

* move Destroyable utilities out of native_mate

* do not set "destroy" in ObjectTemplateBuilder

* remove ObjectTemplateBuilder::MakeDestroyable

* do not pollute gin namespace

* add more comments

* remove hack of Arguments
This commit is contained in:
Cheng Zhao 2019-09-04 11:14:16 +09:00 committed by GitHub
parent 96b42bddb8
commit b601f3a031
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 108 additions and 42 deletions

View file

@ -115,9 +115,8 @@ v8::Local<v8::Value> PowerMonitor::Create(v8::Isolate* isolate) {
void PowerMonitor::BuildPrototype(v8::Isolate* isolate,
v8::Local<v8::FunctionTemplate> prototype) {
prototype->SetClassName(mate::StringToV8(isolate, "PowerMonitor"));
gin_helper::Destroyable::MakeDestroyable(isolate, prototype);
mate::ObjectTemplateBuilder(isolate, prototype->PrototypeTemplate())
.MakeDestroyable()
#if defined(OS_LINUX)
.SetMethod("blockShutdown", &PowerMonitor::BlockShutdown)
.SetMethod("unblockShutdown", &PowerMonitor::UnblockShutdown)