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()) { |