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

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>21424</bug_id>
          
          <creation_ts>2013-03-28 16:39:15 +0000</creation_ts>
          <short_desc>Futures: rename `catch`</short_desc>
          <delta_ts>2013-03-28 16:55:02 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebAppsWG</product>
          <component>DOM</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</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>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Mathias Bynens">mathias</reporter>
          <assigned_to name="Anne">annevk</assigned_to>
          <cc>d</cc>
    
    <cc>erik.arvidsson</cc>
    
    <cc>mathias</cc>
    
    <cc>mike</cc>
    
    <cc>www-dom</cc>
          
          <qa_contact>public-webapps-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>85099</commentid>
    <comment_count>0</comment_count>
    <who name="Mathias Bynens">mathias</who>
    <bug_when>2013-03-28 16:39:15 +0000</bug_when>
    <thetext>`catch` used to be a reserved word in ES3: http://mothereff.in/js-properties#catch

It would be better to use a different name that doesn’t cause syntax errors in older browsers, so that feature detection for Futures can be done without `try`/`catch`.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85101</commentid>
    <comment_count>1</comment_count>
    <who name="Domenic Denicola">d</who>
    <bug_when>2013-03-28 16:40:50 +0000</bug_when>
    <thetext>This shouldn&apos;t matter. `catch` is not what you feature-detect on; `then` is.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85102</commentid>
    <comment_count>2</comment_count>
    <who name="Erik Arvidsson">erik.arvidsson</who>
    <bug_when>2013-03-28 16:49:24 +0000</bug_when>
    <thetext>All browsers supports ES5. I would mark this as WONT FIX</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85103</commentid>
    <comment_count>3</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2013-03-28 16:52:21 +0000</bug_when>
    <thetext>arv has spoken per expectations. Less work for me. Sorry Mathias!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85104</commentid>
    <comment_count>4</comment_count>
    <who name="Mathias Bynens">mathias</who>
    <bug_when>2013-03-28 16:53:30 +0000</bug_when>
    <thetext>(In reply to comment #1)
&gt; This shouldn&apos;t matter. `catch` is not what you feature-detect on; `then` is.

(In reply to comment #1)
&gt; This shouldn&apos;t matter. `catch` is not what you feature-detect on; `then` is.

Even then, any code that uses `catch` would throw a syntax error in ES3 environments.

As per ES3:

    if (featureDetect) {
      this.catch;
    }
    // SyntaxError


So, even if you don’t use `catch` in the feature detection snippet, it will still fail:

    if (featureDetect) {
      this.catch;
    }
    // SyntaxError

As long as `catch` is used it means all code relying on Futures should be wrapped in a `try`/`catch` block to avoid throwing in ES3 environments.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85105</commentid>
    <comment_count>5</comment_count>
    <who name="Erik Arvidsson">erik.arvidsson</who>
    <bug_when>2013-03-28 16:55:02 +0000</bug_when>
    <thetext>If you care about ES3 (and you shouldn&apos;t) you can always use member lookup:

if (this[&apos;catch&apos;]) ...</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>