[JSC] Align upon the name isCallable instead of isFunction
authorross.kirsling@sony.com <ross.kirsling@sony.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 28 Apr 2020 21:51:37 +0000 (21:51 +0000)
committerross.kirsling@sony.com <ross.kirsling@sony.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 28 Apr 2020 21:51:37 +0000 (21:51 +0000)
https://bugs.webkit.org/show_bug.cgi?id=211140

Reviewed by Darin Adler.

Source/JavaScriptCore:

Follow-up to r260722. Usage is now cleanly separated between isFunction / getCallData,
but the name isCallable is still clearer than isFunction so let's flip that after all.

* API/JSContextRef.cpp:
(JSGlobalContextSetUnhandledRejectionCallback):
* API/JSObjectRef.cpp:
(JSObjectIsFunction):
* dfg/DFGOperations.cpp:
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileCreateThis):
(JSC::FTL::DFG::LowerDFGToB3::compileCreatePromise):
(JSC::FTL::DFG::LowerDFGToB3::compileCreateInternalFieldObject):
(JSC::FTL::DFG::LowerDFGToB3::compileIsObjectOrNull):
(JSC::FTL::DFG::LowerDFGToB3::compileIsFunction):
(JSC::FTL::DFG::LowerDFGToB3::buildTypeOf):
(JSC::FTL::DFG::LowerDFGToB3::isCallable):
(JSC::FTL::DFG::LowerDFGToB3::isFunction): Deleted.
* ftl/FTLOperations.cpp:
(JSC::FTL::operationTypeOfObjectAsTypeofType):
* jsc.cpp:
(functionSetUnhandledRejectionCallback):
* runtime/CommonSlowPaths.cpp:
(JSC::SLOW_PATH_DECL):
* runtime/ExceptionHelpers.cpp:
(JSC::errorDescriptionForValue):
* runtime/FunctionPrototype.cpp:
(JSC::functionProtoFuncToString):
* runtime/InternalFunction.cpp:
(JSC::getFunctionRealm):
* runtime/JSCJSValue.h:
* runtime/JSCJSValueInlines.h:
(JSC::JSValue::isCallable const):
(JSC::JSValue::isFunction const): Deleted.
* runtime/JSCell.h:
* runtime/JSCellInlines.h:
(JSC::JSCell::isCallable):
(JSC::JSCell::isFunction): Deleted.
* runtime/JSONObject.cpp:
(JSC::Stringifier::appendStringifiedValue):
* runtime/ObjectConstructor.cpp:
(JSC::toPropertyDescriptor):
* runtime/ObjectPrototype.cpp:
(JSC::objectProtoFuncDefineGetter):
(JSC::objectProtoFuncDefineSetter):
* runtime/Operations.cpp:
(JSC::jsTypeStringForValue):
(JSC::jsIsObjectTypeOrNull):
* runtime/ProxyObject.cpp:
(JSC::ProxyObject::structureForTarget):
(JSC::ProxyObject::finishCreation):
* runtime/RuntimeType.cpp:
(JSC::runtimeTypeForValue):
* tools/JSDollarVM.cpp:
(JSC::functionCallWithStackSize):
(JSC::functionFindTypeForExpression):
(JSC::functionReturnTypeFor):
(JSC::functionHasBasicBlockExecuted):
(JSC::functionBasicBlockExecutionCount):
* wasm/WasmInstance.cpp:
(JSC::Wasm::Instance::setFunctionWrapper):
* wasm/WasmOperations.cpp:
(JSC::Wasm::operationIterateResults):
(JSC::Wasm::operationWasmRefFunc):
* wasm/js/WebAssemblyModuleRecord.cpp:
(JSC::WebAssemblyModuleRecord::link):
* wasm/js/WebAssemblyWrapperFunction.cpp:
(JSC::WebAssemblyWrapperFunction::finishCreation):

Source/WebCore:

* Modules/plugins/QuickTimePluginReplacement.mm:
(WebCore::QuickTimePluginReplacement::ensureReplacementScriptInjected):
* bindings/js/JSCustomElementRegistryCustom.cpp:
(WebCore::getCustomElementCallback):
* bindings/js/JSDOMConvertCallbacks.h:
(WebCore::Converter<IDLCallbackFunction<T>>::convert):
* bindings/js/JSDOMConvertScheduledAction.h:
(WebCore::Converter<IDLScheduledAction>::convert):
* bindings/js/JSDOMPromise.cpp:
(WebCore::DOMPromise::whenPromiseIsSettled):
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::queueMicrotask):
* bindings/js/JSWorkerGlobalScopeCustom.cpp:
(WebCore::JSWorkerGlobalScope::queueMicrotask):
* bindings/js/ReadableStream.cpp:
(WebCore::ReadableStream::pipeTo):
(WebCore::ReadableStream::tee):
* bindings/js/ReadableStreamDefaultController.cpp:
(WebCore::ReadableStreamDefaultController::invoke):
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::callInWorld):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateOverloadDispatcher):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::ensureMediaControlsInjectedScript):
* testing/Internals.cpp:
(WebCore::Internals::parserMetaData):
(WebCore::Internals::cloneArrayBuffer):
* worklets/PaintWorkletGlobalScope.cpp:
(WebCore::PaintWorkletGlobalScope::registerPaint):

Source/WebKit:

* WebProcess/Plugins/Netscape/NPJSObject.cpp:
(WebKit::NPJSObject::hasMethod):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@260848 268f45cc-cd09-0410-ab3c-d52691b4dbfc

43 files changed:
Source/JavaScriptCore/API/JSContextRef.cpp
Source/JavaScriptCore/API/JSObjectRef.cpp
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/dfg/DFGOperations.cpp
Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp
Source/JavaScriptCore/ftl/FTLOperations.cpp
Source/JavaScriptCore/jsc.cpp
Source/JavaScriptCore/runtime/CommonSlowPaths.cpp
Source/JavaScriptCore/runtime/ExceptionHelpers.cpp
Source/JavaScriptCore/runtime/FunctionPrototype.cpp
Source/JavaScriptCore/runtime/InternalFunction.cpp
Source/JavaScriptCore/runtime/JSCJSValue.h
Source/JavaScriptCore/runtime/JSCJSValueInlines.h
Source/JavaScriptCore/runtime/JSCell.h
Source/JavaScriptCore/runtime/JSCellInlines.h
Source/JavaScriptCore/runtime/JSONObject.cpp
Source/JavaScriptCore/runtime/ObjectConstructor.cpp
Source/JavaScriptCore/runtime/ObjectPrototype.cpp
Source/JavaScriptCore/runtime/Operations.cpp
Source/JavaScriptCore/runtime/ProxyObject.cpp
Source/JavaScriptCore/runtime/RuntimeType.cpp
Source/JavaScriptCore/tools/JSDollarVM.cpp
Source/JavaScriptCore/wasm/WasmInstance.cpp
Source/JavaScriptCore/wasm/WasmOperations.cpp
Source/JavaScriptCore/wasm/js/WebAssemblyModuleRecord.cpp
Source/JavaScriptCore/wasm/js/WebAssemblyWrapperFunction.cpp
Source/WebCore/ChangeLog
Source/WebCore/Modules/plugins/QuickTimePluginReplacement.mm
Source/WebCore/bindings/js/JSCustomElementRegistryCustom.cpp
Source/WebCore/bindings/js/JSDOMConvertCallbacks.h
Source/WebCore/bindings/js/JSDOMConvertScheduledAction.h
Source/WebCore/bindings/js/JSDOMPromise.cpp
Source/WebCore/bindings/js/JSDOMWindowCustom.cpp
Source/WebCore/bindings/js/JSWorkerGlobalScopeCustom.cpp
Source/WebCore/bindings/js/ReadableStream.cpp
Source/WebCore/bindings/js/ReadableStreamDefaultController.cpp
Source/WebCore/bindings/js/ScriptController.cpp
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/testing/Internals.cpp
Source/WebCore/worklets/PaintWorkletGlobalScope.cpp
Source/WebKit/ChangeLog
Source/WebKit/WebProcess/Plugins/Netscape/NPJSObject.cpp

index 2401791..d69c332 100644 (file)
@@ -262,7 +262,7 @@ void JSGlobalContextSetUnhandledRejectionCallback(JSGlobalContextRef ctx, JSObje
     JSLockHolder locker(vm);
 
     JSObject* object = toJS(function);
-    if (!object->isFunction(vm)) {
+    if (!object->isCallable(vm)) {
         *exception = toRef(createTypeError(globalObject));
         return;
     }
index ee9449f..f72b0aa 100644 (file)
@@ -706,7 +706,7 @@ bool JSObjectIsFunction(JSContextRef ctx, JSObjectRef object)
     VM& vm = globalObject->vm();
     JSLockHolder locker(vm);
     JSCell* cell = toJS(object);
-    return cell->isFunction(vm);
+    return cell->isCallable(vm);
 }
 
 JSValueRef JSObjectCallAsFunction(JSContextRef ctx, JSObjectRef object, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
index abe0275..07988ac 100644 (file)
@@ -1,3 +1,78 @@
+2020-04-28  Ross Kirsling  <ross.kirsling@sony.com>
+
+        [JSC] Align upon the name isCallable instead of isFunction
+        https://bugs.webkit.org/show_bug.cgi?id=211140
+
+        Reviewed by Darin Adler.
+
+        Follow-up to r260722. Usage is now cleanly separated between isFunction / getCallData,
+        but the name isCallable is still clearer than isFunction so let's flip that after all.
+
+        * API/JSContextRef.cpp:
+        (JSGlobalContextSetUnhandledRejectionCallback):
+        * API/JSObjectRef.cpp:
+        (JSObjectIsFunction):
+        * dfg/DFGOperations.cpp:
+        * ftl/FTLLowerDFGToB3.cpp:
+        (JSC::FTL::DFG::LowerDFGToB3::compileCreateThis):
+        (JSC::FTL::DFG::LowerDFGToB3::compileCreatePromise):
+        (JSC::FTL::DFG::LowerDFGToB3::compileCreateInternalFieldObject):
+        (JSC::FTL::DFG::LowerDFGToB3::compileIsObjectOrNull):
+        (JSC::FTL::DFG::LowerDFGToB3::compileIsFunction):
+        (JSC::FTL::DFG::LowerDFGToB3::buildTypeOf):
+        (JSC::FTL::DFG::LowerDFGToB3::isCallable):
+        (JSC::FTL::DFG::LowerDFGToB3::isFunction): Deleted.
+        * ftl/FTLOperations.cpp:
+        (JSC::FTL::operationTypeOfObjectAsTypeofType):
+        * jsc.cpp:
+        (functionSetUnhandledRejectionCallback):
+        * runtime/CommonSlowPaths.cpp:
+        (JSC::SLOW_PATH_DECL):
+        * runtime/ExceptionHelpers.cpp:
+        (JSC::errorDescriptionForValue):
+        * runtime/FunctionPrototype.cpp:
+        (JSC::functionProtoFuncToString):
+        * runtime/InternalFunction.cpp:
+        (JSC::getFunctionRealm):
+        * runtime/JSCJSValue.h:
+        * runtime/JSCJSValueInlines.h:
+        (JSC::JSValue::isCallable const):
+        (JSC::JSValue::isFunction const): Deleted.
+        * runtime/JSCell.h:
+        * runtime/JSCellInlines.h:
+        (JSC::JSCell::isCallable):
+        (JSC::JSCell::isFunction): Deleted.
+        * runtime/JSONObject.cpp:
+        (JSC::Stringifier::appendStringifiedValue):
+        * runtime/ObjectConstructor.cpp:
+        (JSC::toPropertyDescriptor):
+        * runtime/ObjectPrototype.cpp:
+        (JSC::objectProtoFuncDefineGetter):
+        (JSC::objectProtoFuncDefineSetter):
+        * runtime/Operations.cpp:
+        (JSC::jsTypeStringForValue):
+        (JSC::jsIsObjectTypeOrNull):
+        * runtime/ProxyObject.cpp:
+        (JSC::ProxyObject::structureForTarget):
+        (JSC::ProxyObject::finishCreation):
+        * runtime/RuntimeType.cpp:
+        (JSC::runtimeTypeForValue):
+        * tools/JSDollarVM.cpp:
+        (JSC::functionCallWithStackSize):
+        (JSC::functionFindTypeForExpression):
+        (JSC::functionReturnTypeFor):
+        (JSC::functionHasBasicBlockExecuted):
+        (JSC::functionBasicBlockExecutionCount):
+        * wasm/WasmInstance.cpp:
+        (JSC::Wasm::Instance::setFunctionWrapper):
+        * wasm/WasmOperations.cpp:
+        (JSC::Wasm::operationIterateResults):
+        (JSC::Wasm::operationWasmRefFunc):
+        * wasm/js/WebAssemblyModuleRecord.cpp:
+        (JSC::WebAssemblyModuleRecord::link):
+        * wasm/js/WebAssemblyWrapperFunction.cpp:
+        (JSC::WebAssemblyWrapperFunction::finishCreation):
+
 2020-04-28  Yusuke Suzuki  <ysuzuki@apple.com>
 
         [JSC] NumberConstructor should accept BigInt
index a47df28..06661fb 100644 (file)
@@ -2143,7 +2143,7 @@ size_t JIT_OPERATION operationObjectIsObject(JSGlobalObject* globalObject, JSCel
     
     if (object->structure(vm)->masqueradesAsUndefined(globalObject))
         return false;
-    if (object->isFunction(vm))
+    if (object->isCallable(vm))
         return false;
     return true;
 }
@@ -2158,7 +2158,7 @@ size_t JIT_OPERATION operationObjectIsFunction(JSGlobalObject* globalObject, JSC
     
     if (object->structure(vm)->masqueradesAsUndefined(globalObject))
         return false;
-    if (object->isFunction(vm))
+    if (object->isCallable(vm))
         return true;
     return false;
 }
@@ -2173,7 +2173,7 @@ JSCell* JIT_OPERATION operationTypeOfObject(JSGlobalObject* globalObject, JSCell
     
     if (object->structure(vm)->masqueradesAsUndefined(globalObject))
         return vm.smallStrings.undefinedString();
-    if (object->isFunction(vm))
+    if (object->isCallable(vm))
         return vm.smallStrings.functionString();
     return vm.smallStrings.objectString();
 }
index a1a16fb..1aa98a3 100644 (file)
@@ -6972,7 +6972,7 @@ private:
         LBasicBlock slowPath = m_out.newBlock();
         LBasicBlock continuation = m_out.newBlock();
 
-        m_out.branch(isFunction(callee, provenType(m_node->child1())), usually(isFunctionBlock), rarely(slowPath));
+        m_out.branch(isCallable(callee, provenType(m_node->child1())), usually(isFunctionBlock), rarely(slowPath));
 
         LBasicBlock lastNext = m_out.appendTo(isFunctionBlock, hasRareData);
         LValue rareDataTags = m_out.loadPtr(callee, m_heaps.JSFunction_executableOrRareData);
@@ -7017,7 +7017,7 @@ private:
         m_out.branch(m_out.equal(callee, weakPointer(m_node->isInternalPromise() ? globalObject->internalPromiseConstructor() : globalObject->promiseConstructor())), unsure(fastAllocationCase), unsure(derivedCase));
 
         LBasicBlock lastNext = m_out.appendTo(derivedCase, isFunctionBlock);
-        m_out.branch(isFunction(callee, provenType(m_node->child1())), usually(isFunctionBlock), rarely(slowCase));
+        m_out.branch(isCallable(callee, provenType(m_node->child1())), usually(isFunctionBlock), rarely(slowCase));
 
         m_out.appendTo(isFunctionBlock, hasRareData);
         LValue rareDataTags = m_out.loadPtr(callee, m_heaps.JSFunction_executableOrRareData);
@@ -7072,7 +7072,7 @@ private:
         LBasicBlock slowCase = m_out.newBlock();
         LBasicBlock continuation = m_out.newBlock();
 
-        m_out.branch(isFunction(callee, provenType(m_node->child1())), usually(isFunctionBlock), rarely(slowCase));
+        m_out.branch(isCallable(callee, provenType(m_node->child1())), usually(isFunctionBlock), rarely(slowCase));
 
         LBasicBlock lastNext = m_out.appendTo(isFunctionBlock, hasRareData);
         LValue rareDataTags = m_out.loadPtr(callee, m_heaps.JSFunction_executableOrRareData);
@@ -11568,7 +11568,7 @@ private:
         LBasicBlock lastNext = m_out.appendTo(cellCase, notFunctionCase);
         ValueFromBlock isFunctionResult = m_out.anchor(m_out.booleanFalse);
         m_out.branch(
-            isFunction(value, provenType(child)),
+            isCallable(value, provenType(child)),
             unsure(continuation), unsure(notFunctionCase));
         
         m_out.appendTo(notFunctionCase, objectCase);
@@ -11625,7 +11625,7 @@ private:
         LBasicBlock lastNext = m_out.appendTo(cellCase, notFunctionCase);
         ValueFromBlock functionResult = m_out.anchor(m_out.booleanTrue);
         m_out.branch(
-            isFunction(value, provenType(child)),
+            isCallable(value, provenType(child)),
             unsure(continuation), unsure(notFunctionCase));
         
         m_out.appendTo(notFunctionCase, slowPath);
@@ -16194,7 +16194,7 @@ private:
         
         m_out.appendTo(objectCase, functionCase);
         m_out.branch(
-            isFunction(value, provenType(child) & SpecObject),
+            isCallable(value, provenType(child) & SpecObject),
             unsure(functionCase), unsure(notFunctionCase));
         
         m_out.appendTo(functionCase, notFunctionCase);
@@ -17899,7 +17899,7 @@ private:
         }
     }
     
-    LValue isFunction(LValue cell, SpeculatedType type = SpecFullTop)
+    LValue isCallable(LValue cell, SpeculatedType type = SpecFullTop)
     {
         if (LValue proven = isProvenValue(type & SpecCell, SpecFunction))
             return proven;
index b339379..933e473 100644 (file)
@@ -721,7 +721,7 @@ extern "C" int32_t JIT_OPERATION operationTypeOfObjectAsTypeofType(JSGlobalObjec
 
     if (object->structure(vm)->masqueradesAsUndefined(globalObject))
         return static_cast<int32_t>(TypeofType::Undefined);
-    if (object->isFunction(vm))
+    if (object->isCallable(vm))
         return static_cast<int32_t>(TypeofType::Function);
     return static_cast<int32_t>(TypeofType::Object);
 }
index 1e15b34..47d21d5 100644 (file)
@@ -2485,7 +2485,7 @@ EncodedJSValue JSC_HOST_CALL functionSetUnhandledRejectionCallback(JSGlobalObjec
     JSObject* object = callFrame->argument(0).getObject();
     auto scope = DECLARE_THROW_SCOPE(vm);
 
-    if (!object || !object->isFunction(vm))
+    if (!object || !object->isCallable(vm))
         return throwVMTypeError(globalObject, scope);
 
     globalObject->setUnhandledRejectionCallback(vm, object);
index 7178c9a..b7b8020 100644 (file)
@@ -832,7 +832,7 @@ SLOW_PATH_DECL(slow_path_is_function)
 {
     BEGIN();
     auto bytecode = pc->as<OpIsFunction>();
-    RETURN(jsBoolean(GET_C(bytecode.m_operand).jsValue().isFunction(vm)));
+    RETURN(jsBoolean(GET_C(bytecode.m_operand).jsValue().isCallable(vm)));
 }
 
 SLOW_PATH_DECL(slow_path_in_by_val)
index c7bbf63..5fff704 100644 (file)
@@ -95,7 +95,7 @@ String errorDescriptionForValue(JSGlobalObject* globalObject, JSValue v)
     if (v.isObject()) {
         VM& vm = globalObject->vm();
         JSObject* object = asObject(v);
-        if (object->isFunction(vm))
+        if (object->isCallable(vm))
             return vm.smallStrings.functionString()->value(globalObject);
         return JSObject::calculatedClassName(object);
     }
index 2c9160e..b39a536 100644 (file)
@@ -149,7 +149,7 @@ EncodedJSValue JSC_HOST_CALL functionProtoFuncToString(JSGlobalObject* globalObj
     if (thisValue.isObject()) {
         JSObject* object = asObject(thisValue);
         Integrity::auditStructureID(vm, object->structureID());
-        if (object->isFunction(vm))
+        if (object->isCallable(vm))
             RELEASE_AND_RETURN(scope, JSValue::encode(jsMakeNontrivialString(globalObject, "function ", object->classInfo(vm)->className, "() {\n    [native code]\n}")));
     }
 
index f84c573..6c3d928 100644 (file)
@@ -157,7 +157,7 @@ Structure* InternalFunction::createSubclassStructure(JSGlobalObject* globalObjec
 // https://tc39.es/ecma262/#sec-getfunctionrealm
 JSGlobalObject* getFunctionRealm(VM& vm, JSObject* object)
 {
-    ASSERT(object->isFunction(vm));
+    ASSERT(object->isCallable(vm));
 
     if (object->inherits<JSBoundFunction>(vm))
         return getFunctionRealm(vm, jsCast<JSBoundFunction*>(object)->targetFunction());
index 5d747ee..7e31759 100644 (file)
@@ -230,7 +230,7 @@ public:
 
     // Querying the type.
     bool isEmpty() const;
-    bool isFunction(VM&) const;
+    bool isCallable(VM&) const;
     bool isConstructor(VM&) const;
     bool isUndefined() const;
     bool isNull() const;
index 059e626..b091162 100644 (file)
@@ -887,18 +887,14 @@ inline JSObject* JSValue::toObject(JSGlobalObject* globalObject) const
     return isCell() ? asCell()->toObject(globalObject) : toObjectSlowCase(globalObject);
 }
 
-inline bool JSValue::isFunction(VM& vm) const
+inline bool JSValue::isCallable(VM& vm) const
 {
-    if (!isCell())
-        return false;
-    return asCell()->isFunction(vm);
+    return isCell() && asCell()->isCallable(vm);
 }
 
 inline bool JSValue::isConstructor(VM& vm) const
 {
-    if (!isCell())
-        return false;
-    return asCell()->isConstructor(vm);
+    return isCell() && asCell()->isConstructor(vm);
 }
 
 // this method is here to be after the inline declaration of JSCell::inherits
index b8d6f65..c61580c 100644 (file)
@@ -107,7 +107,7 @@ public:
     bool isGetterSetter() const;
     bool isCustomGetterSetter() const;
     bool isProxy() const;
-    bool isFunction(VM&);
+    bool isCallable(VM&);
     bool isConstructor(VM&);
     bool inherits(VM&, const ClassInfo*) const;
     template<typename Target> bool inherits(VM&) const;
index f260730..0dea275 100644 (file)
@@ -229,7 +229,7 @@ inline bool JSCell::isProxy() const
     return m_type == ImpureProxyType || m_type == PureForwardingProxyType || m_type == ProxyObjectType;
 }
 
-ALWAYS_INLINE bool JSCell::isFunction(VM& vm)
+ALWAYS_INLINE bool JSCell::isCallable(VM& vm)
 {
     if (type() == JSFunctionType)
         return true;
index dbd7b2e..bcaa7ab 100644 (file)
@@ -384,7 +384,7 @@ Stringifier::StringifyResult Stringifier::appendStringifiedValue(StringBuilder&
         return StringifyFailed;
 
     JSObject* object = asObject(value);
-    if (object->isFunction(vm)) {
+    if (object->isCallable(vm)) {
         if (holder.isArray()) {
             builder.appendLiteral("null");
             return StringifySucceeded;
index 009aeff..3c685e6 100644 (file)
@@ -532,7 +532,7 @@ bool toPropertyDescriptor(JSGlobalObject* globalObject, JSValue in, PropertyDesc
     if (hasProperty) {
         JSValue get = description->get(globalObject, vm.propertyNames->get);
         RETURN_IF_EXCEPTION(scope, false);
-        if (!get.isUndefined() && !get.isFunction(vm)) {
+        if (!get.isUndefined() && !get.isCallable(vm)) {
             throwTypeError(globalObject, scope, "Getter must be a function."_s);
             return false;
         }
@@ -545,7 +545,7 @@ bool toPropertyDescriptor(JSGlobalObject* globalObject, JSValue in, PropertyDesc
     if (hasProperty) {
         JSValue set = description->get(globalObject, vm.propertyNames->set);
         RETURN_IF_EXCEPTION(scope, false);
-        if (!set.isUndefined() && !set.isFunction(vm)) {
+        if (!set.isUndefined() && !set.isCallable(vm)) {
             throwTypeError(globalObject, scope, "Setter must be a function."_s);
             return false;
         }
index 6fd67df..c61a5ac 100644 (file)
@@ -154,7 +154,7 @@ EncodedJSValue JSC_HOST_CALL objectProtoFuncDefineGetter(JSGlobalObject* globalO
     RETURN_IF_EXCEPTION(scope, encodedJSValue());
 
     JSValue get = callFrame->argument(1);
-    if (!get.isFunction(vm))
+    if (!get.isCallable(vm))
         return throwVMTypeError(globalObject, scope, "invalid getter usage"_s);
 
     auto propertyName = callFrame->argument(0).toPropertyKey(globalObject);
@@ -181,7 +181,7 @@ EncodedJSValue JSC_HOST_CALL objectProtoFuncDefineSetter(JSGlobalObject* globalO
     RETURN_IF_EXCEPTION(scope, encodedJSValue());
 
     JSValue set = callFrame->argument(1);
-    if (!set.isFunction(vm))
+    if (!set.isCallable(vm))
         return throwVMTypeError(globalObject, scope, "invalid setter usage"_s);
 
     auto propertyName = callFrame->argument(0).toPropertyKey(globalObject);
index eac5d3a..dfd9c71 100644 (file)
@@ -99,7 +99,7 @@ JSValue jsTypeStringForValue(VM& vm, JSGlobalObject* globalObject, JSValue v)
         // as null when doing comparisons.
         if (object->structure(vm)->masqueradesAsUndefined(globalObject))
             return vm.smallStrings.undefinedString();
-        if (object->isFunction(vm))
+        if (object->isCallable(vm))
             return vm.smallStrings.functionString();
     }
     return vm.smallStrings.objectString();
@@ -123,7 +123,7 @@ bool jsIsObjectTypeOrNull(JSGlobalObject* globalObject, JSValue v)
         if (asObject(v)->structure(vm)->masqueradesAsUndefined(globalObject))
             return false;
         JSObject* object = asObject(v);
-        if (object->isFunction(vm))
+        if (object->isCallable(vm))
             return false;
     }
     return true;
index da70bd3..0e697bb 100644 (file)
@@ -72,7 +72,7 @@ String ProxyObject::toStringName(const JSObject* object, JSGlobalObject* globalO
 Structure* ProxyObject::structureForTarget(JSGlobalObject* globalObject, JSValue target)
 {
     VM& vm = globalObject->vm();
-    return target.isFunction(vm) ? globalObject->callableProxyObjectStructure() : globalObject->proxyObjectStructure();
+    return target.isCallable(vm) ? globalObject->callableProxyObjectStructure() : globalObject->proxyObjectStructure();
 }
 
 void ProxyObject::finishCreation(VM& vm, JSGlobalObject* globalObject, JSValue target, JSValue handler)
@@ -91,7 +91,7 @@ void ProxyObject::finishCreation(VM& vm, JSGlobalObject* globalObject, JSValue t
 
     JSObject* targetAsObject = jsCast<JSObject*>(target);
 
-    m_isCallable = targetAsObject->isFunction(vm);
+    m_isCallable = targetAsObject->isCallable(vm);
     if (m_isCallable) {
         TypeInfo info = structure(vm)->typeInfo();
         RELEASE_ASSERT(info.implementsHasInstance() && info.implementsDefaultHasInstance());
index 7328765..d9eac8b 100644 (file)
@@ -51,7 +51,7 @@ RuntimeType runtimeTypeForValue(VM& vm, JSValue value)
         return TypeBoolean;
     if (value.isObject())
         return TypeObject;
-    if (value.isFunction(vm))
+    if (value.isCallable(vm))
         return TypeFunction;
     if (value.isSymbol())
         return TypeSymbol;
index 4f1a3ba..322294a 100644 (file)
@@ -2178,7 +2178,7 @@ static EncodedJSValue JSC_HOST_CALL functionCallWithStackSize(JSGlobalObject* gl
         return throwVMError(globalObject, throwScope, "Invalid number of arguments");
     JSValue arg0 = callFrame->argument(0);
     JSValue arg1 = callFrame->argument(1);
-    if (!arg0.isFunction(vm))
+    if (!arg0.isCallable(vm))
         return throwVMError(globalObject, throwScope, "arg0 should be a function");
     if (!arg1.isNumber())
         return throwVMError(globalObject, throwScope, "arg1 should be a number");
@@ -2591,7 +2591,7 @@ static EncodedJSValue JSC_HOST_CALL functionFindTypeForExpression(JSGlobalObject
     vm.typeProfilerLog()->processLogEntries(vm, "jsc Testing API: functionFindTypeForExpression"_s);
 
     JSValue functionValue = callFrame->argument(0);
-    RELEASE_ASSERT(functionValue.isFunction(vm));
+    RELEASE_ASSERT(functionValue.isCallable(vm));
     FunctionExecutable* executable = (jsDynamicCast<JSFunction*>(vm, functionValue.asCell()->getObject()))->jsExecutable();
 
     RELEASE_ASSERT(callFrame->argument(1).isString());
@@ -2611,7 +2611,7 @@ static EncodedJSValue JSC_HOST_CALL functionReturnTypeFor(JSGlobalObject* global
     vm.typeProfilerLog()->processLogEntries(vm, "jsc Testing API: functionReturnTypeFor"_s);
 
     JSValue functionValue = callFrame->argument(0);
-    RELEASE_ASSERT(functionValue.isFunction(vm));
+    RELEASE_ASSERT(functionValue.isCallable(vm));
     FunctionExecutable* executable = (jsDynamicCast<JSFunction*>(vm, functionValue.asCell()->getObject()))->jsExecutable();
 
     unsigned offset = executable->typeProfilingStartOffset(vm);
@@ -2645,7 +2645,7 @@ static EncodedJSValue JSC_HOST_CALL functionHasBasicBlockExecuted(JSGlobalObject
     RELEASE_ASSERT(vm.controlFlowProfiler());
 
     JSValue functionValue = callFrame->argument(0);
-    RELEASE_ASSERT(functionValue.isFunction(vm));
+    RELEASE_ASSERT(functionValue.isCallable(vm));
     FunctionExecutable* executable = (jsDynamicCast<JSFunction*>(vm, functionValue.asCell()->getObject()))->jsExecutable();
 
     RELEASE_ASSERT(callFrame->argument(1).isString());
@@ -2665,7 +2665,7 @@ static EncodedJSValue JSC_HOST_CALL functionBasicBlockExecutionCount(JSGlobalObj
     RELEASE_ASSERT(vm.controlFlowProfiler());
 
     JSValue functionValue = callFrame->argument(0);
-    RELEASE_ASSERT(functionValue.isFunction(vm));
+    RELEASE_ASSERT(functionValue.isCallable(vm));
     FunctionExecutable* executable = (jsDynamicCast<JSFunction*>(vm, functionValue.asCell()->getObject()))->jsExecutable();
 
     RELEASE_ASSERT(callFrame->argument(1).isString());
index a6ed9c0..95b892b 100644 (file)
@@ -108,7 +108,7 @@ JSValue Instance::getFunctionWrapper(unsigned i) const
 void Instance::setFunctionWrapper(unsigned i, JSValue value)
 {
     ASSERT(m_owner);
-    ASSERT(value.isFunction(owner<JSWebAssemblyInstance>()->vm()));
+    ASSERT(value.isCallable(owner<JSWebAssemblyInstance>()->vm()));
     ASSERT(!m_functionWrappers.contains(i));
     auto locker = holdLock(owner<JSWebAssemblyInstance>()->cellLock());
     m_functionWrappers.set(i, WriteBarrier<Unknown>(owner<JSWebAssemblyInstance>()->vm(), owner<JSWebAssemblyInstance>(), value));
index 5f499ff..5d04ea7 100644 (file)
@@ -539,7 +539,7 @@ void JIT_OPERATION operationIterateResults(CallFrame* callFrame, Instance* insta
                 unboxedValue = bitwise_cast<uint64_t>(value.toNumber(globalObject));
                 break;
             case Funcref:
-                if (!value.isFunction(vm)) {
+                if (!value.isCallable(vm)) {
                     throwTypeError(globalObject, scope, "Funcref value is not a function"_s);
                     return;
                 }
@@ -728,7 +728,7 @@ bool JIT_OPERATION operationWasmTableFill(Instance* instance, unsigned tableInde
 EncodedJSValue JIT_OPERATION operationWasmRefFunc(Instance* instance, uint32_t index)
 {
     JSValue value = instance->getFunctionWrapper(index);
-    ASSERT(value.isFunction(instance->owner<JSObject>()->vm()));
+    ASSERT(value.isCallable(instance->owner<JSObject>()->vm()));
     return JSValue::encode(value);
 }
 
index dbc8dfb..bbd10e4 100644 (file)
@@ -188,7 +188,7 @@ void WebAssemblyModuleRecord::link(JSGlobalObject* globalObject, JSValue, JSObje
         case Wasm::ExternalKind::Function: {
             // 4. If i is a function import:
             // i. If IsCallable(v) is false, throw a WebAssembly.LinkError.
-            if (!value.isFunction(vm))
+            if (!value.isCallable(vm))
                 return exception(createJSWebAssemblyLinkError(globalObject, vm, importFailMessage(import, "import function", "must be callable")));
 
             Wasm::Instance* calleeInstance = nullptr;
@@ -392,7 +392,7 @@ void WebAssemblyModuleRecord::link(JSGlobalObject* globalObject, JSValue, JSObje
             wrapper = function;
         }
 
-        ASSERT(wrapper.isFunction(vm));
+        ASSERT(wrapper.isCallable(vm));
         m_instance->instance().setFunctionWrapper(index, wrapper);
 
         return wrapper;
@@ -412,7 +412,7 @@ void WebAssemblyModuleRecord::link(JSGlobalObject* globalObject, JSValue, JSObje
                 initialBits = m_instance->instance().loadI64Global(global.initialBitsOrImportNumber);
             } else if (global.initializationType == Wasm::GlobalInformation::FromRefFunc) {
                 ASSERT(global.initialBitsOrImportNumber < moduleInformation.functionIndexSpaceSize());
-                ASSERT(makeFunctionWrapper("Global init expr", global.initialBitsOrImportNumber).isFunction(vm));
+                ASSERT(makeFunctionWrapper("Global init expr", global.initialBitsOrImportNumber).isCallable(vm));
                 initialBits = JSValue::encode(makeFunctionWrapper("Global init expr", global.initialBitsOrImportNumber));
             } else
                 initialBits = global.initialBitsOrImportNumber;
@@ -444,7 +444,7 @@ void WebAssemblyModuleRecord::link(JSGlobalObject* globalObject, JSValue, JSObje
         switch (exp.kind) {
         case Wasm::ExternalKind::Function: {
             exportedValue = makeFunctionWrapper(String::fromUTF8(exp.field), exp.kindIndex);
-            ASSERT(exportedValue.isFunction(vm));
+            ASSERT(exportedValue.isCallable(vm));
             ASSERT(makeFunctionWrapper(String::fromUTF8(exp.field), exp.kindIndex) == exportedValue);
             break;
         }
index 9568e66..aeb16f6 100644 (file)
@@ -68,7 +68,7 @@ WebAssemblyWrapperFunction* WebAssemblyWrapperFunction::create(VM& vm, JSGlobalO
 void WebAssemblyWrapperFunction::finishCreation(VM& vm, NativeExecutable* executable, unsigned length, const String& name, JSObject* function, JSWebAssemblyInstance* instance)
 {
     Base::finishCreation(vm, executable, length, name, instance);
-    RELEASE_ASSERT(JSValue(function).isFunction(vm));
+    RELEASE_ASSERT(JSValue(function).isCallable(vm));
     m_function.set(vm, this, function);
 }
 
index bf74b36..d0a8c15 100644 (file)
@@ -1,3 +1,41 @@
+2020-04-28  Ross Kirsling  <ross.kirsling@sony.com>
+
+        [JSC] Align upon the name isCallable instead of isFunction
+        https://bugs.webkit.org/show_bug.cgi?id=211140
+
+        Reviewed by Darin Adler.
+
+        * Modules/plugins/QuickTimePluginReplacement.mm:
+        (WebCore::QuickTimePluginReplacement::ensureReplacementScriptInjected):
+        * bindings/js/JSCustomElementRegistryCustom.cpp:
+        (WebCore::getCustomElementCallback):
+        * bindings/js/JSDOMConvertCallbacks.h:
+        (WebCore::Converter<IDLCallbackFunction<T>>::convert):
+        * bindings/js/JSDOMConvertScheduledAction.h:
+        (WebCore::Converter<IDLScheduledAction>::convert):
+        * bindings/js/JSDOMPromise.cpp:
+        (WebCore::DOMPromise::whenPromiseIsSettled):
+        * bindings/js/JSDOMWindowCustom.cpp:
+        (WebCore::JSDOMWindow::queueMicrotask):
+        * bindings/js/JSWorkerGlobalScopeCustom.cpp:
+        (WebCore::JSWorkerGlobalScope::queueMicrotask):
+        * bindings/js/ReadableStream.cpp:
+        (WebCore::ReadableStream::pipeTo):
+        (WebCore::ReadableStream::tee):
+        * bindings/js/ReadableStreamDefaultController.cpp:
+        (WebCore::ReadableStreamDefaultController::invoke):
+        * bindings/js/ScriptController.cpp:
+        (WebCore::ScriptController::callInWorld):
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (GenerateOverloadDispatcher):
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::ensureMediaControlsInjectedScript):
+        * testing/Internals.cpp:
+        (WebCore::Internals::parserMetaData):
+        (WebCore::Internals::cloneArrayBuffer):
+        * worklets/PaintWorkletGlobalScope.cpp:
+        (WebCore::PaintWorkletGlobalScope::registerPaint):
+
 2020-04-28  Simon Fraser  <simon.fraser@apple.com>
 
         Rewrite GraphicsLayerCA::updateSublayerList()
index 8974e6a..16e2f23 100644 (file)
@@ -153,7 +153,7 @@ bool QuickTimePluginReplacement::ensureReplacementScriptInjected()
     JSC::JSGlobalObject* lexicalGlobalObject = globalObject;
     
     JSC::JSValue replacementFunction = globalObject->get(lexicalGlobalObject, JSC::Identifier::fromString(vm, "createPluginReplacement"));
-    if (replacementFunction.isFunction(vm))
+    if (replacementFunction.isCallable(vm))
         return true;
     
     scriptController.evaluateInWorldIgnoringException(ScriptSourceCode(quickTimePluginReplacementScript()), world);
index 9342acb..0935dd8 100644 (file)
@@ -49,7 +49,7 @@ static JSObject* getCustomElementCallback(JSGlobalObject& lexicalGlobalObject, J
     RETURN_IF_EXCEPTION(scope, nullptr);
     if (callback.isUndefined())
         return nullptr;
-    if (!callback.isFunction(vm)) {
+    if (!callback.isCallable(vm)) {
         throwTypeError(&lexicalGlobalObject, scope, "A custom element callback must be a function"_s);
         return nullptr;
     }
index a54a4b3..e6ca2af 100644 (file)
@@ -40,7 +40,7 @@ template<typename T> struct Converter<IDLCallbackFunction<T>> : DefaultConverter
         JSC::VM& vm = JSC::getVM(&lexicalGlobalObject);
         auto scope = DECLARE_THROW_SCOPE(vm);
 
-        if (!value.isFunction(vm)) {
+        if (!value.isCallable(vm)) {
             exceptionThrower(lexicalGlobalObject, scope);
             return nullptr;
         }
index 2c9d557..85a7fd6 100644 (file)
@@ -38,7 +38,7 @@ template<> struct Converter<IDLScheduledAction> : DefaultConverter<IDLScheduledA
         JSC::VM& vm = JSC::getVM(&lexicalGlobalObject);
         auto scope = DECLARE_THROW_SCOPE(vm);
 
-        if (!value.isFunction(vm)) {
+        if (!value.isCallable(vm)) {
             auto code = Converter<IDLDOMString>::convert(lexicalGlobalObject, value);
             RETURN_IF_EXCEPTION(scope, nullptr);
             return ScheduledAction::create(globalObject.world(), WTFMove(code));
index e85d75b..377d92e 100644 (file)
@@ -61,7 +61,7 @@ void DOMPromise::whenPromiseIsSettled(JSDOMGlobalObject* globalObject, JSC::JSOb
     if (scope.exception())
         return;
 
-    ASSERT(thenFunction.isFunction(vm));
+    ASSERT(thenFunction.isCallable(vm));
 
     JSC::MarkedArgumentBuffer arguments;
     arguments.append(handler);
index dcc374f..4665bce 100644 (file)
@@ -540,7 +540,7 @@ JSValue JSDOMWindow::queueMicrotask(JSGlobalObject& lexicalGlobalObject, CallFra
         return throwException(&lexicalGlobalObject, scope, createNotEnoughArgumentsError(&lexicalGlobalObject));
 
     JSValue functionValue = callFrame.uncheckedArgument(0);
-    if (UNLIKELY(!functionValue.isFunction(vm)))
+    if (UNLIKELY(!functionValue.isCallable(vm)))
         return JSValue::decode(throwArgumentMustBeFunctionError(lexicalGlobalObject, scope, 0, "callback", "Window", "queueMicrotask"));
 
     scope.release();
index b2d429c..25ff6e8 100644 (file)
@@ -57,7 +57,7 @@ JSValue JSWorkerGlobalScope::queueMicrotask(JSGlobalObject& lexicalGlobalObject,
         return throwException(&lexicalGlobalObject, scope, createNotEnoughArgumentsError(&lexicalGlobalObject));
 
     JSValue functionValue = callFrame.uncheckedArgument(0);
-    if (UNLIKELY(!functionValue.isFunction(vm)))
+    if (UNLIKELY(!functionValue.isCallable(vm)))
         return JSValue::decode(throwArgumentMustBeFunctionError(lexicalGlobalObject, scope, 0, "callback", "WorkerGlobalScope", "queueMicrotask"));
 
     scope.release();
index 57eeb57..11bbab6 100644 (file)
@@ -78,7 +78,7 @@ void ReadableStream::pipeTo(ReadableStreamSink& sink)
     const Identifier& privateName = clientData->builtinFunctions().readableStreamInternalsBuiltins().readableStreamPipeToPrivateName();
 
     auto readableStreamPipeTo = m_globalObject->get(&lexicalGlobalObject, privateName);
-    ASSERT(readableStreamPipeTo.isFunction(lexicalGlobalObject.vm()));
+    ASSERT(readableStreamPipeTo.isCallable(lexicalGlobalObject.vm()));
 
     MarkedArgumentBuffer arguments;
     arguments.append(readableStream());
@@ -94,7 +94,7 @@ std::pair<Ref<ReadableStream>, Ref<ReadableStream>> ReadableStream::tee()
     const Identifier& privateName = clientData->builtinFunctions().readableStreamInternalsBuiltins().readableStreamTeePrivateName();
 
     auto readableStreamTee = m_globalObject->get(&lexicalGlobalObject, privateName);
-    ASSERT(readableStreamTee.isFunction(lexicalGlobalObject.vm()));
+    ASSERT(readableStreamTee.isCallable(lexicalGlobalObject.vm()));
 
     MarkedArgumentBuffer arguments;
     arguments.append(readableStream());
index d99be89..902e661 100644 (file)
@@ -56,7 +56,7 @@ JSC::JSValue ReadableStreamDefaultController::invoke(JSC::JSGlobalObject& lexica
     auto function = object.get(&lexicalGlobalObject, JSC::Identifier::fromString(vm, propertyName));
     RETURN_IF_EXCEPTION(scope, JSC::JSValue());
 
-    if (!function.isFunction(vm)) {
+    if (!function.isCallable(vm)) {
         if (!function.isUndefined())
             throwTypeError(&lexicalGlobalObject, scope, "ReadableStream trying to call a property that is not callable"_s);
         return JSC::jsUndefined();
index 11789a9..ae2885c 100644 (file)
@@ -659,7 +659,7 @@ ValueOrException ScriptController::callInWorld(RunJavaScriptParameters&& paramet
         if (evaluationException)
             break;
 
-        if (!functionObject || !functionObject.isFunction(world.vm())) {
+        if (!functionObject || !functionObject.isCallable(world.vm())) {
             optionalDetails = { { "Unable to create JavaScript async function to call"_s } };
             break;
         }
index 654e783..4daf948 100644 (file)
@@ -3513,7 +3513,7 @@ sub GenerateOverloadDispatcher
             &$generateOverloadCallIfNecessary($overload, "distinguishingArg.isObject() && asObject(distinguishingArg)->type() == ErrorInstanceType");
 
             $overload = GetOverloadThatMatches($S, $d, \&$isObjectOrCallbackFunctionParameter);
-            &$generateOverloadCallIfNecessary($overload, "distinguishingArg.isFunction(vm)");
+            &$generateOverloadCallIfNecessary($overload, "distinguishingArg.isCallable(vm)");
 
             # FIXME: Avoid invoking GetMethod(object, Symbol.iterator) again in convert<IDLSequence<T>>(...).
             $overload = GetOverloadThatMatches($S, $d, \&$isSequenceOrFrozenArrayParameter);
index 69b4bf1..4c88d59 100644 (file)
@@ -7147,7 +7147,7 @@ bool HTMLMediaElement::ensureMediaControlsInjectedScript()
         auto scope = DECLARE_CATCH_SCOPE(vm);
 
         auto functionValue = globalObject.get(&lexicalGlobalObject, JSC::Identifier::fromString(vm, "createControls"));
-        if (functionValue.isFunction(vm))
+        if (functionValue.isCallable(vm))
             return true;
 
 #ifndef NDEBUG
index 0f8bec9..f1164ae 100644 (file)
@@ -2273,7 +2273,7 @@ String Internals::parserMetaData(JSC::JSValue code)
         callFrame->iterate(vm, iter);
         CodeBlock* codeBlock = iter.codeBlock();
         executable = codeBlock->ownerExecutable();
-    } else if (code.isFunction(vm)) {
+    } else if (code.isCallable(vm)) {
         JSFunction* funcObj = JSC::jsCast<JSFunction*>(code.toObject(globalObject));
         executable = funcObj->jsExecutable();
     } else
@@ -4646,7 +4646,7 @@ JSValue Internals::cloneArrayBuffer(JSC::JSGlobalObject& lexicalGlobalObject, JS
     PropertySlot propertySlot(value, PropertySlot::InternalMethodType::Get);
     lexicalGlobalObject.methodTable(vm)->getOwnPropertySlot(&lexicalGlobalObject, &lexicalGlobalObject, privateName, propertySlot);
     value = propertySlot.getValue(&lexicalGlobalObject, privateName);
-    ASSERT(value.isFunction(vm));
+    ASSERT(value.isCallable(vm));
 
     JSObject* function = value.getObject();
     auto callData = JSC::getCallData(vm, function);
index 4da6833..0d95792 100644 (file)
@@ -75,7 +75,7 @@ ExceptionOr<void> PaintWorkletGlobalScope::registerPaint(JSC::JSGlobalObject& gl
     auto scope = DECLARE_THROW_SCOPE(vm);
 
     // Validate that paintConstructor is a VoidFunction
-    if (!paintConstructor->isFunction(vm))
+    if (!paintConstructor->isCallable(vm))
         return Exception { TypeError, "paintConstructor must be callable" };
 
     if (name.isEmpty())
index 3a7bf02..8d79824 100644 (file)
@@ -1,3 +1,13 @@
+2020-04-28  Ross Kirsling  <ross.kirsling@sony.com>
+
+        [JSC] Align upon the name isCallable instead of isFunction
+        https://bugs.webkit.org/show_bug.cgi?id=211140
+
+        Reviewed by Darin Adler.
+
+        * WebProcess/Plugins/Netscape/NPJSObject.cpp:
+        (WebKit::NPJSObject::hasMethod):
+
 2020-04-28  Devin Rousso  <drousso@apple.com>
 
         Web Inspector: find dialog does not populate search string from system find pasteboard
index 8f6f7b0..b54acc9 100644 (file)
@@ -109,7 +109,7 @@ bool NPJSObject::hasMethod(NPIdentifier methodName)
     JSValue value = m_jsObject->get(lexicalGlobalObject, identifierFromIdentifierRep(lexicalGlobalObject, identifierRep));    
     scope.clearException();
 
-    return value.isFunction(vm);
+    return value.isCallable(vm);
 }
 
 bool NPJSObject::invoke(NPIdentifier methodName, const NPVariant* arguments, uint32_t argumentCount, NPVariant* result)