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

Unified Diff: src/d8.cc

Issue 39322: Mark special internal scripts as native scripts (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 9 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/bootstrapper.cc ('k') | src/runtime.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/d8.cc
===================================================================
--- src/d8.cc (revision 1441)
+++ src/d8.cc (working copy)
@@ -351,8 +351,16 @@
shell_source.length());
Handle<String> name = String::New(shell_source_name.start(),
shell_source_name.length());
- Script::Compile(source, name)->Run();
+ Handle<Script> script = Script::Compile(source, name);
+ script->Run();
+ // 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()));
+ script_object->set_type(i::Smi::FromInt(i::SCRIPT_TYPE_NATIVE));
+
// Create the evaluation context
evaluation_context_ = Context::New(NULL, global_template);
evaluation_context_->SetSecurityToken(Undefined());
« no previous file with comments | « src/bootstrapper.cc ('k') | src/runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698