JSValue* jsNodeFilterPrototypeFunctionAcceptNode(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args) { if (!thisValue->isObject(&JSNodeFilter::s_info)) return throwError(exec, TypeError); JSNodeFilter* castedThisObj = static_cast<JSNodeFilter*>(thisValue); return castedThisObj->acceptNode(exec, args); }
void JSNodeFilter::visitChildren(JSCell* cell, SlotVisitor& visitor) { JSNodeFilter* thisObject = jsCast<JSNodeFilter*>(cell); ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info); COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag); ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren()); Base::visitChildren(thisObject, visitor); visitor.addOpaqueRoot(thisObject->impl()); }
EncodedJSValue JSC_HOST_CALL jsNodeFilterPrototypeFunctionAcceptNode(ExecState* exec) { JSValue thisValue = exec->hostThisValue(); if (!thisValue.inherits(&JSNodeFilter::s_info)) return throwVMTypeError(exec); JSNodeFilter* castedThis = static_cast<JSNodeFilter*>(asObject(thisValue)); NodeFilter* imp = static_cast<NodeFilter*>(castedThis->impl()); Node* n(toNode(exec->argument(0))); if (exec->hadException()) return JSValue::encode(jsUndefined()); JSC::JSValue result = jsNumber(imp->acceptNode(exec, n)); if (exec->hadException()) return JSValue::encode(jsUndefined()); return JSValue::encode(result); }
JSValue jsNodeFilterConstructor(ExecState* exec, JSValue slotBase, const Identifier&) { JSNodeFilter* domObject = static_cast<JSNodeFilter*>(asObject(slotBase)); return JSNodeFilter::getConstructor(exec, domObject->globalObject()); }