Bug 117614 - Function names on Object.prototype should be common identifiers
Summary: Function names on Object.prototype should be common identifiers
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Ryosuke Niwa
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-13 16:11 PDT by Ryosuke Niwa
Modified: 2013-12-17 21:09 PST (History)
0 users

See Also:


Attachments
Fixes the bug (16.30 KB, patch)
2013-06-13 16:17 PDT, Ryosuke Niwa
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ryosuke Niwa 2013-06-13 16:11:54 PDT
Function names on Object.prototype should be common identifiers
Comment 1 Ryosuke Niwa 2013-06-13 16:17:06 PDT
Created attachment 204649 [details]
Fixes the bug
Comment 2 Darin Adler 2013-06-13 17:39:11 PDT
Comment on attachment 204649 [details]
Fixes the bug

View in context: https://bugs.webkit.org/attachment.cgi?id=204649&action=review

> Source/JavaScriptCore/runtime/JSObject.h:1472
> +#define JSC_NATIVE_INTRINSIC_FUNCTION_IDENT(jsName, cppName, attributes, length, intrinsic) \

We can do this without a second macro. We just need this inline function:

    inline Identifier makeIdentifier(ExecState* exec, const char* name)
    {
        return Identifier(exec, name);
    }

    inline Identifier makeIdentifier(ExecState*, const Identifier& identifier)
    {
        return identifier;
    }

Then change the existing macro to use this function instead of calling the Identifier constructor directly. I’d love to not add a new macro. I also have no idea why this is a macro instead of an inline function in the first place.
Comment 3 Ryosuke Niwa 2013-06-14 13:36:14 PDT
Comment on attachment 204649 [details]
Fixes the bug

View in context: https://bugs.webkit.org/attachment.cgi?id=204649&action=review

>> Source/JavaScriptCore/runtime/JSObject.h:1472
>> +#define JSC_NATIVE_INTRINSIC_FUNCTION_IDENT(jsName, cppName, attributes, length, intrinsic) \
> 
> We can do this without a second macro. We just need this inline function:
> 
>     inline Identifier makeIdentifier(ExecState* exec, const char* name)
>     {
>         return Identifier(exec, name);
>     }
> 
>     inline Identifier makeIdentifier(ExecState*, const Identifier& identifier)
>     {
>         return identifier;
>     }
> 
> Then change the existing macro to use this function instead of calling the Identifier constructor directly. I’d love to not add a new macro. I also have no idea why this is a macro instead of an inline function in the first place.

Done.
Comment 4 Ryosuke Niwa 2013-06-14 13:36:41 PDT
Committed r151605: <http://trac.webkit.org/changeset/151605>