Commit 947cf393 authored by yangguo@chromium.org's avatar yangguo@chromium.org

Fix isolate build.

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/10704038

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11952 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 8128c6e7
...@@ -117,7 +117,6 @@ Persistent<Context> Shell::utility_context_; ...@@ -117,7 +117,6 @@ Persistent<Context> Shell::utility_context_;
LineEditor* Shell::console = NULL; LineEditor* Shell::console = NULL;
Persistent<Context> Shell::evaluation_context_; Persistent<Context> Shell::evaluation_context_;
Persistent<FunctionTemplate> Shell::array_buffer_template_;
ShellOptions Shell::options; ShellOptions Shell::options;
const char* Shell::kPrompt = "d8> "; const char* Shell::kPrompt = "d8> ";
...@@ -489,7 +488,8 @@ Handle<Value> Shell::CreateExternalArray(const Arguments& args, ...@@ -489,7 +488,8 @@ Handle<Value> Shell::CreateExternalArray(const Arguments& args,
byteLength = length * element_size; byteLength = length * element_size;
byteOffset = 0; 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"));
ASSERT(!try_catch.HasCaught() && array_buffer->IsFunction()); ASSERT(!try_catch.HasCaught() && array_buffer->IsFunction());
Handle<Value> buffer_args[] = { Uint32::New(byteLength) }; Handle<Value> buffer_args[] = { Uint32::New(byteLength) };
Handle<Value> result = Handle<Function>::Cast(array_buffer)->NewInstance( Handle<Value> result = Handle<Function>::Cast(array_buffer)->NewInstance(
...@@ -947,10 +947,8 @@ Handle<ObjectTemplate> Shell::CreateGlobalTemplate() { ...@@ -947,10 +947,8 @@ Handle<ObjectTemplate> Shell::CreateGlobalTemplate() {
// Bind the handlers for external arrays. // Bind the handlers for external arrays.
PropertyAttribute attr = PropertyAttribute attr =
static_cast<PropertyAttribute>(ReadOnly | DontDelete); static_cast<PropertyAttribute>(ReadOnly | DontDelete);
array_buffer_template_ =
Persistent<FunctionTemplate>::New(CreateArrayTemplate(ArrayBuffer));
global_template->Set(String::New("ArrayBuffer"), global_template->Set(String::New("ArrayBuffer"),
array_buffer_template_, attr); CreateArrayTemplate(ArrayBuffer), attr);
global_template->Set(String::New("Int8Array"), global_template->Set(String::New("Int8Array"),
CreateArrayTemplate(Int8Array), attr); CreateArrayTemplate(Int8Array), attr);
global_template->Set(String::New("Uint8Array"), global_template->Set(String::New("Uint8Array"),
......
...@@ -367,7 +367,6 @@ class Shell : public i::AllStatic { ...@@ -367,7 +367,6 @@ class Shell : public i::AllStatic {
private: private:
static Persistent<Context> evaluation_context_; static Persistent<Context> evaluation_context_;
static Persistent<FunctionTemplate> array_buffer_template_;
#ifndef V8_SHARED #ifndef V8_SHARED
static Persistent<Context> utility_context_; static Persistent<Context> utility_context_;
static CounterMap* counter_map_; static CounterMap* counter_map_;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment