<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>158778</bug_id>
          
          <creation_ts>2016-06-15 01:51:28 -0700</creation_ts>
          <short_desc>Don&apos;t leak the names of [private] functions in JS built-ins</short_desc>
          <delta_ts>2016-06-22 02:05:39 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Bindings</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>143211</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Adam Bergkvist">adam.bergkvist</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>cdumez</cc>
    
    <cc>joepeck</cc>
    
    <cc>youennf</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1202529</commentid>
    <comment_count>0</comment_count>
    <who name="Adam Bergkvist">adam.bergkvist</who>
    <bug_when>2016-06-15 01:51:28 -0700</bug_when>
    <thetext>If I implement a function add() as a JS built-in based on a private function @privateAdd(), I need to duplicate all type checking done in @privateAdd() to prevent error messages to reveal the &quot;privateAdd&quot; name.

For example: &quot;Argument 1 (&apos;item&apos;) to Bar.privateAdd must be an instance of FooItem&quot;

The approach with adding a native JS function to both a &apos;name&apos; and a &apos;@name&apos; slot,  mentioned in [1], makes this less of an issue.

[1] https://bugs.webkit.org/show_bug.cgi?id=158777</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1204427</commentid>
    <comment_count>1</comment_count>
    <who name="Adam Bergkvist">adam.bergkvist</who>
    <bug_when>2016-06-21 22:35:16 -0700</bug_when>
    <thetext>Since [1] is fixed now, I&apos;m OK with closing this as WONTFIX.

[1] https://bugs.webkit.org/show_bug.cgi?id=158777</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1204468</commentid>
    <comment_count>2</comment_count>
    <who name="youenn fablet">youennf</who>
    <bug_when>2016-06-22 01:39:42 -0700</bug_when>
    <thetext>Let&apos;s keep it open for now.
There may be cases where this issue might arise again.

Also, usually, the caller of the private method should ensure that parameters passed to the function are all fine. In such a case, the checks should become assertions.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1204475</commentid>
    <comment_count>3</comment_count>
    <who name="Adam Bergkvist">adam.bergkvist</who>
    <bug_when>2016-06-22 02:05:39 -0700</bug_when>
    <thetext>(In reply to comment #2)
&gt; Let&apos;s keep it open for now.
&gt; There may be cases where this issue might arise again.

OK with me.

&gt; Also, usually, the caller of the private method should ensure that
&gt; parameters passed to the function are all fine. In such a case, the checks
&gt; should become assertions.

I haven&apos;t looked into the effect of the UNLIKELY macro, but it sounds like something we might want to use it if we still want to keep the &quot;second step argument&quot; checks in native code.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>