Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(24)

Unified Diff: src/api-natives.cc

Issue 2474843003: Allow the global object to be frozen through the global template (Closed)
Patch Set: Nit cleanup Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/objects.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api-natives.cc
diff --git a/src/api-natives.cc b/src/api-natives.cc
index ab1b06256e0301b0ba60ef4705a203ed9a3476b5..3fe59e293d3ff2d1d8d3b3fd688897334e6e95c8 100644
--- a/src/api-natives.cc
+++ b/src/api-natives.cc
@@ -613,10 +613,12 @@ Handle<JSFunction> ApiNatives::CreateApiFunction(
}
int internal_field_count = 0;
+ bool immutable_proto = false;
if (!obj->instance_template()->IsUndefined(isolate)) {
Handle<ObjectTemplateInfo> instance_template = Handle<ObjectTemplateInfo>(
ObjectTemplateInfo::cast(obj->instance_template()));
internal_field_count = instance_template->internal_field_count();
+ immutable_proto = instance_template->immutable_proto();
}
// TODO(svenpanne) Kill ApiInstanceType and refactor things by generalizing
@@ -676,6 +678,8 @@ Handle<JSFunction> ApiNatives::CreateApiFunction(
map->set_is_constructor(true);
}
+ if (immutable_proto) map->set_immutable_proto(true);
+
return result;
}
« no previous file with comments | « no previous file | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698