<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[199927] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/199927">199927</a></dd>
<dt>Author</dt> <dd>ggaren@apple.com</dd>
<dt>Date</dt> <dd>2016-04-22 16:04:55 -0700 (Fri, 22 Apr 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>super should be available in object literals
https://bugs.webkit.org/show_bug.cgi?id=156933

Reviewed by Saam Barati.

Source/JavaScriptCore:

When we originally implemented classes, super seemed to be a class-only
feature. But the final spec says it's available in object literals too.

* bytecompiler/NodesCodegen.cpp:
(JSC::PropertyListNode::emitBytecode): Having 'super' and being a class
property are no longer synonymous, so we track two separate variables.

(JSC::PropertyListNode::emitPutConstantProperty): Being inside the super
branch no longer guarantees that you're a class property, so we decide
our attributes and our function name dynamically.

* parser/ASTBuilder.h:
(JSC::ASTBuilder::createArrowFunctionExpr):
(JSC::ASTBuilder::createGetterOrSetterProperty):
(JSC::ASTBuilder::createArguments):
(JSC::ASTBuilder::createArgumentsList):
(JSC::ASTBuilder::createProperty):
(JSC::ASTBuilder::createPropertyList): Pass through state to indicate
whether we're a class property, since we can't infer it from 'super'
anymore.

* parser/NodeConstructors.h:
(JSC::PropertyNode::PropertyNode): See ASTBuilder.h.

* parser/Nodes.h:
(JSC::PropertyNode::expressionName):
(JSC::PropertyNode::name):
(JSC::PropertyNode::type):
(JSC::PropertyNode::needsSuperBinding):
(JSC::PropertyNode::isClassProperty):
(JSC::PropertyNode::putType): See ASTBuilder.h.

* parser/Parser.cpp:
(JSC::Parser&lt;LexerType&gt;::parseFunctionInfo):
(JSC::Parser&lt;LexerType&gt;::parseClass):
(JSC::Parser&lt;LexerType&gt;::parseProperty):
(JSC::Parser&lt;LexerType&gt;::parsePropertyMethod):
(JSC::Parser&lt;LexerType&gt;::parseGetterSetter):
(JSC::Parser&lt;LexerType&gt;::parseMemberExpression): I made these error
messages generic because it is no longer practical to say concise things
about the list of places you can use super.

* parser/Parser.h:

* parser/SyntaxChecker.h:
(JSC::SyntaxChecker::createArgumentsList):
(JSC::SyntaxChecker::createProperty):
(JSC::SyntaxChecker::appendExportSpecifier):
(JSC::SyntaxChecker::appendConstDecl):
(JSC::SyntaxChecker::createGetterOrSetterProperty): Updated for
interface change.

* tests/stress/generator-with-super.js:
(test):
* tests/stress/modules-syntax-error.js:
* tests/stress/super-in-lexical-scope.js:
(testSyntaxError):
(testSyntaxError.test):
* tests/stress/tagged-templates-syntax.js: Updated for error message
changes. See Parser.cpp.

LayoutTests:

Updated expected results and added a few new tests.

* js/arrowfunction-syntax-errors-expected.txt:
* js/class-syntax-super-expected.txt:
* js/object-literal-methods-expected.txt:
* js/script-tests/arrowfunction-syntax-errors.js:
* js/script-tests/class-syntax-super.js:
* js/script-tests/object-literal-methods.js:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsjsarrowfunctionsyntaxerrorsexpectedtxt">trunk/LayoutTests/js/arrowfunction-syntax-errors-expected.txt</a></li>
<li><a href="#trunkLayoutTestsjsclasssyntaxsuperexpectedtxt">trunk/LayoutTests/js/class-syntax-super-expected.txt</a></li>
<li><a href="#trunkLayoutTestsjsobjectliteralmethodsexpectedtxt">trunk/LayoutTests/js/object-literal-methods-expected.txt</a></li>
<li><a href="#trunkLayoutTestsjsscripttestsarrowfunctionsyntaxerrorsjs">trunk/LayoutTests/js/script-tests/arrowfunction-syntax-errors.js</a></li>
<li><a href="#trunkLayoutTestsjsscripttestsclasssyntaxsuperjs">trunk/LayoutTests/js/script-tests/class-syntax-super.js</a></li>
<li><a href="#trunkLayoutTestsjsscripttestsobjectliteralmethodsjs">trunk/LayoutTests/js/script-tests/object-literal-methods.js</a></li>
<li><a href="#trunkLayoutTestssputnikConformance07_Lexical_Conventions75_Tokens753_Future_Reserved_WordsS753_A127expectedtxt">trunk/LayoutTests/sputnik/Conformance/07_Lexical_Conventions/7.5_Tokens/7.5.3_Future_Reserved_Words/S7.5.3_A1.27-expected.txt</a></li>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecompilerNodesCodegencpp">trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreparserASTBuilderh">trunk/Source/JavaScriptCore/parser/ASTBuilder.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreparserNodeConstructorsh">trunk/Source/JavaScriptCore/parser/NodeConstructors.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreparserNodesh">trunk/Source/JavaScriptCore/parser/Nodes.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreparserParsercpp">trunk/Source/JavaScriptCore/parser/Parser.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreparserParserh">trunk/Source/JavaScriptCore/parser/Parser.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreparserSyntaxCheckerh">trunk/Source/JavaScriptCore/parser/SyntaxChecker.h</a></li>
<li><a href="#trunkSourceJavaScriptCoretestsstressgeneratorwithsuperjs">trunk/Source/JavaScriptCore/tests/stress/generator-with-super.js</a></li>
<li><a href="#trunkSourceJavaScriptCoretestsstressmodulessyntaxerrorjs">trunk/Source/JavaScriptCore/tests/stress/modules-syntax-error.js</a></li>
<li><a href="#trunkSourceJavaScriptCoretestsstresssuperinlexicalscopejs">trunk/Source/JavaScriptCore/tests/stress/super-in-lexical-scope.js</a></li>
<li><a href="#trunkSourceJavaScriptCoretestsstresstaggedtemplatessyntaxjs">trunk/Source/JavaScriptCore/tests/stress/tagged-templates-syntax.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (199926 => 199927)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-04-22 23:04:35 UTC (rev 199926)
+++ trunk/LayoutTests/ChangeLog        2016-04-22 23:04:55 UTC (rev 199927)
</span><span class="lines">@@ -1,3 +1,19 @@
</span><ins>+2016-04-22  Geoffrey Garen  &lt;ggaren@apple.com&gt;
+
+        super should be available in object literals
+        https://bugs.webkit.org/show_bug.cgi?id=156933
+
+        Reviewed by Saam Barati.
+
+        Updated expected results and added a few new tests.
+
+        * js/arrowfunction-syntax-errors-expected.txt:
+        * js/class-syntax-super-expected.txt:
+        * js/object-literal-methods-expected.txt:
+        * js/script-tests/arrowfunction-syntax-errors.js:
+        * js/script-tests/class-syntax-super.js:
+        * js/script-tests/object-literal-methods.js:
+
</ins><span class="cx"> 2016-04-22  Ryan Haddad  &lt;ryanhaddad@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Rebaselining inspector/model/stack-trace.html after r199897
</span></span></pre></div>
<a id="trunkLayoutTestsjsarrowfunctionsyntaxerrorsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/js/arrowfunction-syntax-errors-expected.txt (199926 => 199927)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/arrowfunction-syntax-errors-expected.txt        2016-04-22 23:04:35 UTC (rev 199926)
+++ trunk/LayoutTests/js/arrowfunction-syntax-errors-expected.txt        2016-04-22 23:04:55 UTC (rev 199927)
</span><span class="lines">@@ -131,20 +131,20 @@
</span><span class="cx"> PASS var arr2 = {a, b} =&gt; a + b; threw exception SyntaxError: Unexpected token '=&gt;'. Expected ';' after variable declaration..
</span><span class="cx"> PASS var arr3 = {c:a,d:b} =&gt; a + b; threw exception SyntaxError: Unexpected token '=&gt;'. Expected ';' after variable declaration..
</span><span class="cx"> PASS var arr3 = {c:b,d:a} =&gt; a + b; threw exception SyntaxError: Unexpected token '=&gt;'. Expected ';' after variable declaration..
</span><del>-PASS var arr4 = () =&gt; { super(); }; threw exception SyntaxError: Cannot call super() outside of a class constructor..
-PASS var arr4 = () =&gt; { super; }; threw exception SyntaxError: Cannot reference super..
-PASS var arr5 = () =&gt; { super.getValue(); }; threw exception SyntaxError: super can only be used in a method of a derived class..
-PASS var arr6 = () =&gt;  super(); threw exception SyntaxError: Cannot call super() outside of a class constructor..
-PASS var arr7 = () =&gt;  super; threw exception SyntaxError: Cannot reference super..
-PASS var arr8 = () =&gt;  super.getValue(); threw exception SyntaxError: super can only be used in a method of a derived class..
-PASS class A { constructor() { function a () { return () =&gt; { super(); };}} threw exception SyntaxError: Cannot call super() outside of a class constructor..
-PASS class B { constructor() { function b () { return () =&gt; { super; }; }; }} threw exception SyntaxError: Cannot reference super..
-PASS class C { constructor() { function c () { return () =&gt; { super.getValue(); };}} threw exception SyntaxError: super can only be used in a method of a derived class..
-PASS class D { constructor() { function a () { return () =&gt; super(); }} threw exception SyntaxError: Cannot call super() outside of a class constructor..
-PASS class E { constructor() { function b () { return () =&gt; super; }; }} threw exception SyntaxError: Cannot reference super..
-PASS class F { constructor() { function c () { return () =&gt; super.getValue(); }} threw exception SyntaxError: super can only be used in a method of a derived class..
-PASS class G {}; class G2 extends G { getValue() { function c () { return () =&gt; super.getValue(); }} threw exception SyntaxError: super can only be used in a method of a derived class..
-PASS class H {}; class H2 extends H { method() { function *gen() { let arr = () =&gt; super.getValue(); arr(); } } } threw exception SyntaxError: super can only be used in a method of a derived class..
</del><ins>+PASS var arr4 = () =&gt; { super(); }; threw exception SyntaxError: super is not valid in this context..
+PASS var arr4 = () =&gt; { super; }; threw exception SyntaxError: super is not valid in this context..
+PASS var arr5 = () =&gt; { super.getValue(); }; threw exception SyntaxError: super is not valid in this context..
+PASS var arr6 = () =&gt;  super(); threw exception SyntaxError: super is not valid in this context..
+PASS var arr7 = () =&gt;  super; threw exception SyntaxError: super is not valid in this context..
+PASS var arr8 = () =&gt;  super.getValue(); threw exception SyntaxError: super is not valid in this context..
+PASS class A { constructor() { function a () { return () =&gt; { super(); };}} threw exception SyntaxError: super is not valid in this context..
+PASS class B { constructor() { function b () { return () =&gt; { super; }; }; }} threw exception SyntaxError: super is not valid in this context..
+PASS class C { constructor() { function c () { return () =&gt; { super.getValue(); };}} threw exception SyntaxError: super is not valid in this context..
+PASS class D { constructor() { function a () { return () =&gt; super(); }} threw exception SyntaxError: super is not valid in this context..
+PASS class E { constructor() { function b () { return () =&gt; super; }; }} threw exception SyntaxError: super is not valid in this context..
+PASS class F { constructor() { function c () { return () =&gt; super.getValue(); }} threw exception SyntaxError: super is not valid in this context..
+PASS class G {}; class G2 extends G { getValue() { function c () { return () =&gt; super.getValue(); }} threw exception SyntaxError: super is not valid in this context..
+PASS class H {}; class H2 extends H { method() { function *gen() { let arr = () =&gt; super.getValue(); arr(); } } } threw exception SyntaxError: super is not valid in this context..
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx"> 
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestsjsclasssyntaxsuperexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/js/class-syntax-super-expected.txt (199926 => 199927)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/class-syntax-super-expected.txt        2016-04-22 23:04:35 UTC (rev 199926)
+++ trunk/LayoutTests/js/class-syntax-super-expected.txt        2016-04-22 23:04:55 UTC (rev 199927)
</span><span class="lines">@@ -16,8 +16,8 @@
</span><span class="cx"> PASS Derived.staticMethod():::&quot;base3&quot;
</span><span class="cx"> PASS (new SecondDerived).chainMethod().toString():::[&quot;base&quot;, &quot;derived&quot;, &quot;secondDerived&quot;].toString()
</span><span class="cx"> PASS x = class extends Base { constructor() { super(); } super() {} }
</span><del>-PASS x = class extends Base { constructor() { super(); } method() { super() } }:::SyntaxError: Cannot call super() outside of a class constructor.
-PASS x = class extends Base { constructor() { super(); } method() { super } }:::SyntaxError: Cannot reference super.
</del><ins>+PASS x = class extends Base { constructor() { super(); } method() { super() } }:::SyntaxError: super is not valid in this context.
+PASS x = class extends Base { constructor() { super(); } method() { super } }:::SyntaxError: super is not valid in this context.
</ins><span class="cx"> PASS x = class extends Base { constructor() { super(); } method() { return new super } }:::SyntaxError: Cannot use new with super.
</span><span class="cx"> PASS x = class extends Base { constructor() { super(); } method1() { delete (super.foo) } method2() { delete super[&quot;foo&quot;] } }
</span><span class="cx"> PASS (new x).method1():::ReferenceError: Cannot delete a super property
</span><span class="lines">@@ -37,18 +37,18 @@
</span><span class="cx"> PASS new (class extends null { constructor() { } }):::ReferenceError: Cannot access uninitialized variable.
</span><span class="cx"> PASS new (class extends null { constructor() { return 1; } }):::TypeError: Cannot return a non-object type in the constructor of a derived class.
</span><span class="cx"> PASS new (class extends null { constructor() { super() } }):::TypeError: function is not a constructor (evaluating 'super()')
</span><del>-PASS new (class { constructor() { super() } }):::SyntaxError: Cannot call super() in a base class constructor.
-PASS function x() { super(); }:::SyntaxError: Cannot call super() outside of a class constructor.
-PASS new (class extends Object { constructor() { function x() { super() } } }):::SyntaxError: Cannot call super() outside of a class constructor.
-PASS new (class extends Object { constructor() { function x() { super.method } } }):::SyntaxError: super can only be used in a method of a derived class.
-PASS function x() { super.method(); }:::SyntaxError: super can only be used in a method of a derived class.
-PASS function x() { super(); }:::SyntaxError: Cannot call super() outside of a class constructor.
-PASS eval(&quot;super.method()&quot;):::SyntaxError: 'super' is only valid inside a function or an 'eval' inside a function.
-PASS eval(&quot;super()&quot;):::SyntaxError: 'super' is only valid inside a function or an 'eval' inside a function.
-PASS (function () { eval(&quot;super.method()&quot;);})():::SyntaxError: 'super' is only valid inside a function or an 'eval' inside a function.
-PASS (function () { eval(&quot;super()&quot;);})():::SyntaxError: 'super' is only valid inside a function or an 'eval' inside a function.
-PASS new (class { constructor() { (function () { eval(&quot;super()&quot;);})(); } }):::SyntaxError: 'super' is only valid inside a function or an 'eval' inside a function.
-PASS (new (class { method() { (function () { eval(&quot;super.method()&quot;);})(); }})).method():::SyntaxError: 'super' is only valid inside a function or an 'eval' inside a function.
</del><ins>+PASS new (class { constructor() { super() } }):::SyntaxError: super is not valid in this context.
+PASS function x() { super(); }:::SyntaxError: super is not valid in this context.
+PASS new (class extends Object { constructor() { function x() { super() } } }):::SyntaxError: super is not valid in this context.
+PASS new (class extends Object { constructor() { function x() { super.method } } }):::SyntaxError: super is not valid in this context.
+PASS function x() { super.method(); }:::SyntaxError: super is not valid in this context.
+PASS function x() { super(); }:::SyntaxError: super is not valid in this context.
+PASS eval(&quot;super.method()&quot;):::SyntaxError: super is not valid in this context.
+PASS eval(&quot;super()&quot;):::SyntaxError: super is not valid in this context.
+PASS (function () { eval(&quot;super.method()&quot;);})():::SyntaxError: super is not valid in this context.
+PASS (function () { eval(&quot;super()&quot;);})():::SyntaxError: super is not valid in this context.
+PASS new (class { constructor() { (function () { eval(&quot;super()&quot;);})(); } }):::SyntaxError: super is not valid in this context.
+PASS (new (class { method() { (function () { eval(&quot;super.method()&quot;);})(); }})).method():::SyntaxError: super is not valid in this context.
</ins><span class="cx"> PASS successfullyParsed
</span><span class="cx"> 
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestsjsobjectliteralmethodsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/js/object-literal-methods-expected.txt (199926 => 199927)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/object-literal-methods-expected.txt        2016-04-22 23:04:35 UTC (rev 199926)
+++ trunk/LayoutTests/js/object-literal-methods-expected.txt        2016-04-22 23:04:55 UTC (rev 199927)
</span><span class="lines">@@ -68,6 +68,14 @@
</span><span class="cx"> PASS ({__proto__: function(){}}) instanceof Function is true
</span><span class="cx"> PASS ({__proto__(){}}) instanceof Function is false
</span><span class="cx"> PASS ({__proto__(){}}).__proto__ instanceof Function is true
</span><ins>+PASS { f() { return super.f(); } }.f() threw exception SyntaxError: Unexpected token '{'.
+PASS new ({ f() { return super(); }.f) threw exception SyntaxError: super is not valid in this context..
+PASS o = { f() { } }; new ({ __proto__: o, f() { return super(); } }).f threw exception SyntaxError: super is not valid in this context..
+PASS ({ f() { return (() =&gt; super.f())(); } }).f() threw exception TypeError: super.f is not a function. (In 'super.f()', 'super.f' is undefined).
+PASS o = { f() { return true; } }; ({ __proto__: o, f() { return super.f(); } }).f() is true
+PASS o = { get p() { return true; } }; ({ __proto__: o, get p() { return super.p; } }).p is true
+PASS o = { set p(p2) { } }; ({ __proto__: o, set p(p2) { super.p = p2; } }).p = true is true
+PASS o = { f() { return true; } }; ({ __proto__: o, f() { return (() =&gt; super.f())(); } }).f() is true
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx"> 
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestsjsscripttestsarrowfunctionsyntaxerrorsjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/js/script-tests/arrowfunction-syntax-errors.js (199926 => 199927)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/script-tests/arrowfunction-syntax-errors.js        2016-04-22 23:04:35 UTC (rev 199926)
+++ trunk/LayoutTests/js/script-tests/arrowfunction-syntax-errors.js        2016-04-22 23:04:55 UTC (rev 199927)
</span><span class="lines">@@ -48,22 +48,22 @@
</span><span class="cx"> shouldThrow('var arr3 = {c:a,d:b} =&gt; a + b;');
</span><span class="cx"> shouldThrow('var arr3 = {c:b,d:a} =&gt; a + b;');
</span><span class="cx"> 
</span><del>-shouldThrow('var arr4 = () =&gt; { super(); };', '&quot;SyntaxError: Cannot call super() outside of a class constructor.&quot;');
-shouldThrow('var arr4 = () =&gt; { super; };', '&quot;SyntaxError: Cannot reference super.&quot;');
-shouldThrow('var arr5 = () =&gt; { super.getValue(); };', '&quot;SyntaxError: super can only be used in a method of a derived class.&quot;');
</del><ins>+shouldThrow('var arr4 = () =&gt; { super(); };', '&quot;SyntaxError: super is not valid in this context.&quot;');
+shouldThrow('var arr4 = () =&gt; { super; };', '&quot;SyntaxError: super is not valid in this context.&quot;');
+shouldThrow('var arr5 = () =&gt; { super.getValue(); };', '&quot;SyntaxError: super is not valid in this context.&quot;');
</ins><span class="cx"> 
</span><del>-shouldThrow('var arr6 = () =&gt;  super();', '&quot;SyntaxError: Cannot call super() outside of a class constructor.&quot;');
-shouldThrow('var arr7 = () =&gt;  super;', '&quot;SyntaxError: Cannot reference super.&quot;');
-shouldThrow('var arr8 = () =&gt;  super.getValue();', '&quot;SyntaxError: super can only be used in a method of a derived class.&quot;');
</del><ins>+shouldThrow('var arr6 = () =&gt;  super();', '&quot;SyntaxError: super is not valid in this context.&quot;');
+shouldThrow('var arr7 = () =&gt;  super;', '&quot;SyntaxError: super is not valid in this context.&quot;');
+shouldThrow('var arr8 = () =&gt;  super.getValue();', '&quot;SyntaxError: super is not valid in this context.&quot;');
</ins><span class="cx"> 
</span><del>-shouldThrow('class A { constructor() { function a () { return () =&gt; { super(); };}}', '&quot;SyntaxError: Cannot call super() outside of a class constructor.&quot;');
-shouldThrow('class B { constructor() { function b () { return () =&gt; { super; }; }; }}', '&quot;SyntaxError: Cannot reference super.&quot;');
-shouldThrow('class C { constructor() { function c () { return () =&gt; { super.getValue(); };}}', '&quot;SyntaxError: super can only be used in a method of a derived class.&quot;');
</del><ins>+shouldThrow('class A { constructor() { function a () { return () =&gt; { super(); };}}', '&quot;SyntaxError: super is not valid in this context.&quot;');
+shouldThrow('class B { constructor() { function b () { return () =&gt; { super; }; }; }}', '&quot;SyntaxError: super is not valid in this context.&quot;');
+shouldThrow('class C { constructor() { function c () { return () =&gt; { super.getValue(); };}}', '&quot;SyntaxError: super is not valid in this context.&quot;');
</ins><span class="cx"> 
</span><del>-shouldThrow('class D { constructor() { function a () { return () =&gt; super(); }}', '&quot;SyntaxError: Cannot call super() outside of a class constructor.&quot;');
-shouldThrow('class E { constructor() { function b () { return () =&gt; super; }; }}', '&quot;SyntaxError: Cannot reference super.&quot;');
-shouldThrow('class F { constructor() { function c () { return () =&gt; super.getValue(); }}', '&quot;SyntaxError: super can only be used in a method of a derived class.&quot;');
-shouldThrow('class G {}; class G2 extends G { getValue() { function c () { return () =&gt; super.getValue(); }}', '&quot;SyntaxError: super can only be used in a method of a derived class.&quot;');
-shouldThrow('class H {}; class H2 extends H { method() { function *gen() { let arr = () =&gt; super.getValue(); arr(); } } }', '&quot;SyntaxError: super can only be used in a method of a derived class.&quot;');
</del><ins>+shouldThrow('class D { constructor() { function a () { return () =&gt; super(); }}', '&quot;SyntaxError: super is not valid in this context.&quot;');
+shouldThrow('class E { constructor() { function b () { return () =&gt; super; }; }}', '&quot;SyntaxError: super is not valid in this context.&quot;');
+shouldThrow('class F { constructor() { function c () { return () =&gt; super.getValue(); }}', '&quot;SyntaxError: super is not valid in this context.&quot;');
+shouldThrow('class G {}; class G2 extends G { getValue() { function c () { return () =&gt; super.getValue(); }}', '&quot;SyntaxError: super is not valid in this context.&quot;');
+shouldThrow('class H {}; class H2 extends H { method() { function *gen() { let arr = () =&gt; super.getValue(); arr(); } } }', '&quot;SyntaxError: super is not valid in this context.&quot;');
</ins><span class="cx"> 
</span><span class="cx"> var successfullyParsed = true;
</span></span></pre></div>
<a id="trunkLayoutTestsjsscripttestsclasssyntaxsuperjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/js/script-tests/class-syntax-super.js (199926 => 199927)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/script-tests/class-syntax-super.js        2016-04-22 23:04:35 UTC (rev 199926)
+++ trunk/LayoutTests/js/script-tests/class-syntax-super.js        2016-04-22 23:04:55 UTC (rev 199927)
</span><span class="lines">@@ -99,8 +99,8 @@
</span><span class="cx"> shouldBe('(new SecondDerived).chainMethod().toString()', '[&quot;base&quot;, &quot;derived&quot;, &quot;secondDerived&quot;].toString()');
</span><span class="cx"> shouldNotThrow('x = class extends Base { constructor() { super(); } super() {} }');
</span><span class="cx"> shouldThrow('x = class extends Base { constructor() { super(); } method() { super() } }',
</span><del>-    '&quot;SyntaxError: Cannot call super() outside of a class constructor.&quot;');
-shouldThrow('x = class extends Base { constructor() { super(); } method() { super } }', '&quot;SyntaxError: Cannot reference super.&quot;');
</del><ins>+    '&quot;SyntaxError: super is not valid in this context.&quot;');
+shouldThrow('x = class extends Base { constructor() { super(); } method() { super } }', '&quot;SyntaxError: super is not valid in this context.&quot;');
</ins><span class="cx"> shouldThrow('x = class extends Base { constructor() { super(); } method() { return new super } }', '&quot;SyntaxError: Cannot use new with super.&quot;');
</span><span class="cx"> shouldNotThrow('x = class extends Base { constructor() { super(); } method1() { delete (super.foo) } method2() { delete super[&quot;foo&quot;] } }');
</span><span class="cx"> shouldThrow('(new x).method1()', '&quot;ReferenceError: Cannot delete a super property&quot;');
</span><span class="lines">@@ -120,19 +120,19 @@
</span><span class="cx"> shouldThrow('new (class extends null { constructor() { } })', '&quot;ReferenceError: Cannot access uninitialized variable.&quot;');
</span><span class="cx"> shouldThrow('new (class extends null { constructor() { return 1; } })', '&quot;TypeError: Cannot return a non-object type in the constructor of a derived class.&quot;');
</span><span class="cx"> shouldThrow('new (class extends null { constructor() { super() } })', '&quot;TypeError: function is not a constructor (evaluating \'super()\')&quot;');
</span><del>-shouldThrow('new (class { constructor() { super() } })', '&quot;SyntaxError: Cannot call super() in a base class constructor.&quot;');
-shouldThrow('function x() { super(); }', '&quot;SyntaxError: Cannot call super() outside of a class constructor.&quot;');
-shouldThrow('new (class extends Object { constructor() { function x() { super() } } })', '&quot;SyntaxError: Cannot call super() outside of a class constructor.&quot;');
-shouldThrow('new (class extends Object { constructor() { function x() { super.method } } })', '&quot;SyntaxError: super can only be used in a method of a derived class.&quot;');
-shouldThrow('function x() { super.method(); }', '&quot;SyntaxError: super can only be used in a method of a derived class.&quot;');
-shouldThrow('function x() { super(); }', '&quot;SyntaxError: Cannot call super() outside of a class constructor.&quot;');
-shouldThrow('eval(&quot;super.method()&quot;)', '&quot;SyntaxError: \'super\' is only valid inside a function or an \'eval\' inside a function.&quot;');
-shouldThrow('eval(&quot;super()&quot;)', '&quot;SyntaxError: \'super\' is only valid inside a function or an \'eval\' inside a function.&quot;');
</del><ins>+shouldThrow('new (class { constructor() { super() } })', '&quot;SyntaxError: super is not valid in this context.&quot;');
+shouldThrow('function x() { super(); }', '&quot;SyntaxError: super is not valid in this context.&quot;');
+shouldThrow('new (class extends Object { constructor() { function x() { super() } } })', '&quot;SyntaxError: super is not valid in this context.&quot;');
+shouldThrow('new (class extends Object { constructor() { function x() { super.method } } })', '&quot;SyntaxError: super is not valid in this context.&quot;');
+shouldThrow('function x() { super.method(); }', '&quot;SyntaxError: super is not valid in this context.&quot;');
+shouldThrow('function x() { super(); }', '&quot;SyntaxError: super is not valid in this context.&quot;');
+shouldThrow('eval(&quot;super.method()&quot;)', '&quot;SyntaxError: super is not valid in this context.&quot;');
+shouldThrow('eval(&quot;super()&quot;)', '&quot;SyntaxError: super is not valid in this context.&quot;');
</ins><span class="cx"> 
</span><del>-shouldThrow('(function () { eval(&quot;super.method()&quot;);})()', '&quot;SyntaxError: \'super\' is only valid inside a function or an \'eval\' inside a function.&quot;');
-shouldThrow('(function () { eval(&quot;super()&quot;);})()', '&quot;SyntaxError: \'super\' is only valid inside a function or an \'eval\' inside a function.&quot;');
</del><ins>+shouldThrow('(function () { eval(&quot;super.method()&quot;);})()', '&quot;SyntaxError: super is not valid in this context.&quot;');
+shouldThrow('(function () { eval(&quot;super()&quot;);})()', '&quot;SyntaxError: super is not valid in this context.&quot;');
</ins><span class="cx"> 
</span><del>-shouldThrow('new (class { constructor() { (function () { eval(&quot;super()&quot;);})(); } })', '&quot;SyntaxError: \'super\' is only valid inside a function or an \'eval\' inside a function.&quot;');
-shouldThrow('(new (class { method() { (function () { eval(&quot;super.method()&quot;);})(); }})).method()', '&quot;SyntaxError: \'super\' is only valid inside a function or an \'eval\' inside a function.&quot;');
</del><ins>+shouldThrow('new (class { constructor() { (function () { eval(&quot;super()&quot;);})(); } })', '&quot;SyntaxError: super is not valid in this context.&quot;');
+shouldThrow('(new (class { method() { (function () { eval(&quot;super.method()&quot;);})(); }})).method()', '&quot;SyntaxError: super is not valid in this context.&quot;');
</ins><span class="cx"> 
</span><span class="cx"> var successfullyParsed = true;
</span></span></pre></div>
<a id="trunkLayoutTestsjsscripttestsobjectliteralmethodsjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/js/script-tests/object-literal-methods.js (199926 => 199927)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/script-tests/object-literal-methods.js        2016-04-22 23:04:35 UTC (rev 199926)
+++ trunk/LayoutTests/js/script-tests/object-literal-methods.js        2016-04-22 23:04:55 UTC (rev 199927)
</span><span class="lines">@@ -82,3 +82,12 @@
</span><span class="cx"> shouldBeTrue(&quot;({__proto__: function(){}}) instanceof Function&quot;);
</span><span class="cx"> shouldBeFalse(&quot;({__proto__(){}}) instanceof Function&quot;);
</span><span class="cx"> shouldBeTrue(&quot;({__proto__(){}}).__proto__ instanceof Function&quot;);
</span><ins>+
+shouldThrow(&quot;{ f() { return super.f(); } }.f()&quot;);
+shouldThrow(&quot;new ({ f() { return super(); }.f)&quot;);
+shouldThrow(&quot;o = { f() { } }; new ({ __proto__: o, f() { return super(); } }).f&quot;);
+shouldThrow(&quot;({ f() { return (() =&gt; super.f())(); } }).f()&quot;);
+shouldBeTrue(&quot;o = { f() { return true; } }; ({ __proto__: o, f() { return super.f(); } }).f()&quot;);
+shouldBeTrue(&quot;o = { get p() { return true; } }; ({ __proto__: o, get p() { return super.p; } }).p&quot;);
+shouldBeTrue(&quot;o = { set p(p2) { } }; ({ __proto__: o, set p(p2) { super.p = p2; } }).p = true&quot;);
+shouldBeTrue(&quot;o = { f() { return true; } }; ({ __proto__: o, f() { return (() =&gt; super.f())(); } }).f()&quot;);
</ins></span></pre></div>
<a id="trunkLayoutTestssputnikConformance07_Lexical_Conventions75_Tokens753_Future_Reserved_WordsS753_A127expectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/sputnik/Conformance/07_Lexical_Conventions/7.5_Tokens/7.5.3_Future_Reserved_Words/S7.5.3_A1.27-expected.txt (199926 => 199927)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/sputnik/Conformance/07_Lexical_Conventions/7.5_Tokens/7.5.3_Future_Reserved_Words/S7.5.3_A1.27-expected.txt        2016-04-22 23:04:35 UTC (rev 199926)
+++ trunk/LayoutTests/sputnik/Conformance/07_Lexical_Conventions/7.5_Tokens/7.5.3_Future_Reserved_Words/S7.5.3_A1.27-expected.txt        2016-04-22 23:04:55 UTC (rev 199927)
</span><span class="lines">@@ -1,4 +1,4 @@
</span><del>-CONSOLE MESSAGE: line 76: SyntaxError: 'super' is only valid inside a function or an 'eval' inside a function.
</del><ins>+CONSOLE MESSAGE: line 76: SyntaxError: super is not valid in this context.
</ins><span class="cx"> S7.5.3_A1.27
</span><span class="cx"> 
</span><span class="cx"> PASS Expected parsing failure
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (199926 => 199927)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2016-04-22 23:04:35 UTC (rev 199926)
+++ trunk/Source/JavaScriptCore/ChangeLog        2016-04-22 23:04:55 UTC (rev 199927)
</span><span class="lines">@@ -1,3 +1,71 @@
</span><ins>+2016-04-22  Geoffrey Garen  &lt;ggaren@apple.com&gt;
+
+        super should be available in object literals
+        https://bugs.webkit.org/show_bug.cgi?id=156933
+
+        Reviewed by Saam Barati.
+
+        When we originally implemented classes, super seemed to be a class-only
+        feature. But the final spec says it's available in object literals too.
+
+        * bytecompiler/NodesCodegen.cpp:
+        (JSC::PropertyListNode::emitBytecode): Having 'super' and being a class
+        property are no longer synonymous, so we track two separate variables.
+
+        (JSC::PropertyListNode::emitPutConstantProperty): Being inside the super
+        branch no longer guarantees that you're a class property, so we decide
+        our attributes and our function name dynamically.
+
+        * parser/ASTBuilder.h:
+        (JSC::ASTBuilder::createArrowFunctionExpr):
+        (JSC::ASTBuilder::createGetterOrSetterProperty):
+        (JSC::ASTBuilder::createArguments):
+        (JSC::ASTBuilder::createArgumentsList):
+        (JSC::ASTBuilder::createProperty):
+        (JSC::ASTBuilder::createPropertyList): Pass through state to indicate
+        whether we're a class property, since we can't infer it from 'super'
+        anymore.
+
+        * parser/NodeConstructors.h:
+        (JSC::PropertyNode::PropertyNode): See ASTBuilder.h.
+
+        * parser/Nodes.h:
+        (JSC::PropertyNode::expressionName):
+        (JSC::PropertyNode::name):
+        (JSC::PropertyNode::type):
+        (JSC::PropertyNode::needsSuperBinding):
+        (JSC::PropertyNode::isClassProperty):
+        (JSC::PropertyNode::putType): See ASTBuilder.h.
+
+        * parser/Parser.cpp:
+        (JSC::Parser&lt;LexerType&gt;::parseFunctionInfo):
+        (JSC::Parser&lt;LexerType&gt;::parseClass):
+        (JSC::Parser&lt;LexerType&gt;::parseProperty):
+        (JSC::Parser&lt;LexerType&gt;::parsePropertyMethod):
+        (JSC::Parser&lt;LexerType&gt;::parseGetterSetter):
+        (JSC::Parser&lt;LexerType&gt;::parseMemberExpression): I made these error
+        messages generic because it is no longer practical to say concise things
+        about the list of places you can use super.
+
+        * parser/Parser.h:
+
+        * parser/SyntaxChecker.h:
+        (JSC::SyntaxChecker::createArgumentsList):
+        (JSC::SyntaxChecker::createProperty):
+        (JSC::SyntaxChecker::appendExportSpecifier):
+        (JSC::SyntaxChecker::appendConstDecl):
+        (JSC::SyntaxChecker::createGetterOrSetterProperty): Updated for
+        interface change.
+
+        * tests/stress/generator-with-super.js:
+        (test):
+        * tests/stress/modules-syntax-error.js:
+        * tests/stress/super-in-lexical-scope.js:
+        (testSyntaxError):
+        (testSyntaxError.test):
+        * tests/stress/tagged-templates-syntax.js: Updated for error message
+        changes. See Parser.cpp.
+
</ins><span class="cx"> 2016-04-22  Filip Pizlo  &lt;fpizlo@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         ASSERT(m_stack.last().isTailDeleted) at ShadowChicken.cpp:127 inspecting the inspector
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecompilerNodesCodegencpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp (199926 => 199927)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp        2016-04-22 23:04:35 UTC (rev 199926)
+++ trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp        2016-04-22 23:04:55 UTC (rev 199927)
</span><span class="lines">@@ -498,11 +498,12 @@
</span><span class="cx">             }
</span><span class="cx"> 
</span><span class="cx">             RefPtr&lt;RegisterID&gt; value = generator.emitNode(node-&gt;m_assign);
</span><del>-            bool isClassProperty = node-&gt;needsSuperBinding();
-            if (isClassProperty)
</del><ins>+            bool needsSuperBinding = node-&gt;needsSuperBinding();
+            if (needsSuperBinding)
</ins><span class="cx">                 emitPutHomeObject(generator, value.get(), dst);
</span><del>-            unsigned attribute = isClassProperty ? (Accessor | DontEnum) : Accessor;
</del><span class="cx"> 
</span><ins>+            unsigned attributes = node-&gt;isClassProperty() ? (Accessor | DontEnum) : Accessor;
+
</ins><span class="cx">             ASSERT(node-&gt;m_type &amp; (PropertyNode::Getter | PropertyNode::Setter));
</span><span class="cx"> 
</span><span class="cx">             // This is a get/set property which may be overridden by a computed property later.
</span><span class="lines">@@ -512,16 +513,16 @@
</span><span class="cx">                     RefPtr&lt;RegisterID&gt; propertyName = generator.emitNode(node-&gt;m_expression);
</span><span class="cx">                     generator.emitSetFunctionNameIfNeeded(node-&gt;m_assign, value.get(), propertyName.get());
</span><span class="cx">                     if (node-&gt;m_type &amp; PropertyNode::Getter)
</span><del>-                        generator.emitPutGetterByVal(dst, propertyName.get(), attribute, value.get());
</del><ins>+                        generator.emitPutGetterByVal(dst, propertyName.get(), attributes, value.get());
</ins><span class="cx">                     else
</span><del>-                        generator.emitPutSetterByVal(dst, propertyName.get(), attribute, value.get());
</del><ins>+                        generator.emitPutSetterByVal(dst, propertyName.get(), attributes, value.get());
</ins><span class="cx">                     continue;
</span><span class="cx">                 }
</span><span class="cx"> 
</span><span class="cx">                 if (node-&gt;m_type &amp; PropertyNode::Getter)
</span><del>-                    generator.emitPutGetterById(dst, *node-&gt;name(), attribute, value.get());
</del><ins>+                    generator.emitPutGetterById(dst, *node-&gt;name(), attributes, value.get());
</ins><span class="cx">                 else
</span><del>-                    generator.emitPutSetterById(dst, *node-&gt;name(), attribute, value.get());
</del><ins>+                    generator.emitPutSetterById(dst, *node-&gt;name(), attributes, value.get());
</ins><span class="cx">                 continue;
</span><span class="cx">             }
</span><span class="cx"> 
</span><span class="lines">@@ -562,11 +563,11 @@
</span><span class="cx">                 }
</span><span class="cx">             }
</span><span class="cx"> 
</span><del>-            ASSERT(!pair.second || isClassProperty == pair.second-&gt;needsSuperBinding());
-            if (isClassProperty &amp;&amp; pair.second)
</del><ins>+            ASSERT(!pair.second || needsSuperBinding == pair.second-&gt;needsSuperBinding());
+            if (needsSuperBinding &amp;&amp; pair.second)
</ins><span class="cx">                 emitPutHomeObject(generator, secondReg, dst);
</span><span class="cx"> 
</span><del>-            generator.emitPutGetterSetter(dst, *node-&gt;name(), attribute, getterReg.get(), setterReg.get());
</del><ins>+            generator.emitPutGetterSetter(dst, *node-&gt;name(), attributes, getterReg.get(), setterReg.get());
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -585,8 +586,12 @@
</span><span class="cx">         else
</span><span class="cx">             propertyNameRegister = generator.emitNode(node.m_expression);
</span><span class="cx"> 
</span><ins>+        unsigned attributes = BytecodeGenerator::PropertyConfigurable | BytecodeGenerator::PropertyWritable;
+        if (!node.isClassProperty())
+            attributes |= BytecodeGenerator::PropertyEnumerable;
+        generator.emitSetFunctionNameIfNeeded(node.m_assign, value.get(), propertyNameRegister.get());
</ins><span class="cx">         generator.emitCallDefineProperty(newObj, propertyNameRegister.get(),
</span><del>-            value.get(), nullptr, nullptr, BytecodeGenerator::PropertyConfigurable | BytecodeGenerator::PropertyWritable, m_position);
</del><ins>+            value.get(), nullptr, nullptr, attributes, m_position);
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx">     if (const auto* identifier = node.name()) {
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreparserASTBuilderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/parser/ASTBuilder.h (199926 => 199927)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/parser/ASTBuilder.h        2016-04-22 23:04:35 UTC (rev 199926)
+++ trunk/Source/JavaScriptCore/parser/ASTBuilder.h        2016-04-22 23:04:55 UTC (rev 199927)
</span><span class="lines">@@ -410,7 +410,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     NEVER_INLINE PropertyNode* createGetterOrSetterProperty(const JSTokenLocation&amp; location, PropertyNode::Type type, bool,
</span><del>-        const Identifier* name, const ParserFunctionInfo&lt;ASTBuilder&gt;&amp; functionInfo, SuperBinding superBinding)
</del><ins>+        const Identifier* name, const ParserFunctionInfo&lt;ASTBuilder&gt;&amp; functionInfo, bool isClassProperty)
</ins><span class="cx">     {
</span><span class="cx">         ASSERT(name);
</span><span class="cx">         functionInfo.body-&gt;setLoc(functionInfo.startLine, functionInfo.endLine, location.startOffset, location.lineStartOffset);
</span><span class="lines">@@ -418,27 +418,27 @@
</span><span class="cx">         functionInfo.body-&gt;setInferredName(*name);
</span><span class="cx">         SourceCode source = m_sourceCode-&gt;subExpression(functionInfo.startOffset, functionInfo.endOffset, functionInfo.startLine, functionInfo.bodyStartColumn);
</span><span class="cx">         MethodDefinitionNode* methodDef = new (m_parserArena) MethodDefinitionNode(location, m_vm-&gt;propertyNames-&gt;nullIdentifier, functionInfo.body, source);
</span><del>-        return new (m_parserArena) PropertyNode(*name, methodDef, type, PropertyNode::Unknown, superBinding);
</del><ins>+        return new (m_parserArena) PropertyNode(*name, methodDef, type, PropertyNode::Unknown, SuperBinding::Needed, isClassProperty);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     NEVER_INLINE PropertyNode* createGetterOrSetterProperty(const JSTokenLocation&amp; location, PropertyNode::Type type, bool,
</span><del>-        ExpressionNode* name, const ParserFunctionInfo&lt;ASTBuilder&gt;&amp; functionInfo, SuperBinding superBinding)
</del><ins>+        ExpressionNode* name, const ParserFunctionInfo&lt;ASTBuilder&gt;&amp; functionInfo, bool isClassProperty)
</ins><span class="cx">     {
</span><span class="cx">         ASSERT(name);
</span><span class="cx">         functionInfo.body-&gt;setLoc(functionInfo.startLine, functionInfo.endLine, location.startOffset, location.lineStartOffset);
</span><span class="cx">         SourceCode source = m_sourceCode-&gt;subExpression(functionInfo.startOffset, functionInfo.endOffset, functionInfo.startLine, functionInfo.bodyStartColumn);
</span><span class="cx">         MethodDefinitionNode* methodDef = new (m_parserArena) MethodDefinitionNode(location, m_vm-&gt;propertyNames-&gt;nullIdentifier, functionInfo.body, source);
</span><del>-        return new (m_parserArena) PropertyNode(name, methodDef, type, PropertyNode::Unknown, superBinding);
</del><ins>+        return new (m_parserArena) PropertyNode(name, methodDef, type, PropertyNode::Unknown, SuperBinding::Needed, isClassProperty);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     NEVER_INLINE PropertyNode* createGetterOrSetterProperty(VM* vm, ParserArena&amp; parserArena, const JSTokenLocation&amp; location, PropertyNode::Type type, bool,
</span><del>-        double name, const ParserFunctionInfo&lt;ASTBuilder&gt;&amp; functionInfo, SuperBinding superBinding)
</del><ins>+        double name, const ParserFunctionInfo&lt;ASTBuilder&gt;&amp; functionInfo, bool isClassProperty)
</ins><span class="cx">     {
</span><span class="cx">         functionInfo.body-&gt;setLoc(functionInfo.startLine, functionInfo.endLine, location.startOffset, location.lineStartOffset);
</span><span class="cx">         const Identifier&amp; ident = parserArena.identifierArena().makeNumericIdentifier(vm, name);
</span><span class="cx">         SourceCode source = m_sourceCode-&gt;subExpression(functionInfo.startOffset, functionInfo.endOffset, functionInfo.startLine, functionInfo.bodyStartColumn);
</span><span class="cx">         MethodDefinitionNode* methodDef = new (m_parserArena) MethodDefinitionNode(location, vm-&gt;propertyNames-&gt;nullIdentifier, functionInfo.body, source);
</span><del>-        return new (m_parserArena) PropertyNode(ident, methodDef, type, PropertyNode::Unknown, superBinding);
</del><ins>+        return new (m_parserArena) PropertyNode(ident, methodDef, type, PropertyNode::Unknown, SuperBinding::Needed, isClassProperty);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     ArgumentsNode* createArguments() { return new (m_parserArena) ArgumentsNode(); }
</span><span class="lines">@@ -446,7 +446,7 @@
</span><span class="cx">     ArgumentListNode* createArgumentsList(const JSTokenLocation&amp; location, ExpressionNode* arg) { return new (m_parserArena) ArgumentListNode(location, arg); }
</span><span class="cx">     ArgumentListNode* createArgumentsList(const JSTokenLocation&amp; location, ArgumentListNode* args, ExpressionNode* arg) { return new (m_parserArena) ArgumentListNode(location, args, arg); }
</span><span class="cx"> 
</span><del>-    PropertyNode* createProperty(const Identifier* propertyName, ExpressionNode* node, PropertyNode::Type type, PropertyNode::PutType putType, bool, SuperBinding superBinding = SuperBinding::NotNeeded)
</del><ins>+    PropertyNode* createProperty(const Identifier* propertyName, ExpressionNode* node, PropertyNode::Type type, PropertyNode::PutType putType, bool, SuperBinding superBinding, bool isClassProperty)
</ins><span class="cx">     {
</span><span class="cx">         if (node-&gt;isFuncExprNode()) {
</span><span class="cx">             auto metadata = static_cast&lt;FuncExprNode*&gt;(node)-&gt;metadata();
</span><span class="lines">@@ -454,13 +454,13 @@
</span><span class="cx">             metadata-&gt;setInferredName(*propertyName);
</span><span class="cx">         } else if (node-&gt;isClassExprNode())
</span><span class="cx">             static_cast&lt;ClassExprNode*&gt;(node)-&gt;setEcmaName(*propertyName);
</span><del>-        return new (m_parserArena) PropertyNode(*propertyName, node, type, putType, superBinding);
</del><ins>+        return new (m_parserArena) PropertyNode(*propertyName, node, type, putType, superBinding, isClassProperty);
</ins><span class="cx">     }
</span><del>-    PropertyNode* createProperty(VM* vm, ParserArena&amp; parserArena, double propertyName, ExpressionNode* node, PropertyNode::Type type, PropertyNode::PutType putType, bool)
</del><ins>+    PropertyNode* createProperty(VM* vm, ParserArena&amp; parserArena, double propertyName, ExpressionNode* node, PropertyNode::Type type, PropertyNode::PutType putType, bool, SuperBinding superBinding, bool isClassProperty)
</ins><span class="cx">     {
</span><del>-        return new (m_parserArena) PropertyNode(parserArena.identifierArena().makeNumericIdentifier(vm, propertyName), node, type, putType);
</del><ins>+        return new (m_parserArena) PropertyNode(parserArena.identifierArena().makeNumericIdentifier(vm, propertyName), node, type, putType, superBinding, isClassProperty);
</ins><span class="cx">     }
</span><del>-    PropertyNode* createProperty(ExpressionNode* propertyName, ExpressionNode* node, PropertyNode::Type type, PropertyNode::PutType putType, bool, SuperBinding superBinding = SuperBinding::NotNeeded) { return new (m_parserArena) PropertyNode(propertyName, node, type, putType, superBinding); }
</del><ins>+    PropertyNode* createProperty(ExpressionNode* propertyName, ExpressionNode* node, PropertyNode::Type type, PropertyNode::PutType putType, bool, SuperBinding superBinding, bool isClassProperty) { return new (m_parserArena) PropertyNode(propertyName, node, type, putType, superBinding, isClassProperty); }
</ins><span class="cx">     PropertyListNode* createPropertyList(const JSTokenLocation&amp; location, PropertyNode* property) { return new (m_parserArena) PropertyListNode(location, property); }
</span><span class="cx">     PropertyListNode* createPropertyList(const JSTokenLocation&amp; location, PropertyNode* property, PropertyListNode* tail) { return new (m_parserArena) PropertyListNode(location, property, tail); }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreparserNodeConstructorsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/parser/NodeConstructors.h (199926 => 199927)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/parser/NodeConstructors.h        2016-04-22 23:04:35 UTC (rev 199926)
+++ trunk/Source/JavaScriptCore/parser/NodeConstructors.h        2016-04-22 23:04:55 UTC (rev 199927)
</span><span class="lines">@@ -220,22 +220,24 @@
</span><span class="cx">     {
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    inline PropertyNode::PropertyNode(const Identifier&amp; name, ExpressionNode* assign, Type type, PutType putType, SuperBinding superBinding = SuperBinding::NotNeeded)
</del><ins>+    inline PropertyNode::PropertyNode(const Identifier&amp; name, ExpressionNode* assign, Type type, PutType putType, SuperBinding superBinding, bool isClassProperty)
</ins><span class="cx">         : m_name(&amp;name)
</span><span class="cx">         , m_assign(assign)
</span><span class="cx">         , m_type(type)
</span><span class="cx">         , m_needsSuperBinding(superBinding == SuperBinding::Needed)
</span><span class="cx">         , m_putType(putType)
</span><ins>+        , m_isClassProperty(isClassProperty)
</ins><span class="cx">     {
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    inline PropertyNode::PropertyNode(ExpressionNode* name, ExpressionNode* assign, Type type, PutType putType, SuperBinding superBinding = SuperBinding::NotNeeded)
</del><ins>+    inline PropertyNode::PropertyNode(ExpressionNode* name, ExpressionNode* assign, Type type, PutType putType, SuperBinding superBinding, bool isClassProperty)
</ins><span class="cx">         : m_name(0)
</span><span class="cx">         , m_expression(name)
</span><span class="cx">         , m_assign(assign)
</span><span class="cx">         , m_type(type)
</span><span class="cx">         , m_needsSuperBinding(superBinding == SuperBinding::Needed)
</span><span class="cx">         , m_putType(putType)
</span><ins>+        , m_isClassProperty(isClassProperty)
</ins><span class="cx">     {
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreparserNodesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/parser/Nodes.h (199926 => 199927)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/parser/Nodes.h        2016-04-22 23:04:35 UTC (rev 199926)
+++ trunk/Source/JavaScriptCore/parser/Nodes.h        2016-04-22 23:04:55 UTC (rev 199927)
</span><span class="lines">@@ -626,14 +626,15 @@
</span><span class="cx">         enum Type { Constant = 1, Getter = 2, Setter = 4, Computed = 8, Shorthand = 16 };
</span><span class="cx">         enum PutType { Unknown, KnownDirect };
</span><span class="cx"> 
</span><del>-        PropertyNode(const Identifier&amp;, ExpressionNode*, Type, PutType, SuperBinding);
-        PropertyNode(ExpressionNode* propertyName, ExpressionNode*, Type, PutType, SuperBinding);
</del><ins>+        PropertyNode(const Identifier&amp;, ExpressionNode*, Type, PutType, SuperBinding, bool isClassProperty);
+        PropertyNode(ExpressionNode* propertyName, ExpressionNode*, Type, PutType, SuperBinding, bool isClassProperty);
</ins><span class="cx"> 
</span><span class="cx">         ExpressionNode* expressionName() const { return m_expression; }
</span><span class="cx">         const Identifier* name() const { return m_name; }
</span><span class="cx"> 
</span><span class="cx">         Type type() const { return static_cast&lt;Type&gt;(m_type); }
</span><span class="cx">         bool needsSuperBinding() const { return m_needsSuperBinding; }
</span><ins>+        bool isClassProperty() const { return m_isClassProperty; }
</ins><span class="cx">         PutType putType() const { return static_cast&lt;PutType&gt;(m_putType); }
</span><span class="cx"> 
</span><span class="cx">     private:
</span><span class="lines">@@ -644,6 +645,7 @@
</span><span class="cx">         unsigned m_type : 5;
</span><span class="cx">         unsigned m_needsSuperBinding : 1;
</span><span class="cx">         unsigned m_putType : 1;
</span><ins>+        unsigned m_isClassProperty: 1;
</ins><span class="cx">     };
</span><span class="cx"> 
</span><span class="cx">     class PropertyListNode : public ExpressionNode {
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreparserParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/parser/Parser.cpp (199926 => 199927)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/parser/Parser.cpp        2016-04-22 23:04:35 UTC (rev 199926)
+++ trunk/Source/JavaScriptCore/parser/Parser.cpp        2016-04-22 23:04:55 UTC (rev 199927)
</span><span class="lines">@@ -2078,9 +2078,9 @@
</span><span class="cx">         if  (generatorBodyScope-&gt;strictMode())
</span><span class="cx">             functionScope-&gt;setStrictMode();
</span><span class="cx"> 
</span><del>-        semanticFailIfTrue(generatorBodyScope-&gt;hasDirectSuper(), &quot;Cannot call super() outside of a class constructor&quot;);
</del><ins>+        semanticFailIfTrue(generatorBodyScope-&gt;hasDirectSuper(), &quot;super is not valid in this context&quot;);
</ins><span class="cx">         if (generatorBodyScope-&gt;needsSuperBinding())
</span><del>-            semanticFailIfTrue(expectedSuperBinding == SuperBinding::NotNeeded, &quot;super can only be used in a method of a derived class&quot;);
</del><ins>+            semanticFailIfTrue(expectedSuperBinding == SuperBinding::NotNeeded, &quot;super is not valid in this context&quot;);
</ins><span class="cx"> 
</span><span class="cx">         popScope(generatorBodyScope, TreeBuilder::NeedsFreeVariableInfo);
</span><span class="cx">     } else
</span><span class="lines">@@ -2103,15 +2103,15 @@
</span><span class="cx">             ConstructorKind functionConstructorKind = functionBodyType == StandardFunctionBodyBlock &amp;&amp; !scopeRef-&gt;isEvalContext()
</span><span class="cx">                 ? constructorKind
</span><span class="cx">                 : scopeRef-&gt;constructorKind();
</span><del>-            semanticFailIfTrue(functionConstructorKind == ConstructorKind::None, &quot;Cannot call super() outside of a class constructor&quot;);
-            semanticFailIfTrue(functionConstructorKind != ConstructorKind::Derived, &quot;Cannot call super() in a base class constructor&quot;);
</del><ins>+            semanticFailIfTrue(functionConstructorKind == ConstructorKind::None, &quot;super is not valid in this context&quot;);
+            semanticFailIfTrue(functionConstructorKind != ConstructorKind::Derived, &quot;super is not valid in this context&quot;);
</ins><span class="cx">         }
</span><span class="cx">         if (functionScope-&gt;needsSuperBinding()) {
</span><span class="cx">             ScopeRef scopeRef = closestParentOrdinaryFunctionNonLexicalScope();
</span><span class="cx">             SuperBinding functionSuperBinding = functionBodyType == StandardFunctionBodyBlock &amp;&amp; !scopeRef-&gt;isEvalContext()
</span><span class="cx">                 ? expectedSuperBinding
</span><span class="cx">                 : scopeRef-&gt;expectedSuperBinding();
</span><del>-            semanticFailIfTrue(functionSuperBinding == SuperBinding::NotNeeded, &quot;super can only be used in a method of a derived class&quot;);
</del><ins>+            semanticFailIfTrue(functionSuperBinding == SuperBinding::NotNeeded, &quot;super is not valid in this context&quot;);
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -2335,8 +2335,9 @@
</span><span class="cx">         TreeProperty property;
</span><span class="cx">         const bool alwaysStrictInsideClass = true;
</span><span class="cx">         if (isGetter || isSetter) {
</span><ins>+            bool isClassProperty = true;
</ins><span class="cx">             property = parseGetterSetter(context, alwaysStrictInsideClass, isGetter ? PropertyNode::Getter : PropertyNode::Setter, methodStart,
</span><del>-                ConstructorKind::None, SuperBinding::Needed);
</del><ins>+                ConstructorKind::None, isClassProperty);
</ins><span class="cx">             failIfFalse(property, &quot;Cannot parse this method&quot;);
</span><span class="cx">         } else {
</span><span class="cx">             ParserFunctionInfo&lt;TreeBuilder&gt; methodInfo;
</span><span class="lines">@@ -2361,11 +2362,13 @@
</span><span class="cx">             // FIXME: Syntax error when super() is called
</span><span class="cx">             semanticFailIfTrue(isStaticMethod &amp;&amp; methodInfo.name &amp;&amp; *methodInfo.name == propertyNames.prototype,
</span><span class="cx">                 &quot;Cannot declare a static method named 'prototype'&quot;);
</span><ins>+
+            bool isClassProperty = true;
</ins><span class="cx">             if (computedPropertyName) {
</span><span class="cx">                 property = context.createProperty(computedPropertyName, method, static_cast&lt;PropertyNode::Type&gt;(PropertyNode::Constant | PropertyNode::Computed),
</span><del>-                    PropertyNode::Unknown, alwaysStrictInsideClass, SuperBinding::Needed);
</del><ins>+                    PropertyNode::Unknown, alwaysStrictInsideClass, SuperBinding::Needed, isClassProperty);
</ins><span class="cx">             } else
</span><del>-                property = context.createProperty(methodInfo.name, method, PropertyNode::Constant, PropertyNode::Unknown, alwaysStrictInsideClass, SuperBinding::Needed);
</del><ins>+                property = context.createProperty(methodInfo.name, method, PropertyNode::Constant, PropertyNode::Unknown, alwaysStrictInsideClass, SuperBinding::Needed, isClassProperty);
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         TreePropertyList&amp; tail = isStaticMethod ? staticMethodsTail : instanceMethodsTail;
</span><span class="lines">@@ -3257,6 +3260,7 @@
</span><span class="cx"> {
</span><span class="cx">     bool wasIdent = false;
</span><span class="cx">     bool isGenerator = false;
</span><ins>+    bool isClassProperty = false;
</ins><span class="cx"> #if ENABLE(ES6_GENERATORS)
</span><span class="cx">     if (consume(TIMES))
</span><span class="cx">         isGenerator = true;
</span><span class="lines">@@ -3279,13 +3283,13 @@
</span><span class="cx">             TreeExpression node = parseAssignmentExpressionOrPropagateErrorClass(context);
</span><span class="cx">             failIfFalse(node, &quot;Cannot parse expression for property declaration&quot;);
</span><span class="cx">             context.setEndOffset(node, m_lexer-&gt;currentOffset());
</span><del>-            return context.createProperty(ident, node, PropertyNode::Constant, PropertyNode::Unknown, complete);
</del><ins>+            return context.createProperty(ident, node, PropertyNode::Constant, PropertyNode::Unknown, complete, SuperBinding::NotNeeded, isClassProperty);
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         if (match(OPENPAREN)) {
</span><span class="cx">             auto method = parsePropertyMethod(context, ident, isGenerator);
</span><span class="cx">             propagateError();
</span><del>-            return context.createProperty(ident, method, PropertyNode::Constant, PropertyNode::KnownDirect, complete);
</del><ins>+            return context.createProperty(ident, method, PropertyNode::Constant, PropertyNode::KnownDirect, complete, SuperBinding::Needed, isClassProperty);
</ins><span class="cx">         }
</span><span class="cx">         failIfTrue(isGenerator, &quot;Expected a parenthesis for argument list&quot;);
</span><span class="cx"> 
</span><span class="lines">@@ -3298,7 +3302,7 @@
</span><span class="cx">             if (currentScope()-&gt;isArrowFunction())
</span><span class="cx">                 currentScope()-&gt;setInnerArrowFunctionUsesEval();
</span><span class="cx">             TreeExpression node = context.createResolve(location, *ident, start, lastTokenEndPosition());
</span><del>-            return context.createProperty(ident, node, static_cast&lt;PropertyNode::Type&gt;(PropertyNode::Constant | PropertyNode::Shorthand), PropertyNode::KnownDirect, complete);
</del><ins>+            return context.createProperty(ident, node, static_cast&lt;PropertyNode::Type&gt;(PropertyNode::Constant | PropertyNode::Shorthand), PropertyNode::KnownDirect, complete, SuperBinding::NotNeeded, isClassProperty);
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         if (match(EQUAL)) // CoverInitializedName is exclusive to BindingPattern and AssignmentPattern
</span><span class="lines">@@ -3311,7 +3315,7 @@
</span><span class="cx">             type = PropertyNode::Setter;
</span><span class="cx">         else
</span><span class="cx">             failWithMessage(&quot;Expected a ':' following the property name '&quot;, ident-&gt;impl(), &quot;'&quot;);
</span><del>-        return parseGetterSetter(context, complete, type, getterOrSetterStartOffset);
</del><ins>+        return parseGetterSetter(context, complete, type, getterOrSetterStartOffset, ConstructorKind::None, isClassProperty);
</ins><span class="cx">     }
</span><span class="cx">     case DOUBLE:
</span><span class="cx">     case INTEGER: {
</span><span class="lines">@@ -3322,7 +3326,7 @@
</span><span class="cx">             const Identifier&amp; ident = m_parserArena.identifierArena().makeNumericIdentifier(const_cast&lt;VM*&gt;(m_vm), propertyName);
</span><span class="cx">             auto method = parsePropertyMethod(context, &amp;ident, isGenerator);
</span><span class="cx">             propagateError();
</span><del>-            return context.createProperty(&amp;ident, method, PropertyNode::Constant, PropertyNode::Unknown, complete);
</del><ins>+            return context.createProperty(&amp;ident, method, PropertyNode::Constant, PropertyNode::Unknown, complete, SuperBinding::Needed, isClassProperty);
</ins><span class="cx">         }
</span><span class="cx">         failIfTrue(isGenerator, &quot;Expected a parenthesis for argument list&quot;);
</span><span class="cx"> 
</span><span class="lines">@@ -3330,7 +3334,7 @@
</span><span class="cx">         TreeExpression node = parseAssignmentExpression(context);
</span><span class="cx">         failIfFalse(node, &quot;Cannot parse expression for property declaration&quot;);
</span><span class="cx">         context.setEndOffset(node, m_lexer-&gt;currentOffset());
</span><del>-        return context.createProperty(const_cast&lt;VM*&gt;(m_vm), m_parserArena, propertyName, node, PropertyNode::Constant, PropertyNode::Unknown, complete);
</del><ins>+        return context.createProperty(const_cast&lt;VM*&gt;(m_vm), m_parserArena, propertyName, node, PropertyNode::Constant, PropertyNode::Unknown, complete, SuperBinding::NotNeeded, isClassProperty);
</ins><span class="cx">     }
</span><span class="cx">     case OPENBRACKET: {
</span><span class="cx">         next();
</span><span class="lines">@@ -3341,7 +3345,7 @@
</span><span class="cx">         if (match(OPENPAREN)) {
</span><span class="cx">             auto method = parsePropertyMethod(context, &amp;m_vm-&gt;propertyNames-&gt;nullIdentifier, isGenerator);
</span><span class="cx">             propagateError();
</span><del>-            return context.createProperty(propertyName, method, static_cast&lt;PropertyNode::Type&gt;(PropertyNode::Constant | PropertyNode::Computed), PropertyNode::KnownDirect, complete);
</del><ins>+            return context.createProperty(propertyName, method, static_cast&lt;PropertyNode::Type&gt;(PropertyNode::Constant | PropertyNode::Computed), PropertyNode::KnownDirect, complete, SuperBinding::Needed, isClassProperty);
</ins><span class="cx">         }
</span><span class="cx">         failIfTrue(isGenerator, &quot;Expected a parenthesis for argument list&quot;);
</span><span class="cx"> 
</span><span class="lines">@@ -3349,7 +3353,7 @@
</span><span class="cx">         TreeExpression node = parseAssignmentExpression(context);
</span><span class="cx">         failIfFalse(node, &quot;Cannot parse expression for property declaration&quot;);
</span><span class="cx">         context.setEndOffset(node, m_lexer-&gt;currentOffset());
</span><del>-        return context.createProperty(propertyName, node, static_cast&lt;PropertyNode::Type&gt;(PropertyNode::Constant | PropertyNode::Computed), PropertyNode::Unknown, complete);
</del><ins>+        return context.createProperty(propertyName, node, static_cast&lt;PropertyNode::Type&gt;(PropertyNode::Constant | PropertyNode::Computed), PropertyNode::Unknown, complete, SuperBinding::NotNeeded, isClassProperty);
</ins><span class="cx">     }
</span><span class="cx">     default:
</span><span class="cx">         failIfFalse(m_token.m_type &amp; KeywordTokenFlag, &quot;Expected a property name&quot;);
</span><span class="lines">@@ -3364,14 +3368,14 @@
</span><span class="cx">     unsigned methodStart = tokenStart();
</span><span class="cx">     ParserFunctionInfo&lt;TreeBuilder&gt; methodInfo;
</span><span class="cx">     SourceParseMode parseMode = isGenerator ? SourceParseMode::GeneratorWrapperFunctionMode : SourceParseMode::MethodMode;
</span><del>-    failIfFalse((parseFunctionInfo(context, FunctionNoRequirements, parseMode, false, ConstructorKind::None, SuperBinding::NotNeeded, methodStart, methodInfo, FunctionDefinitionType::Method)), &quot;Cannot parse this method&quot;);
</del><ins>+    failIfFalse((parseFunctionInfo(context, FunctionNoRequirements, parseMode, false, ConstructorKind::None, SuperBinding::Needed, methodStart, methodInfo, FunctionDefinitionType::Method)), &quot;Cannot parse this method&quot;);
</ins><span class="cx">     methodInfo.name = methodName;
</span><span class="cx">     return context.createMethodDefinition(methodLocation, methodInfo);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> template &lt;typename LexerType&gt;
</span><span class="cx"> template &lt;class TreeBuilder&gt; TreeProperty Parser&lt;LexerType&gt;::parseGetterSetter(TreeBuilder&amp; context, bool strict, PropertyNode::Type type, unsigned getterOrSetterStartOffset,
</span><del>-    ConstructorKind constructorKind, SuperBinding superBinding)
</del><ins>+    ConstructorKind constructorKind, bool isClassProperty)
</ins><span class="cx"> {
</span><span class="cx">     const Identifier* stringPropertyName = 0;
</span><span class="cx">     double numericPropertyName = 0;
</span><span class="lines">@@ -3381,9 +3385,9 @@
</span><span class="cx"> 
</span><span class="cx">     if (matchSpecIdentifier() || match(STRING) || m_token.m_type &amp; KeywordTokenFlag) {
</span><span class="cx">         stringPropertyName = m_token.m_data.ident;
</span><del>-        semanticFailIfTrue(superBinding == SuperBinding::Needed &amp;&amp; *stringPropertyName == m_vm-&gt;propertyNames-&gt;prototype,
</del><ins>+        semanticFailIfTrue(isClassProperty &amp;&amp; *stringPropertyName == m_vm-&gt;propertyNames-&gt;prototype,
</ins><span class="cx">             &quot;Cannot declare a static method named 'prototype'&quot;);
</span><del>-        semanticFailIfTrue(superBinding == SuperBinding::Needed &amp;&amp; *stringPropertyName == m_vm-&gt;propertyNames-&gt;constructor,
</del><ins>+        semanticFailIfTrue(isClassProperty &amp;&amp; *stringPropertyName == m_vm-&gt;propertyNames-&gt;constructor,
</ins><span class="cx">             &quot;Cannot declare a getter or setter named 'constructor'&quot;);
</span><span class="cx">         next();
</span><span class="cx">     } else if (match(DOUBLE) || match(INTEGER)) {
</span><span class="lines">@@ -3400,19 +3404,19 @@
</span><span class="cx">     ParserFunctionInfo&lt;TreeBuilder&gt; info;
</span><span class="cx">     if (type &amp; PropertyNode::Getter) {
</span><span class="cx">         failIfFalse(match(OPENPAREN), &quot;Expected a parameter list for getter definition&quot;);
</span><del>-        failIfFalse((parseFunctionInfo(context, FunctionNoRequirements, SourceParseMode::GetterMode, false, constructorKind, superBinding, getterOrSetterStartOffset, info, FunctionDefinitionType::Method)), &quot;Cannot parse getter definition&quot;);
</del><ins>+        failIfFalse((parseFunctionInfo(context, FunctionNoRequirements, SourceParseMode::GetterMode, false, constructorKind, SuperBinding::Needed, getterOrSetterStartOffset, info, FunctionDefinitionType::Method)), &quot;Cannot parse getter definition&quot;);
</ins><span class="cx">     } else {
</span><span class="cx">         failIfFalse(match(OPENPAREN), &quot;Expected a parameter list for setter definition&quot;);
</span><del>-        failIfFalse((parseFunctionInfo(context, FunctionNoRequirements, SourceParseMode::SetterMode, false, constructorKind, superBinding, getterOrSetterStartOffset, info, FunctionDefinitionType::Method)), &quot;Cannot parse setter definition&quot;);
</del><ins>+        failIfFalse((parseFunctionInfo(context, FunctionNoRequirements, SourceParseMode::SetterMode, false, constructorKind, SuperBinding::Needed, getterOrSetterStartOffset, info, FunctionDefinitionType::Method)), &quot;Cannot parse setter definition&quot;);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (stringPropertyName)
</span><del>-        return context.createGetterOrSetterProperty(location, type, strict, stringPropertyName, info, superBinding);
</del><ins>+        return context.createGetterOrSetterProperty(location, type, strict, stringPropertyName, info, isClassProperty);
</ins><span class="cx"> 
</span><span class="cx">     if (computedPropertyName)
</span><del>-        return context.createGetterOrSetterProperty(location, static_cast&lt;PropertyNode::Type&gt;(type | PropertyNode::Computed), strict, computedPropertyName, info, superBinding);
</del><ins>+        return context.createGetterOrSetterProperty(location, static_cast&lt;PropertyNode::Type&gt;(type | PropertyNode::Computed), strict, computedPropertyName, info, isClassProperty);
</ins><span class="cx"> 
</span><del>-    return context.createGetterOrSetterProperty(const_cast&lt;VM*&gt;(m_vm), m_parserArena, location, type, strict, numericPropertyName, info, superBinding);
</del><ins>+    return context.createGetterOrSetterProperty(const_cast&lt;VM*&gt;(m_vm), m_parserArena, location, type, strict, numericPropertyName, info, isClassProperty);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> template &lt;typename LexerType&gt;
</span><span class="lines">@@ -3894,7 +3898,7 @@
</span><span class="cx"> 
</span><span class="cx">     if (baseIsSuper) {
</span><span class="cx">         ScopeRef scopeRef = closestParentOrdinaryFunctionNonLexicalScope();
</span><del>-        semanticFailIfFalse(currentScope()-&gt;isFunction() || (scopeRef-&gt;isEvalContext() &amp;&amp; scopeRef-&gt;expectedSuperBinding() == SuperBinding::Needed), &quot;'super' is only valid inside a function or an 'eval' inside a function&quot;);
</del><ins>+        semanticFailIfFalse(currentScope()-&gt;isFunction() || (scopeRef-&gt;isEvalContext() &amp;&amp; scopeRef-&gt;expectedSuperBinding() == SuperBinding::Needed), &quot;super is not valid in this context&quot;);
</ins><span class="cx">         base = context.createSuperExpr(location);
</span><span class="cx">         next();
</span><span class="cx">         currentFunctionScope()-&gt;setNeedsSuperBinding();
</span><span class="lines">@@ -3972,7 +3976,7 @@
</span><span class="cx">         baseIsSuper = false;
</span><span class="cx">     }
</span><span class="cx"> endMemberExpression:
</span><del>-    semanticFailIfTrue(baseIsSuper, &quot;Cannot reference super&quot;);
</del><ins>+    semanticFailIfTrue(baseIsSuper, &quot;super is not valid in this context&quot;);
</ins><span class="cx">     while (newCount--)
</span><span class="cx">         base = context.createNewExpr(location, base, expressionStart, lastTokenEndPosition());
</span><span class="cx">     return base;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreparserParserh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/parser/Parser.h (199926 => 199927)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/parser/Parser.h        2016-04-22 23:04:35 UTC (rev 199926)
+++ trunk/Source/JavaScriptCore/parser/Parser.h        2016-04-22 23:04:55 UTC (rev 199927)
</span><span class="lines">@@ -1388,7 +1388,7 @@
</span><span class="cx">     template &lt;class TreeBuilder&gt; ALWAYS_INLINE TreeExpression parseArgument(TreeBuilder&amp;, ArgumentType&amp;);
</span><span class="cx">     template &lt;class TreeBuilder&gt; TreeProperty parseProperty(TreeBuilder&amp;, bool strict);
</span><span class="cx">     template &lt;class TreeBuilder&gt; TreeExpression parsePropertyMethod(TreeBuilder&amp; context, const Identifier* methodName, bool isGenerator);
</span><del>-    template &lt;class TreeBuilder&gt; TreeProperty parseGetterSetter(TreeBuilder&amp;, bool strict, PropertyNode::Type, unsigned getterOrSetterStartOffset, ConstructorKind = ConstructorKind::None, SuperBinding = SuperBinding::NotNeeded);
</del><ins>+    template &lt;class TreeBuilder&gt; TreeProperty parseGetterSetter(TreeBuilder&amp;, bool strict, PropertyNode::Type, unsigned getterOrSetterStartOffset, ConstructorKind, bool isClassProperty);
</ins><span class="cx">     template &lt;class TreeBuilder&gt; ALWAYS_INLINE TreeFunctionBody parseFunctionBody(TreeBuilder&amp;, const JSTokenLocation&amp;, int, int functionKeywordStart, int functionNameStart, int parametersStart, ConstructorKind, SuperBinding, FunctionBodyType, unsigned, SourceParseMode);
</span><span class="cx">     template &lt;class TreeBuilder&gt; ALWAYS_INLINE bool parseFormalParameters(TreeBuilder&amp;, TreeFormalParameterList, unsigned&amp;);
</span><span class="cx">     enum VarDeclarationListContext { ForLoopContext, VarDeclarationContext };
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreparserSyntaxCheckerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/parser/SyntaxChecker.h (199926 => 199927)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/parser/SyntaxChecker.h        2016-04-22 23:04:35 UTC (rev 199926)
+++ trunk/Source/JavaScriptCore/parser/SyntaxChecker.h        2016-04-22 23:04:55 UTC (rev 199927)
</span><span class="lines">@@ -202,20 +202,20 @@
</span><span class="cx"> 
</span><span class="cx">     int createArgumentsList(const JSTokenLocation&amp;, int) { return ArgumentsListResult; }
</span><span class="cx">     int createArgumentsList(const JSTokenLocation&amp;, int, int) { return ArgumentsListResult; }
</span><del>-    Property createProperty(const Identifier* name, int, PropertyNode::Type type, PropertyNode::PutType, bool complete, SuperBinding = SuperBinding::NotNeeded)
</del><ins>+    Property createProperty(const Identifier* name, int, PropertyNode::Type type, PropertyNode::PutType, bool complete, SuperBinding, bool)
</ins><span class="cx">     {
</span><span class="cx">         if (!complete)
</span><span class="cx">             return Property(type);
</span><span class="cx">         ASSERT(name);
</span><span class="cx">         return Property(name, type);
</span><span class="cx">     }
</span><del>-    Property createProperty(VM* vm, ParserArena&amp; parserArena, double name, int, PropertyNode::Type type, PropertyNode::PutType, bool complete)
</del><ins>+    Property createProperty(VM* vm, ParserArena&amp; parserArena, double name, int, PropertyNode::Type type, PropertyNode::PutType, bool complete, SuperBinding, bool)
</ins><span class="cx">     {
</span><span class="cx">         if (!complete)
</span><span class="cx">             return Property(type);
</span><span class="cx">         return Property(&amp;parserArena.identifierArena().makeNumericIdentifier(vm, name), type);
</span><span class="cx">     }
</span><del>-    Property createProperty(int, int, PropertyNode::Type type, PropertyNode::PutType, bool, SuperBinding = SuperBinding::NotNeeded)
</del><ins>+    Property createProperty(int, int, PropertyNode::Type type, PropertyNode::PutType, bool, SuperBinding, bool)
</ins><span class="cx">     {
</span><span class="cx">         return Property(type);
</span><span class="cx">     }
</span><span class="lines">@@ -269,18 +269,18 @@
</span><span class="cx">     void appendExportSpecifier(ExportSpecifierList, ExportSpecifier) { }
</span><span class="cx"> 
</span><span class="cx">     int appendConstDecl(const JSTokenLocation&amp;, int, const Identifier*, int) { return StatementResult; }
</span><del>-    Property createGetterOrSetterProperty(const JSTokenLocation&amp;, PropertyNode::Type type, bool strict, const Identifier* name, const ParserFunctionInfo&lt;SyntaxChecker&gt;&amp;, SuperBinding)
</del><ins>+    Property createGetterOrSetterProperty(const JSTokenLocation&amp;, PropertyNode::Type type, bool strict, const Identifier* name, const ParserFunctionInfo&lt;SyntaxChecker&gt;&amp;, bool)
</ins><span class="cx">     {
</span><span class="cx">         ASSERT(name);
</span><span class="cx">         if (!strict)
</span><span class="cx">             return Property(type);
</span><span class="cx">         return Property(name, type);
</span><span class="cx">     }
</span><del>-    Property createGetterOrSetterProperty(const JSTokenLocation&amp;, PropertyNode::Type type, bool, int, const ParserFunctionInfo&lt;SyntaxChecker&gt;&amp;, SuperBinding)
</del><ins>+    Property createGetterOrSetterProperty(const JSTokenLocation&amp;, PropertyNode::Type type, bool, int, const ParserFunctionInfo&lt;SyntaxChecker&gt;&amp;, bool)
</ins><span class="cx">     {
</span><span class="cx">         return Property(type);
</span><span class="cx">     }
</span><del>-    Property createGetterOrSetterProperty(VM* vm, ParserArena&amp; parserArena, const JSTokenLocation&amp;, PropertyNode::Type type, bool strict, double name, const ParserFunctionInfo&lt;SyntaxChecker&gt;&amp;, SuperBinding)
</del><ins>+    Property createGetterOrSetterProperty(VM* vm, ParserArena&amp; parserArena, const JSTokenLocation&amp;, PropertyNode::Type type, bool strict, double name, const ParserFunctionInfo&lt;SyntaxChecker&gt;&amp;, bool)
</ins><span class="cx">     {
</span><span class="cx">         if (!strict)
</span><span class="cx">             return Property(type);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoretestsstressgeneratorwithsuperjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/tests/stress/generator-with-super.js (199926 => 199927)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/tests/stress/generator-with-super.js        2016-04-22 23:04:35 UTC (rev 199926)
+++ trunk/Source/JavaScriptCore/tests/stress/generator-with-super.js        2016-04-22 23:04:55 UTC (rev 199927)
</span><span class="lines">@@ -23,7 +23,7 @@
</span><span class="cx">         return eval('super');
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    shouldThrow(() =&gt; test(), &quot;SyntaxError: 'super' is only valid inside a function or an 'eval' inside a function.&quot;);
</del><ins>+    shouldThrow(() =&gt; test(), &quot;SyntaxError: super is not valid in this context.&quot;);
</ins><span class="cx"> }());
</span><span class="cx"> 
</span><span class="cx"> (function () {
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoretestsstressmodulessyntaxerrorjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/tests/stress/modules-syntax-error.js (199926 => 199927)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/tests/stress/modules-syntax-error.js        2016-04-22 23:04:35 UTC (rev 199926)
+++ trunk/Source/JavaScriptCore/tests/stress/modules-syntax-error.js        2016-04-22 23:04:55 UTC (rev 199927)
</span><span class="lines">@@ -307,12 +307,12 @@
</span><span class="cx"> 
</span><span class="cx"> checkModuleSyntaxError(String.raw`
</span><span class="cx"> super();
</span><del>-`, `SyntaxError: 'super' is only valid inside a function or an 'eval' inside a function.:2`);
</del><ins>+`, `SyntaxError: super is not valid in this context.:2`);
</ins><span class="cx"> 
</span><span class="cx"> checkModuleSyntaxError(String.raw`
</span><span class="cx"> super.test();
</span><del>-`, `SyntaxError: 'super' is only valid inside a function or an 'eval' inside a function.:2`);
</del><ins>+`, `SyntaxError: super is not valid in this context.:2`);
</ins><span class="cx"> 
</span><span class="cx"> checkModuleSyntaxError(String.raw`
</span><span class="cx"> super.test = 20;
</span><del>-`, `SyntaxError: 'super' is only valid inside a function or an 'eval' inside a function.:2`);
</del><ins>+`, `SyntaxError: super is not valid in this context.:2`);
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoretestsstresssuperinlexicalscopejs"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/tests/stress/super-in-lexical-scope.js (199926 => 199927)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/tests/stress/super-in-lexical-scope.js        2016-04-22 23:04:35 UTC (rev 199926)
+++ trunk/Source/JavaScriptCore/tests/stress/super-in-lexical-scope.js        2016-04-22 23:04:55 UTC (rev 199927)
</span><span class="lines">@@ -18,33 +18,33 @@
</span><span class="cx">         throw new Error(&quot;Expected syntax error not thrown&quot;);
</span><span class="cx"> 
</span><span class="cx">     if (String(error) !== message)
</span><del>-        throw new Error(&quot;Bad error: &quot; + String(error));
</del><ins>+        throw new Error(&quot;Bad error: &quot; + String(error) + &quot;(Expected: &quot; + message + &quot;)&quot;);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-testSyntaxError(`super()`, `SyntaxError: 'super' is only valid inside a function or an 'eval' inside a function.`);
-testSyntaxError(`super.hello()`, `SyntaxError: 'super' is only valid inside a function or an 'eval' inside a function.`);
</del><ins>+testSyntaxError(`super()`, `SyntaxError: super is not valid in this context.`);
+testSyntaxError(`super.hello()`, `SyntaxError: super is not valid in this context.`);
</ins><span class="cx"> testSyntaxError(`
</span><span class="cx"> {
</span><span class="cx">     super();
</span><span class="cx"> }
</span><del>-`, `SyntaxError: 'super' is only valid inside a function or an 'eval' inside a function.`);
</del><ins>+`, `SyntaxError: super is not valid in this context.`);
</ins><span class="cx"> testSyntaxError(`
</span><span class="cx"> {
</span><span class="cx">     super.hello();
</span><span class="cx"> }
</span><del>-`, `SyntaxError: 'super' is only valid inside a function or an 'eval' inside a function.`);
</del><ins>+`, `SyntaxError: super is not valid in this context.`);
</ins><span class="cx"> testSyntaxError(`
</span><span class="cx"> function test()
</span><span class="cx"> {
</span><span class="cx">     super();
</span><span class="cx"> }
</span><del>-`, `SyntaxError: Cannot call super() outside of a class constructor.`);
</del><ins>+`, `SyntaxError: super is not valid in this context.`);
</ins><span class="cx"> testSyntaxError(`
</span><span class="cx"> function test()
</span><span class="cx"> {
</span><span class="cx">     super.hello();
</span><span class="cx"> }
</span><del>-`, `SyntaxError: super can only be used in a method of a derived class.`);
</del><ins>+`, `SyntaxError: super is not valid in this context.`);
</ins><span class="cx"> testSyntaxError(`
</span><span class="cx"> function test()
</span><span class="cx"> {
</span><span class="lines">@@ -52,7 +52,7 @@
</span><span class="cx">         super();
</span><span class="cx">     }
</span><span class="cx"> }
</span><del>-`, `SyntaxError: Cannot call super() outside of a class constructor.`);
</del><ins>+`, `SyntaxError: super is not valid in this context.`);
</ins><span class="cx"> testSyntaxError(`
</span><span class="cx"> function test()
</span><span class="cx"> {
</span><span class="lines">@@ -60,4 +60,4 @@
</span><span class="cx">         super.hello();
</span><span class="cx">     }
</span><span class="cx"> }
</span><del>-`, `SyntaxError: super can only be used in a method of a derived class.`);
</del><ins>+`, `SyntaxError: super is not valid in this context.`);
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoretestsstresstaggedtemplatessyntaxjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/tests/stress/tagged-templates-syntax.js (199926 => 199927)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/tests/stress/tagged-templates-syntax.js        2016-04-22 23:04:35 UTC (rev 199926)
+++ trunk/Source/JavaScriptCore/tests/stress/tagged-templates-syntax.js        2016-04-22 23:04:55 UTC (rev 199927)
</span><span class="lines">@@ -66,5 +66,5 @@
</span><span class="cx"> testSyntax(&quot;(class extends Hello { constructor() { super()`${tag} ${tag}` } })&quot;);
</span><span class="cx"> testSyntax(&quot;(class extends Hello { constructor() { super()`${tag}${tag}` } })&quot;);
</span><span class="cx"> 
</span><del>-testSyntaxError(&quot;super`Hello${tag}`&quot;, &quot;SyntaxError: 'super' is only valid inside a function or an 'eval' inside a function.&quot;);
</del><ins>+testSyntaxError(&quot;super`Hello${tag}`&quot;, &quot;SyntaxError: super is not valid in this context.&quot;);
</ins><span class="cx"> testSyntaxError(&quot;(class { say() { super`Hello${tag}` } })&quot;, &quot;SyntaxError: Cannot use super as tag for tagged templates.&quot;);
</span></span></pre>
</div>
</div>

</body>
</html>