]> git.saurik.com Git - apple/javascriptcore.git/blobdiff - runtime/PropertySlot.cpp
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / runtime / PropertySlot.cpp
index 2306a11e576fe820501be6e3537c517af7e1474f..c949f4bd23441cc87f7f663c48b5a694220bc1b8 100644 (file)
 #include "config.h"
 #include "PropertySlot.h"
 
-#include "JSFunction.h"
-#include "JSGlobalObject.h"
+#include "GetterSetter.h"
+#include "JSCJSValueInlines.h"
 
 namespace JSC {
 
 JSValue PropertySlot::functionGetter(ExecState* exec) const
 {
-    // Prevent getter functions from observing execution if an exception is pending.
-    if (exec->hadException())
-        return exec->exception();
-
-    CallData callData;
-    CallType callType = m_data.getterFunc->getCallData(callData);
-    if (callType == CallTypeHost)
-        return callData.native.function(exec, m_data.getterFunc, thisValue(), exec->emptyList());
-    ASSERT(callType == CallTypeJS);
-    // FIXME: Can this be done more efficiently using the callData?
-    return asFunction(m_data.getterFunc)->call(exec, thisValue(), exec->emptyList());
+    ASSERT(m_thisValue);
+    return callGetter(exec, m_thisValue, m_data.getter.getterSetter);
 }
 
 } // namespace JSC