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

Side by Side Diff: src/api.cc

Issue 7324027: Fix: FunctionTemplate::SetPrototypeAttributes broke prototype object (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: address comments Created 9 years, 4 months 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « include/v8.h ('k') | src/apinatives.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 859 matching lines...) Expand 10 before | Expand all | Expand 10 after
870 array.add(Utils::OpenHandle(*value)); 870 array.add(Utils::OpenHandle(*value));
871 array.add(Utils::OpenHandle(*v8::Integer::New(attribute))); 871 array.add(Utils::OpenHandle(*v8::Integer::New(attribute)));
872 } 872 }
873 873
874 874
875 // --- F u n c t i o n T e m p l a t e --- 875 // --- F u n c t i o n T e m p l a t e ---
876 static void InitializeFunctionTemplate( 876 static void InitializeFunctionTemplate(
877 i::Handle<i::FunctionTemplateInfo> info) { 877 i::Handle<i::FunctionTemplateInfo> info) {
878 info->set_tag(i::Smi::FromInt(Consts::FUNCTION_TEMPLATE)); 878 info->set_tag(i::Smi::FromInt(Consts::FUNCTION_TEMPLATE));
879 info->set_flag(0); 879 info->set_flag(0);
880 info->set_prototype_attributes(i::Smi::FromInt(v8::None));
881 } 880 }
882 881
883 882
884 Local<ObjectTemplate> FunctionTemplate::PrototypeTemplate() { 883 Local<ObjectTemplate> FunctionTemplate::PrototypeTemplate() {
885 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); 884 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
886 if (IsDeadCheck(isolate, "v8::FunctionTemplate::PrototypeTemplate()")) { 885 if (IsDeadCheck(isolate, "v8::FunctionTemplate::PrototypeTemplate()")) {
887 return Local<ObjectTemplate>(); 886 return Local<ObjectTemplate>();
888 } 887 }
889 ENTER_V8(isolate); 888 ENTER_V8(isolate);
890 i::Handle<i::Object> result(Utils::OpenHandle(this)->prototype_template()); 889 i::Handle<i::Object> result(Utils::OpenHandle(this)->prototype_template());
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
1093 void FunctionTemplate::SetHiddenPrototype(bool value) { 1092 void FunctionTemplate::SetHiddenPrototype(bool value) {
1094 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); 1093 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
1095 if (IsDeadCheck(isolate, "v8::FunctionTemplate::SetHiddenPrototype()")) { 1094 if (IsDeadCheck(isolate, "v8::FunctionTemplate::SetHiddenPrototype()")) {
1096 return; 1095 return;
1097 } 1096 }
1098 ENTER_V8(isolate); 1097 ENTER_V8(isolate);
1099 Utils::OpenHandle(this)->set_hidden_prototype(value); 1098 Utils::OpenHandle(this)->set_hidden_prototype(value);
1100 } 1099 }
1101 1100
1102 1101
1103 void FunctionTemplate::SetPrototypeAttributes(int attributes) { 1102 void FunctionTemplate::ReadOnlyPrototype() {
1104 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); 1103 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
1105 if (IsDeadCheck(isolate, "v8::FunctionTemplate::SetPrototypeAttributes()")) { 1104 if (IsDeadCheck(isolate, "v8::FunctionTemplate::SetPrototypeAttributes()")) {
1106 return; 1105 return;
1107 } 1106 }
1108 ENTER_V8(isolate); 1107 ENTER_V8(isolate);
1109 Utils::OpenHandle(this)->set_prototype_attributes( 1108 Utils::OpenHandle(this)->set_read_only_prototype(true);
1110 i::Smi::FromInt(attributes));
1111 } 1109 }
1112 1110
1113 1111
1114 void FunctionTemplate::SetNamedInstancePropertyHandler( 1112 void FunctionTemplate::SetNamedInstancePropertyHandler(
1115 NamedPropertyGetter getter, 1113 NamedPropertyGetter getter,
1116 NamedPropertySetter setter, 1114 NamedPropertySetter setter,
1117 NamedPropertyQuery query, 1115 NamedPropertyQuery query,
1118 NamedPropertyDeleter remover, 1116 NamedPropertyDeleter remover,
1119 NamedPropertyEnumerator enumerator, 1117 NamedPropertyEnumerator enumerator,
1120 Handle<Value> data) { 1118 Handle<Value> data) {
(...skipping 4919 matching lines...) Expand 10 before | Expand all | Expand 10 after
6040 6038
6041 6039
6042 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { 6040 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) {
6043 HandleScopeImplementer* scope_implementer = 6041 HandleScopeImplementer* scope_implementer =
6044 reinterpret_cast<HandleScopeImplementer*>(storage); 6042 reinterpret_cast<HandleScopeImplementer*>(storage);
6045 scope_implementer->IterateThis(v); 6043 scope_implementer->IterateThis(v);
6046 return storage + ArchiveSpacePerThread(); 6044 return storage + ArchiveSpacePerThread();
6047 } 6045 }
6048 6046
6049 } } // namespace v8::internal 6047 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « include/v8.h ('k') | src/apinatives.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698