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

Unified Diff: src/d8.cc

Issue 10704038: Fix isolate build. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 6 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 | « src/d8.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/d8.cc
diff --git a/src/d8.cc b/src/d8.cc
index b3afcfe4e0fd4251d13142afcf530ecb0892d193..976510c464009a19f91bc9e7a0101decdc536fe4 100644
--- a/src/d8.cc
+++ b/src/d8.cc
@@ -117,7 +117,6 @@ Persistent<Context> Shell::utility_context_;
LineEditor* Shell::console = NULL;
Persistent<Context> Shell::evaluation_context_;
-Persistent<FunctionTemplate> Shell::array_buffer_template_;
ShellOptions Shell::options;
const char* Shell::kPrompt = "d8> ";
@@ -489,7 +488,8 @@ Handle<Value> Shell::CreateExternalArray(const Arguments& args,
byteLength = length * element_size;
byteOffset = 0;
- Handle<Value> array_buffer = array_buffer_template_->GetFunction();
+ Handle<Object> global = Context::GetCurrent()->Global();
+ Handle<Value> array_buffer = global->Get(String::New("ArrayBuffer"));
rossberg 2012/06/29 09:12:40 I guess, since it's immutable, that is fine. Altho
ASSERT(!try_catch.HasCaught() && array_buffer->IsFunction());
Handle<Value> buffer_args[] = { Uint32::New(byteLength) };
Handle<Value> result = Handle<Function>::Cast(array_buffer)->NewInstance(
@@ -947,10 +947,8 @@ Handle<ObjectTemplate> Shell::CreateGlobalTemplate() {
// Bind the handlers for external arrays.
PropertyAttribute attr =
static_cast<PropertyAttribute>(ReadOnly | DontDelete);
- array_buffer_template_ =
- Persistent<FunctionTemplate>::New(CreateArrayTemplate(ArrayBuffer));
global_template->Set(String::New("ArrayBuffer"),
- array_buffer_template_, attr);
+ CreateArrayTemplate(ArrayBuffer), attr);
global_template->Set(String::New("Int8Array"),
CreateArrayTemplate(Int8Array), attr);
global_template->Set(String::New("Uint8Array"),
« no previous file with comments | « src/d8.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698