Index: src/api.cc |
diff --git a/src/api.cc b/src/api.cc |
index 79eb6198ca3f37cde9a0ee0121b56f4fabde7a99..776f196d885eb126d4d4dd33ebf33c6dcb5c86af 100644 |
--- a/src/api.cc |
+++ b/src/api.cc |
@@ -1416,7 +1416,7 @@ static Local<ObjectTemplate> ObjectTemplateNew( |
obj->set_serial_number(i::Smi::FromInt(next_serial_number)); |
if (!constructor.IsEmpty()) |
obj->set_constructor(*Utils::OpenHandle(*constructor)); |
- obj->set_internal_field_count(i::Smi::FromInt(0)); |
+ obj->set_data(i::Smi::FromInt(0)); |
return Utils::ToLocal(obj); |
} |
@@ -1711,7 +1711,7 @@ void ObjectTemplate::SetCallAsFunctionHandler(FunctionCallback callback, |
int ObjectTemplate::InternalFieldCount() { |
- return i::Smi::cast(Utils::OpenHandle(this)->internal_field_count())->value(); |
+ return Utils::OpenHandle(this)->internal_field_count(); |
} |
@@ -1729,9 +1729,18 @@ void ObjectTemplate::SetInternalFieldCount(int value) { |
// function to do the setting. |
EnsureConstructor(isolate, this); |
} |
- Utils::OpenHandle(this)->set_internal_field_count(i::Smi::FromInt(value)); |
+ Utils::OpenHandle(this)->set_internal_field_count(value); |
} |
+bool ObjectTemplate::IsImmutableProto() { |
+ return Utils::OpenHandle(this)->immutable_proto(); |
+} |
+ |
+void ObjectTemplate::SetImmutableProto() { |
+ i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); |
+ ENTER_V8(isolate); |
+ Utils::OpenHandle(this)->set_immutable_proto(true); |
+} |
// --- S c r i p t s --- |