<?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>161464</bug_id>
          
          <creation_ts>2016-08-31 16:30:01 -0700</creation_ts>
          <short_desc>const keyword should be allowed in strict mode</short_desc>
          <delta_ts>2016-08-31 19:26:54 -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>JavaScriptCore</component>
          <version>Safari 9</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</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="Jamie Pate">jamie.pate</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ggaren</cc>
    
    <cc>saam</cc>
    
    <cc>ysuzuki</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1225140</commentid>
    <comment_count>0</comment_count>
    <who name="Jamie Pate">jamie.pate</who>
    <bug_when>2016-08-31 16:30:01 -0700</bug_when>
    <thetext>The &apos;const&apos; keyword has &apos;basic support&apos; from all major browsers according to http://kangax.github.io/compat-table/es6/

```
const foo = 123;
return (foo === 123);
```

Unfortunately, webkit throw an error if the `const` keyword is used in a strict context (via &apos;use strict&apos;; ).

Steps to Reproduce:
&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;&lt;/head&gt;
&lt;body style=&quot;white-space: pre-wrap&quot;&gt;
&lt;script&gt; window.onerror = function(e) { alert(e);console.log.apply(console, arguments) }; &lt;/script&gt;
&lt;script&gt;
/* jshint globalstrict: true */
/* jshint esnext: true */
&apos;use strict&apos;;

function x() {
    const a = 1;
    return a === 1;
}
var result = &apos;failure&apos;;

try {
    result = x() ? &apos;success&apos; : &apos;failure&apos;;
} catch (ex) { }
console.log(result);
alert(result);
&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;

Actual Results: &quot;SyntaxError: Unexpected keyword &apos;const&apos;, Const declarations are not supported in strict mode.&quot;

Expected Results: &quot;success&quot; (script executed normally)

Platforms: OSX Safari 9.1.2, iOS webkit 602.1, Phantomjs 2.1.1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1225217</commentid>
    <comment_count>1</comment_count>
    <who name="Saam Barati">saam</who>
    <bug_when>2016-08-31 19:26:13 -0700</bug_when>
    <thetext>Have you tried a webkit nightly? This has been fixed for a while.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>