]> git.saurik.com Git - apple/javascriptcore.git/blobdiff - runtime/InternalFunction.cpp
JavaScriptCore-721.26.tar.gz
[apple/javascriptcore.git] / runtime / InternalFunction.cpp
index c48d6288e5c8406d8b377d4cdebe70af386b729f..f68e795f31cbd8b0a298a35c31e5a26b056f8f22 100644 (file)
@@ -40,12 +40,12 @@ const ClassInfo* InternalFunction::classInfo() const
 InternalFunction::InternalFunction(JSGlobalData* globalData, NonNullPassRefPtr<Structure> structure, const Identifier& name)
     : JSObject(structure)
 {
-    putDirect(globalData->propertyNames->name, jsString(globalData, name.ustring()), DontDelete | ReadOnly | DontEnum);
+    putDirect(globalData->propertyNames->name, jsString(globalData, name.isNull() ? "" : name.ustring()), DontDelete | ReadOnly | DontEnum);
 }
 
 const UString& InternalFunction::name(ExecState* exec)
 {
-    return asString(getDirect(exec->globalData().propertyNames->name))->value(exec);
+    return asString(getDirect(exec->globalData().propertyNames->name))->tryGetValue();
 }
 
 const UString InternalFunction::displayName(ExecState* exec)
@@ -53,7 +53,7 @@ const UString InternalFunction::displayName(ExecState* exec)
     JSValue displayName = getDirect(exec->globalData().propertyNames->displayName);
     
     if (displayName && isJSString(&exec->globalData(), displayName))
-        return asString(displayName)->value(exec);
+        return asString(displayName)->tryGetValue();
     
     return UString::null();
 }