[Webkit-unassigned] [Bug 80005] Implement strict testing criterion for callback function definition

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Mar 14 13:11:11 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=80005


Gavin Barraclough <barraclough at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |barraclough at apple.com




--- Comment #46 from Gavin Barraclough <barraclough at apple.com>  2012-03-14 13:11:10 PST ---
There is no reason to fix this for V8 only - this patch should be changing CodeGeneratorJS.pm too.

I'm not sure if there is a convenient method exposed by JSC to test for functions right now, but it's easy enough to do - you just need to just check:

    value.isObject() && (value.asObject()->inherits(&JSFunction::s_info) || value.asObject()->inherits(&InternalFunction::s_info))

I'd suggest adding an idFunction method in JSValue (you probably will want to implement this in JSValueINlineMethods.h):

bool JSValue::isFunction() const
{
    return value.isObject() && (value.asObject()->inherits(&JSFunction::s_info) || value.asObject()->inherits(&InternalFunction::s_info));
}

and change CodeGeneratorJS.pm to call this.

cheers, G.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list