| 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));
|
| }
|
|
|