mirror of https://github.com/nodejs/node.git
smalloc: remove double checks
Now that values are checks in JS, no need for them to be checked in C++.pull/5010/head
parent
da07709c74
commit
2dafa193ee
|
@ -141,10 +141,7 @@ void SliceOnto(const FunctionCallbackInfo<Value>& args) {
|
||||||
void Alloc(const FunctionCallbackInfo<Value>& args) {
|
void Alloc(const FunctionCallbackInfo<Value>& args) {
|
||||||
HandleScope scope(node_isolate);
|
HandleScope scope(node_isolate);
|
||||||
|
|
||||||
if (!args[0]->IsObject())
|
Local<Object> obj = args[0].As<Object>();
|
||||||
return ThrowTypeError("argument must be an Object");
|
|
||||||
|
|
||||||
Local<Object> obj = args[0]->ToObject();
|
|
||||||
size_t length = args[1]->Uint32Value();
|
size_t length = args[1]->Uint32Value();
|
||||||
|
|
||||||
if (obj->HasIndexedPropertiesInExternalArrayData())
|
if (obj->HasIndexedPropertiesInExternalArrayData())
|
||||||
|
@ -197,7 +194,7 @@ void TargetCallback(Isolate* isolate,
|
||||||
|
|
||||||
// for internal use: dispose(obj);
|
// for internal use: dispose(obj);
|
||||||
void AllocDispose(const FunctionCallbackInfo<Value>& args) {
|
void AllocDispose(const FunctionCallbackInfo<Value>& args) {
|
||||||
AllocDispose(args[0]->ToObject());
|
AllocDispose(args[0].As<Object>());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue