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

Side by Side Diff: src/api.cc

Issue 22990003: Add RemovePrototype to FunctionTemplate (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Test that function throws when constructed Created 7 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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 1389 matching lines...) Expand 10 before | Expand all | Expand 10 after
1400 1400
1401 void FunctionTemplate::ReadOnlyPrototype() { 1401 void FunctionTemplate::ReadOnlyPrototype() {
1402 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); 1402 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
1403 if (IsDeadCheck(isolate, "v8::FunctionTemplate::ReadOnlyPrototype()")) { 1403 if (IsDeadCheck(isolate, "v8::FunctionTemplate::ReadOnlyPrototype()")) {
1404 return; 1404 return;
1405 } 1405 }
1406 ENTER_V8(isolate); 1406 ENTER_V8(isolate);
1407 Utils::OpenHandle(this)->set_read_only_prototype(true); 1407 Utils::OpenHandle(this)->set_read_only_prototype(true);
1408 } 1408 }
1409 1409
1410
1411 void FunctionTemplate::RemovePrototype() {
1412 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
1413 if (IsDeadCheck(isolate, "v8::FunctionTemplate::RemovePrototype()")) {
1414 return;
1415 }
1416 ENTER_V8(isolate);
1417 Utils::OpenHandle(this)->set_remove_prototype(true);
1418 }
1419
1420
1410 template< 1421 template<
1411 typename Getter, 1422 typename Getter,
1412 typename Setter, 1423 typename Setter,
1413 typename Query, 1424 typename Query,
1414 typename Deleter, 1425 typename Deleter,
1415 typename Enumerator> 1426 typename Enumerator>
1416 static void SetNamedInstancePropertyHandler( 1427 static void SetNamedInstancePropertyHandler(
1417 i::Handle<i::FunctionTemplateInfo> function_template, 1428 i::Handle<i::FunctionTemplateInfo> function_template,
1418 Getter getter_in, 1429 Getter getter_in,
1419 Setter setter_in, 1430 Setter setter_in,
(...skipping 6753 matching lines...) Expand 10 before | Expand all | Expand 10 after
8173 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); 8184 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate());
8174 Address callback_address = 8185 Address callback_address =
8175 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 8186 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
8176 VMState<EXTERNAL> state(isolate); 8187 VMState<EXTERNAL> state(isolate);
8177 ExternalCallbackScope call_scope(isolate, callback_address); 8188 ExternalCallbackScope call_scope(isolate, callback_address);
8178 return callback(info); 8189 return callback(info);
8179 } 8190 }
8180 8191
8181 8192
8182 } } // namespace v8::internal 8193 } } // 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