Fix issue encountered while debugging stacktraces
authoroliver@apple.com <oliver@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 8 Feb 2012 21:35:34 +0000 (21:35 +0000)
committeroliver@apple.com <oliver@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 8 Feb 2012 21:35:34 +0000 (21:35 +0000)
https://bugs.webkit.org/show_bug.cgi?id=78147

Reviewed by Gavin Barraclough.

Debugging is easier if we always ensure that we have a non-null
inferred name.

* runtime/Executable.cpp:
(JSC::FunctionExecutable::FunctionExecutable):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@107128 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/runtime/Executable.cpp
Source/JavaScriptCore/runtime/JSFunction.cpp

index 9de32d2..fa3548e 100644 (file)
@@ -1,5 +1,18 @@
 2012-02-08  Oliver Hunt  <oliver@apple.com>
 
+        Fix issue encountered while debugging stacktraces
+        https://bugs.webkit.org/show_bug.cgi?id=78147
+
+        Reviewed by Gavin Barraclough.
+
+        Debugging is easier if we always ensure that we have a non-null
+        inferred name.
+
+        * runtime/Executable.cpp:
+        (JSC::FunctionExecutable::FunctionExecutable):
+
+2012-02-08  Oliver Hunt  <oliver@apple.com>
+
         updateTopCallframe in the baseline JIT doesn't provide enough information to the stubs
         https://bugs.webkit.org/show_bug.cgi?id=78145
 
index c67c54c..bad2bae 100644 (file)
@@ -137,7 +137,7 @@ FunctionExecutable::FunctionExecutable(JSGlobalData& globalData, const Identifie
     , m_forceUsesArguments(forceUsesArguments)
     , m_parameters(parameters)
     , m_name(name)
-    , m_inferredName(inferredName)
+    , m_inferredName(inferredName.isNull() ? exec->globalData().propertyNames->emptyIdentifier : inferredName)
     , m_symbolTable(0)
 {
 }
@@ -148,7 +148,7 @@ FunctionExecutable::FunctionExecutable(ExecState* exec, const Identifier& name,
     , m_forceUsesArguments(forceUsesArguments)
     , m_parameters(parameters)
     , m_name(name)
-    , m_inferredName(inferredName)
+    , m_inferredName(inferredName.isNull() ? exec->globalData().propertyNames->emptyIdentifier : inferredName)
     , m_symbolTable(0)
 {
 }
index 4332e09..72e1ce1 100644 (file)
@@ -370,7 +370,7 @@ UString getCalculatedDisplayName(CallFrame* callFrame, JSObject* object)
         return function->calculatedDisplayName(callFrame);
     if (InternalFunction* function = jsDynamicCast<InternalFunction*>(object))
         return function->calculatedDisplayName(callFrame);
-    return UString();
+    return callFrame->globalData().propertyNames->emptyIdentifier.ustring();
 }
 
 } // namespace JSC