Index: src/api.cc |
diff --git a/src/api.cc b/src/api.cc |
index dea23a44f3df6e8e23496002d3bf913b48bd6c03..45505d7f62026a3619b974cb8457e694cdd88429 100644 |
--- a/src/api.cc |
+++ b/src/api.cc |
@@ -1024,13 +1024,13 @@ |
ENTER_V8(isolate); |
i::HandleScope scope(isolate); |
auto value_obj = Utils::OpenHandle(*value); |
+ CHECK(!value_obj->IsJSReceiver() || value_obj->IsTemplateInfo()); |
if (value_obj->IsObjectTemplateInfo()) { |
templ->set_serial_number(i::Smi::FromInt(0)); |
if (templ->IsFunctionTemplateInfo()) { |
i::Handle<i::FunctionTemplateInfo>::cast(templ)->set_do_not_cache(true); |
} |
} |
- // TODO(dcarney): split api to allow values of v8::Value or v8::TemplateInfo. |
i::ApiNatives::AddDataProperty(isolate, templ, Utils::OpenHandle(*name), |
value_obj, |
static_cast<i::PropertyAttributes>(attribute)); |