void Alloc(const FunctionCallbackInfo<Value>& args) {
HandleScope scope(node_isolate);
- if (!args[0]->IsObject())
- return ThrowTypeError("argument must be an Object");
-
- Local<Object> obj = args[0]->ToObject();
+ Local<Object> obj = args[0].As<Object>();
size_t length = args[1]->Uint32Value();
if (obj->HasIndexedPropertiesInExternalArrayData())
// for internal use: dispose(obj);
void AllocDispose(const FunctionCallbackInfo<Value>& args) {
- AllocDispose(args[0]->ToObject());
+ AllocDispose(args[0].As<Object>());
}