From 2cf6c8816a73e0132bd8fa3b509d62d7c51b6e47 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Mon, 7 May 2012 11:21:11 +0200 Subject: Imported WebKit commit 7e538425aa020340619e927792f3d895061fb54b (http://svn.webkit.org/repository/webkit/trunk@116286) --- Source/JavaScriptCore/runtime/JSFunction.h | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'Source/JavaScriptCore/runtime/JSFunction.h') diff --git a/Source/JavaScriptCore/runtime/JSFunction.h b/Source/JavaScriptCore/runtime/JSFunction.h index 288181060..5553115bf 100644 --- a/Source/JavaScriptCore/runtime/JSFunction.h +++ b/Source/JavaScriptCore/runtime/JSFunction.h @@ -24,6 +24,7 @@ #ifndef JSFunction_h #define JSFunction_h +#include "InternalFunction.h" #include "JSObject.h" namespace JSC { @@ -54,8 +55,7 @@ namespace JSC { public: typedef JSNonFinalObject Base; - JS_EXPORT_PRIVATE static JSFunction* create(ExecState*, JSGlobalObject*, int length, const Identifier& name, NativeFunction nativeFunction, NativeFunction nativeConstructor = callHostFunctionAsConstructor); - static JSFunction* create(ExecState*, JSGlobalObject*, int length, const Identifier& name, NativeExecutable* nativeExecutable); + JS_EXPORT_PRIVATE static JSFunction* create(ExecState*, JSGlobalObject*, int length, const Identifier& name, NativeFunction nativeFunction, Intrinsic = NoIntrinsic, NativeFunction nativeConstructor = callHostFunctionAsConstructor); static JSFunction* create(ExecState* exec, FunctionExecutable* executable, ScopeChainNode* scopeChain) { @@ -154,12 +154,9 @@ namespace JSC { WriteBarrier m_scopeChain; }; - JSFunction* asFunction(JSValue); - - inline JSFunction* asFunction(JSValue value) + inline bool JSValue::isFunction() const { - ASSERT(asObject(value)->inherits(&JSFunction::s_info)); - return static_cast(asObject(value)); + return isCell() && (asCell()->inherits(&JSFunction::s_info) || asCell()->inherits(&InternalFunction::s_info)); } } // namespace JSC -- cgit v1.2.1