summaryrefslogtreecommitdiffstats
path: root/JavaScriptCore/runtime/InternalFunction.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'JavaScriptCore/runtime/InternalFunction.cpp')
-rw-r--r--JavaScriptCore/runtime/InternalFunction.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/JavaScriptCore/runtime/InternalFunction.cpp b/JavaScriptCore/runtime/InternalFunction.cpp
index c48d628..0a8d9de 100644
--- a/JavaScriptCore/runtime/InternalFunction.cpp
+++ b/JavaScriptCore/runtime/InternalFunction.cpp
@@ -24,6 +24,7 @@
#include "InternalFunction.h"
#include "FunctionPrototype.h"
+#include "JSGlobalObject.h"
#include "JSString.h"
namespace JSC {
@@ -37,15 +38,20 @@ const ClassInfo* InternalFunction::classInfo() const
return &info;
}
-InternalFunction::InternalFunction(JSGlobalData* globalData, NonNullPassRefPtr<Structure> structure, const Identifier& name)
- : JSObject(structure)
+InternalFunction::InternalFunction(NonNullPassRefPtr<Structure> structure)
+ : JSObjectWithGlobalObject(structure)
{
- putDirect(globalData->propertyNames->name, jsString(globalData, name.ustring()), DontDelete | ReadOnly | DontEnum);
+}
+
+InternalFunction::InternalFunction(JSGlobalData* globalData, JSGlobalObject* globalObject, NonNullPassRefPtr<Structure> structure, const Identifier& name)
+ : JSObjectWithGlobalObject(globalObject, structure)
+{
+ 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,9 +59,9 @@ 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();
+ return UString();
}
const UString InternalFunction::calculatedDisplayName(ExecState* exec)