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.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/JavaScriptCore/runtime/InternalFunction.cpp b/JavaScriptCore/runtime/InternalFunction.cpp
index 717b5ff..f774993 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)
+{
+}
+
+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,7 +59,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();
}