Commit a130dae8 by Marcin Cieslak

Cast received values to <v8::Object> once type confirmed

parent bf9f6ec2
......@@ -60,10 +60,10 @@ namespace SassTypes
Value* Factory::unwrap(v8::Local<v8::Value> obj) {
// Todo: non-SassValue objects could easily fall under that condition, need to be more specific.
if (!obj->IsObject() || obj->ToObject()->InternalFieldCount() != 1) {
if (!obj->IsObject() || obj.As<v8::Object>()->InternalFieldCount() != 1) {
throw std::invalid_argument("A SassValue object was expected.");
}
return static_cast<Value*>(Nan::GetInternalFieldPointer(obj->ToObject(), 0));
return static_cast<Value*>(Nan::GetInternalFieldPointer(obj.As<v8::Object>(), 0));
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment