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

Unified Diff: src/top.cc

Issue 3602013: StackTrace should provide access to //@ sourceURL=... value (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 2 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/api.cc ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/top.cc
===================================================================
--- src/top.cc (revision 5585)
+++ src/top.cc (working copy)
@@ -385,6 +385,25 @@
SetProperty(stackFrame, script_key, script_name, NONE);
}
+ if (options & StackTrace::kScriptNameOrSourceURL) {
+ Handle<Object> script_name(script->name());
+ Handle<String> method_name =
Vitaly Repeshko 2010/10/05 10:21:43 To be consistent with existing column_key, line_ke
+ Factory::LookupAsciiSymbol("nameOrSourceURL");
+ Handle<JSValue> script_wrapper = GetScriptWrapper(Handle<Script>(script));
Vitaly Repeshko 2010/10/05 10:21:43 Hmm, the script handle should have been created mu
+ Handle<Object> property = GetProperty(script_wrapper, method_name);
+ ASSERT(property->IsJSFunction());
+ Handle<JSFunction> method = Handle<JSFunction>::cast(property);
+ bool caught_exception;
+ Handle<Object> result = Execution::TryCall(method, script_wrapper, 0,
+ NULL, &caught_exception);
+ if (caught_exception) {
+ result = Factory::undefined_value();
+ }
+ Handle<String> script_name_or_source_url_key =
+ Factory::LookupAsciiSymbol("scriptNameOrSourceURL");
+ SetProperty(stackFrame, script_name_or_source_url_key, result, NONE);
+ }
+
if (options & StackTrace::kFunctionName) {
Handle<Object> fun_name(fun->shared()->name());
if (fun_name->ToBoolean()->IsFalse()) {
« no previous file with comments | « src/api.cc ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698