Index: src/log.cc |
diff --git a/src/log.cc b/src/log.cc |
index 908a3682b83150d42254484eae3ab3fa251b214d..1d545af2c42456721fa0b5c0c12ea7c74e78d27b 100644 |
--- a/src/log.cc |
+++ b/src/log.cc |
@@ -1728,10 +1728,18 @@ void Logger::LogExistingFunction(Handle<SharedFunctionInfo> shared, |
Handle<String> func_name(shared->DebugName()); |
if (shared->script()->IsScript()) { |
Handle<Script> script(Script::cast(shared->script())); |
+ Handle<String> script_name; |
if (script->name()->IsString()) { |
- Handle<String> script_name(String::cast(script->name())); |
+ script_name = Handle<String>(String::cast(script->name())); |
+ } else { |
+ Handle<Object> name = GetScriptNameOrSourceURL(script); |
+ if (!name.is_null() && name->IsString()) { |
+ script_name = Handle<String>::cast(name); |
+ } |
+ } |
+ if (!script_name.is_null()) { |
int line_num = GetScriptLineNumber(script, shared->start_position()); |
- if (line_num > 0) { |
+ if (line_num > -1) { |
PROFILE(isolate_, |
CodeCreateEvent( |
Logger::ToNativeByScript(Logger::LAZY_COMPILE_TAG, *script), |