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

Unified Diff: chrome/test/base/v8_unit_test.cc

Issue 2126763002: Remove the prototype from all V8 functions that aren't constructors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: updates Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | extensions/renderer/console.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/base/v8_unit_test.cc
diff --git a/chrome/test/base/v8_unit_test.cc b/chrome/test/base/v8_unit_test.cc
index 80ac9fbfcb6ab2755d940e9209213ba061c33e85..92c3ae5834728e7920afddb2b6bf1fcc9092b2c3 100644
--- a/chrome/test/base/v8_unit_test.cc
+++ b/chrome/test/base/v8_unit_test.cc
@@ -169,13 +169,16 @@ void V8UnitTest::SetUp() {
v8::Local<v8::String> log_string = v8::String::NewFromUtf8(isolate, "log");
v8::Local<v8::FunctionTemplate> log_function =
v8::FunctionTemplate::New(isolate, &V8UnitTest::Log);
+ log_function->RemovePrototype();
global->Set(log_string, log_function);
// Set up chrome object for chrome.send().
v8::Local<v8::ObjectTemplate> chrome = v8::ObjectTemplate::New(isolate);
global->Set(v8::String::NewFromUtf8(isolate, "chrome"), chrome);
- chrome->Set(v8::String::NewFromUtf8(isolate, "send"),
- v8::FunctionTemplate::New(isolate, &V8UnitTest::ChromeSend));
+ v8::Local<v8::FunctionTemplate> send_function =
+ v8::FunctionTemplate::New(isolate, &V8UnitTest::ChromeSend);
+ send_function->RemovePrototype();
+ chrome->Set(v8::String::NewFromUtf8(isolate, "send"), send_function);
// Set up console object for console.log(), etc.
v8::Local<v8::ObjectTemplate> console = v8::ObjectTemplate::New(isolate);
@@ -183,8 +186,10 @@ void V8UnitTest::SetUp() {
console->Set(log_string, log_function);
console->Set(v8::String::NewFromUtf8(isolate, "info"), log_function);
console->Set(v8::String::NewFromUtf8(isolate, "warn"), log_function);
- console->Set(v8::String::NewFromUtf8(isolate, "error"),
- v8::FunctionTemplate::New(isolate, &V8UnitTest::Error));
+ v8::Local<v8::FunctionTemplate> error_function =
+ v8::FunctionTemplate::New(isolate, &V8UnitTest::Error);
+ error_function->RemovePrototype();
+ console->Set(v8::String::NewFromUtf8(isolate, "error"), error_function);
context_.Reset(isolate, v8::Context::New(isolate, NULL, global));
}
« no previous file with comments | « no previous file | extensions/renderer/console.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698