Commit 73470162 authored by kasperl@chromium.org's avatar kasperl@chromium.org

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
parent 7d6a3b43
......@@ -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
......
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