Fix issue 658 by adapting the d8.cc code to the new types of

scripts (either a JSFunction or a SharedFunctionInfo).
Review URL: http://codereview.chromium.org/1077010

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4218 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
kasperl@chromium.org 2010-03-23 12:23:15 +00:00
parent 7d6a3b433f
commit 73470162de

View File

@ -467,9 +467,12 @@ void Shell::Initialize() {
// Mark the d8 shell script as native to avoid it showing up as normal source
// in the debugger.
i::Handle<i::JSFunction> script_fun = Utils::OpenHandle(*script);
i::Handle<i::Script> script_object =
i::Handle<i::Script>(i::Script::cast(script_fun->shared()->script()));
i::Handle<i::Object> compiled_script = Utils::OpenHandle(*script);
i::Handle<i::Script> script_object = compiled_script->IsJSFunction()
? i::Handle<i::Script>(i::Script::cast(
i::JSFunction::cast(*compiled_script)->shared()->script()))
: i::Handle<i::Script>(i::Script::cast(
i::SharedFunctionInfo::cast(*compiled_script)->script()));
script_object->set_type(i::Smi::FromInt(i::Script::TYPE_NATIVE));
// Create the evaluation context