smalloc: remove double checks

Now that values are checks in JS, no need for them to be checked in C++.
pull/5010/head
Trevor Norris 2013-08-02 13:00:54 -07:00
parent da07709c74
commit 2dafa193ee
1 changed files with 2 additions and 5 deletions

View File

@ -141,10 +141,7 @@ void SliceOnto(const FunctionCallbackInfo<Value>& args) {
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())
@ -197,7 +194,7 @@ void TargetCallback(Isolate* isolate,
// for internal use: dispose(obj);
void AllocDispose(const FunctionCallbackInfo<Value>& args) {
AllocDispose(args[0]->ToObject());
AllocDispose(args[0].As<Object>());
}