<!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>[181490] 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/181490">181490</a></dd>
<dt>Author</dt> <dd>rniwa@webkit.org</dd>
<dt>Date</dt> <dd>2015-03-13 16:01:51 -0700 (Fri, 13 Mar 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Class constructor should throw TypeError when &quot;called&quot;
https://bugs.webkit.org/show_bug.cgi?id=142566

Reviewed by Michael Saboff.

Source/JavaScriptCore:

Added ConstructorKind::None to denote code that doesn't belong to an ES6 class.
This allows BytecodeGenerator to emit code to throw TypeError when generating code block
to call ES6 class constructors.

Most of changes are about increasing the number of bits to store ConstructorKind from one
bit to two bits.

* bytecode/UnlinkedCodeBlock.cpp:
(JSC::generateFunctionCodeBlock):
(JSC::UnlinkedFunctionExecutable::UnlinkedFunctionExecutable):
(JSC::UnlinkedCodeBlock::UnlinkedCodeBlock):
* bytecode/UnlinkedCodeBlock.h:
(JSC::ExecutableInfo::ExecutableInfo):
(JSC::ExecutableInfo::needsActivation):
(JSC::ExecutableInfo::usesEval):
(JSC::ExecutableInfo::isStrictMode):
(JSC::ExecutableInfo::isConstructor):
(JSC::ExecutableInfo::isBuiltinFunction):
(JSC::ExecutableInfo::constructorKind):
(JSC::UnlinkedFunctionExecutable::constructorKind):
(JSC::UnlinkedCodeBlock::constructorKind):
(JSC::UnlinkedFunctionExecutable::constructorKindIsDerived): Deleted.
(JSC::UnlinkedCodeBlock::constructorKindIsDerived): Deleted.
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::generate): Don't emit bytecode when we had already emitted code
to throw TypeError.
(JSC::BytecodeGenerator::BytecodeGenerator): Emit code to throw TypeError when generating
code to call.
(JSC::BytecodeGenerator::emitReturn):
* bytecompiler/BytecodeGenerator.h:
(JSC::BytecodeGenerator::constructorKind):
(JSC::BytecodeGenerator::constructorKindIsDerived): Deleted.
* bytecompiler/NodesCodegen.cpp:
(JSC::ThisNode::emitBytecode):
(JSC::FunctionCallValueNode::emitBytecode):
* parser/Nodes.cpp:
(JSC::FunctionBodyNode::FunctionBodyNode):
* parser/Nodes.h:
* parser/Parser.cpp:
(JSC::Parser&lt;LexerType&gt;::parseFunctionInfo): Renamed the incoming function argument to
ownerClassKind. Set constructorKind to Base or Derived only if we're parsing a constructor.
(JSC::Parser&lt;LexerType&gt;::parseFunctionDeclaration):
(JSC::Parser&lt;LexerType&gt;::parseClass): Don't parse static methods using MethodMode since that
would result in BytecodeGenerator erroneously treating static method named &quot;constructor&quot; as
a class constructor.
(JSC::Parser&lt;LexerType&gt;::parsePropertyMethod):
(JSC::Parser&lt;LexerType&gt;::parsePrimaryExpression):
* parser/Parser.h:
* parser/ParserModes.h:
* runtime/Executable.h:
(JSC::EvalExecutable::executableInfo):
(JSC::ProgramExecutable::executableInfo):

LayoutTests:

Added tests for calling class constructors.

* TestExpectations: Skipped the test since ES6 class syntax isn't enabled by default.
* js/class-syntax-call-expected.txt: Added.
* js/class-syntax-call.html: Added.
* js/script-tests/class-syntax-call.js: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsTestExpectations">trunk/LayoutTests/TestExpectations</a></li>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecodeUnlinkedCodeBlockcpp">trunk/Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecodeUnlinkedCodeBlockh">trunk/Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.h</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecompilerBytecodeGeneratorcpp">trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecompilerBytecodeGeneratorh">trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecompilerNodesCodegencpp">trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreparserNodescpp">trunk/Source/JavaScriptCore/parser/Nodes.cpp</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="#trunkSourceJavaScriptCoreparserParserModesh">trunk/Source/JavaScriptCore/parser/ParserModes.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeExecutableh">trunk/Source/JavaScriptCore/runtime/Executable.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsjsclasssyntaxcallexpectedtxt">trunk/LayoutTests/js/class-syntax-call-expected.txt</a></li>
<li><a href="#trunkLayoutTestsjsclasssyntaxcallhtml">trunk/LayoutTests/js/class-syntax-call.html</a></li>
<li><a href="#trunkLayoutTestsjsscripttestsclasssyntaxcalljs">trunk/LayoutTests/js/script-tests/class-syntax-call.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (181489 => 181490)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-03-13 22:30:36 UTC (rev 181489)
+++ trunk/LayoutTests/ChangeLog        2015-03-13 23:01:51 UTC (rev 181490)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2015-03-13  Ryosuke Niwa  &lt;rniwa@webkit.org&gt;
+
+        Class constructor should throw TypeError when &quot;called&quot;
+        https://bugs.webkit.org/show_bug.cgi?id=142566
+
+        Reviewed by Michael Saboff.
+
+        Added tests for calling class constructors.
+
+        * TestExpectations: Skipped the test since ES6 class syntax isn't enabled by default.
+        * js/class-syntax-call-expected.txt: Added.
+        * js/class-syntax-call.html: Added.
+        * js/script-tests/class-syntax-call.js: Added.
+
</ins><span class="cx"> 2015-03-13  Doug Russell  &lt;d_russell@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         AX: Provide API for assistive tech to ignore DOM key event handlers
</span></span></pre></div>
<a id="trunkLayoutTestsTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/TestExpectations (181489 => 181490)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/TestExpectations        2015-03-13 22:30:36 UTC (rev 181489)
+++ trunk/LayoutTests/TestExpectations        2015-03-13 23:01:51 UTC (rev 181490)
</span><span class="lines">@@ -67,6 +67,7 @@
</span><span class="cx"> webkit.org/b/127860 [ Debug ] js/function-apply-aliased.html [ Skip ]
</span><span class="cx"> 
</span><span class="cx"> # ES6 class syntax hasn't been enabled yet.
</span><ins>+webkit.org/b/140491 js/class-syntax-call.html [ Failure ]
</ins><span class="cx"> webkit.org/b/140491 js/class-syntax-declaration.html [ Failure ]
</span><span class="cx"> webkit.org/b/140491 js/class-syntax-expression.html [ Failure ]
</span><span class="cx"> webkit.org/b/140491 js/class-syntax-extends.html [ Failure ]
</span></span></pre></div>
<a id="trunkLayoutTestsjsclasssyntaxcallexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/class-syntax-call-expected.txt (0 => 181490)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/class-syntax-call-expected.txt                                (rev 0)
+++ trunk/LayoutTests/js/class-syntax-call-expected.txt        2015-03-13 23:01:51 UTC (rev 181490)
</span><span class="lines">@@ -0,0 +1,12 @@
</span><ins>+PASS class A { constructor() {} }; window.A = A; new A did not throw exception.
+PASS A() threw exception TypeError: Cannot call a class constructor.
+PASS class B extends A { constructor() { super() } }; window.B = B; new A did not throw exception.
+PASS B() threw exception TypeError: Cannot call a class constructor.
+PASS new (class { constructor() {} })() did not throw exception.
+PASS (class { constructor() {} })() threw exception TypeError: Cannot call a class constructor.
+PASS new (class extends null { constructor() { super() } })() did not throw exception.
+PASS (class extends null { constructor() { super() } })() threw exception TypeError: Cannot call a class constructor.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsjsclasssyntaxcallhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/class-syntax-call.html (0 => 181490)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/class-syntax-call.html                                (rev 0)
+++ trunk/LayoutTests/js/class-syntax-call.html        2015-03-13 23:01:51 UTC (rev 181490)
</span><span class="lines">@@ -0,0 +1,8 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;body&gt;
+&lt;script src=&quot;../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;script-tests/class-syntax-call.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsjsscripttestsclasssyntaxcalljs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/script-tests/class-syntax-call.js (0 => 181490)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/script-tests/class-syntax-call.js                                (rev 0)
+++ trunk/LayoutTests/js/script-tests/class-syntax-call.js        2015-03-13 23:01:51 UTC (rev 181490)
</span><span class="lines">@@ -0,0 +1,12 @@
</span><ins>+//@ skip
+
+shouldNotThrow('class A { constructor() {} }; window.A = A; new A');
+shouldThrow('A()', '&quot;TypeError: Cannot call a class constructor&quot;');
+shouldNotThrow('class B extends A { constructor() { super() } }; window.B = B; new A');
+shouldThrow('B()', '&quot;TypeError: Cannot call a class constructor&quot;');
+shouldNotThrow('new (class { constructor() {} })()');
+shouldThrow('(class { constructor() {} })()', '&quot;TypeError: Cannot call a class constructor&quot;');
+shouldNotThrow('new (class extends null { constructor() { super() } })()');
+shouldThrow('(class extends null { constructor() { super() } })()', '&quot;TypeError: Cannot call a class constructor&quot;');
+
+var successfullyParsed = true;
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (181489 => 181490)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2015-03-13 22:30:36 UTC (rev 181489)
+++ trunk/Source/JavaScriptCore/ChangeLog        2015-03-13 23:01:51 UTC (rev 181490)
</span><span class="lines">@@ -1,3 +1,63 @@
</span><ins>+2015-03-13  Ryosuke Niwa  &lt;rniwa@webkit.org&gt;
+
+        Class constructor should throw TypeError when &quot;called&quot;
+        https://bugs.webkit.org/show_bug.cgi?id=142566
+
+        Reviewed by Michael Saboff.
+
+        Added ConstructorKind::None to denote code that doesn't belong to an ES6 class.
+        This allows BytecodeGenerator to emit code to throw TypeError when generating code block
+        to call ES6 class constructors.
+
+        Most of changes are about increasing the number of bits to store ConstructorKind from one
+        bit to two bits.
+
+        * bytecode/UnlinkedCodeBlock.cpp:
+        (JSC::generateFunctionCodeBlock):
+        (JSC::UnlinkedFunctionExecutable::UnlinkedFunctionExecutable):
+        (JSC::UnlinkedCodeBlock::UnlinkedCodeBlock):
+        * bytecode/UnlinkedCodeBlock.h:
+        (JSC::ExecutableInfo::ExecutableInfo):
+        (JSC::ExecutableInfo::needsActivation):
+        (JSC::ExecutableInfo::usesEval):
+        (JSC::ExecutableInfo::isStrictMode):
+        (JSC::ExecutableInfo::isConstructor):
+        (JSC::ExecutableInfo::isBuiltinFunction):
+        (JSC::ExecutableInfo::constructorKind):
+        (JSC::UnlinkedFunctionExecutable::constructorKind):
+        (JSC::UnlinkedCodeBlock::constructorKind):
+        (JSC::UnlinkedFunctionExecutable::constructorKindIsDerived): Deleted.
+        (JSC::UnlinkedCodeBlock::constructorKindIsDerived): Deleted.
+        * bytecompiler/BytecodeGenerator.cpp:
+        (JSC::BytecodeGenerator::generate): Don't emit bytecode when we had already emitted code
+        to throw TypeError.
+        (JSC::BytecodeGenerator::BytecodeGenerator): Emit code to throw TypeError when generating
+        code to call.
+        (JSC::BytecodeGenerator::emitReturn):
+        * bytecompiler/BytecodeGenerator.h:
+        (JSC::BytecodeGenerator::constructorKind):
+        (JSC::BytecodeGenerator::constructorKindIsDerived): Deleted.
+        * bytecompiler/NodesCodegen.cpp:
+        (JSC::ThisNode::emitBytecode):
+        (JSC::FunctionCallValueNode::emitBytecode):
+        * parser/Nodes.cpp:
+        (JSC::FunctionBodyNode::FunctionBodyNode):
+        * parser/Nodes.h:
+        * parser/Parser.cpp:
+        (JSC::Parser&lt;LexerType&gt;::parseFunctionInfo): Renamed the incoming function argument to
+        ownerClassKind. Set constructorKind to Base or Derived only if we're parsing a constructor.
+        (JSC::Parser&lt;LexerType&gt;::parseFunctionDeclaration):
+        (JSC::Parser&lt;LexerType&gt;::parseClass): Don't parse static methods using MethodMode since that
+        would result in BytecodeGenerator erroneously treating static method named &quot;constructor&quot; as
+        a class constructor.
+        (JSC::Parser&lt;LexerType&gt;::parsePropertyMethod):
+        (JSC::Parser&lt;LexerType&gt;::parsePrimaryExpression):
+        * parser/Parser.h:
+        * parser/ParserModes.h:
+        * runtime/Executable.h:
+        (JSC::EvalExecutable::executableInfo):
+        (JSC::ProgramExecutable::executableInfo):
+
</ins><span class="cx"> 2015-03-13  Filip Pizlo  &lt;fpizlo@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         DFG::PutStackSinkingPhase should eliminate GetStacks that have an obviously known source
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecodeUnlinkedCodeBlockcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.cpp (181489 => 181490)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.cpp        2015-03-13 22:30:36 UTC (rev 181489)
+++ trunk/Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.cpp        2015-03-13 23:01:51 UTC (rev 181490)
</span><span class="lines">@@ -62,7 +62,7 @@
</span><span class="cx">     executable-&gt;recordParse(function-&gt;features(), function-&gt;hasCapturedVariables());
</span><span class="cx">     
</span><span class="cx">     UnlinkedFunctionCodeBlock* result = UnlinkedFunctionCodeBlock::create(&amp;vm, FunctionCode,
</span><del>-        ExecutableInfo(function-&gt;needsActivation(), function-&gt;usesEval(), function-&gt;isStrictMode(), kind == CodeForConstruct, functionKind == UnlinkedBuiltinFunction, executable-&gt;constructorKindIsDerived()));
</del><ins>+        ExecutableInfo(function-&gt;needsActivation(), function-&gt;usesEval(), function-&gt;isStrictMode(), kind == CodeForConstruct, functionKind == UnlinkedBuiltinFunction, executable-&gt;constructorKind()));
</ins><span class="cx">     auto generator(std::make_unique&lt;BytecodeGenerator&gt;(vm, function.get(), result, debuggerMode, profilerMode));
</span><span class="cx">     error = generator-&gt;generate();
</span><span class="cx">     if (error.isValid())
</span><span class="lines">@@ -85,7 +85,7 @@
</span><span class="cx">     , m_isInStrictContext(node-&gt;isInStrictContext())
</span><span class="cx">     , m_hasCapturedVariables(false)
</span><span class="cx">     , m_isBuiltinFunction(kind == UnlinkedBuiltinFunction)
</span><del>-    , m_constructorKindIsDerived(node-&gt;constructorKindIsDerived())
</del><ins>+    , m_constructorKind(static_cast&lt;unsigned&gt;(node-&gt;constructorKind()))
</ins><span class="cx">     , m_name(node-&gt;ident())
</span><span class="cx">     , m_inferredName(node-&gt;inferredName())
</span><span class="cx">     , m_parameters(node-&gt;parameters())
</span><span class="lines">@@ -101,6 +101,7 @@
</span><span class="cx">     , m_features(0)
</span><span class="cx">     , m_functionMode(node-&gt;functionMode())
</span><span class="cx"> {
</span><ins>+    ASSERT(m_constructorKind == static_cast&lt;unsigned&gt;(node-&gt;constructorKind()));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> size_t UnlinkedFunctionExecutable::parameterCount() const
</span><span class="lines">@@ -224,14 +225,14 @@
</span><span class="cx">     , m_vm(vm)
</span><span class="cx">     , m_argumentsRegister(VirtualRegister())
</span><span class="cx">     , m_globalObjectRegister(VirtualRegister())
</span><del>-    , m_needsFullScopeChain(info.m_needsActivation)
-    , m_usesEval(info.m_usesEval)
</del><ins>+    , m_needsFullScopeChain(info.needsActivation())
+    , m_usesEval(info.usesEval())
</ins><span class="cx">     , m_isNumericCompareFunction(false)
</span><del>-    , m_isStrictMode(info.m_isStrictMode)
-    , m_isConstructor(info.m_isConstructor)
</del><ins>+    , m_isStrictMode(info.isStrictMode())
+    , m_isConstructor(info.isConstructor())
</ins><span class="cx">     , m_hasCapturedVariables(false)
</span><del>-    , m_isBuiltinFunction(info.m_isBuiltinFunction)
-    , m_constructorKindIsDerived(info.m_constructorKindIsDerived)
</del><ins>+    , m_isBuiltinFunction(info.isBuiltinFunction())
+    , m_constructorKind(static_cast&lt;unsigned&gt;(info.constructorKind()))
</ins><span class="cx">     , m_firstLine(0)
</span><span class="cx">     , m_lineCount(0)
</span><span class="cx">     , m_endColumn(UINT_MAX)
</span><span class="lines">@@ -246,7 +247,7 @@
</span><span class="cx">     , m_bytecodeCommentIterator(0)
</span><span class="cx"> #endif
</span><span class="cx"> {
</span><del>-
</del><ins>+    ASSERT(m_constructorKind == static_cast&lt;unsigned&gt;(info.constructorKind()));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void UnlinkedCodeBlock::visitChildren(JSCell* cell, SlotVisitor&amp; visitor)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecodeUnlinkedCodeBlockh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.h (181489 => 181490)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.h        2015-03-13 22:30:36 UTC (rev 181489)
+++ trunk/Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.h        2015-03-13 23:01:51 UTC (rev 181490)
</span><span class="lines">@@ -65,21 +65,31 @@
</span><span class="cx"> typedef unsigned UnlinkedLLIntCallLinkInfo;
</span><span class="cx"> 
</span><span class="cx"> struct ExecutableInfo {
</span><del>-    ExecutableInfo(bool needsActivation, bool usesEval, bool isStrictMode, bool isConstructor, bool isBuiltinFunction, bool constructorKindIsDerived)
</del><ins>+    ExecutableInfo(bool needsActivation, bool usesEval, bool isStrictMode, bool isConstructor, bool isBuiltinFunction, ConstructorKind constructorKind)
</ins><span class="cx">         : m_needsActivation(needsActivation)
</span><span class="cx">         , m_usesEval(usesEval)
</span><span class="cx">         , m_isStrictMode(isStrictMode)
</span><span class="cx">         , m_isConstructor(isConstructor)
</span><span class="cx">         , m_isBuiltinFunction(isBuiltinFunction)
</span><del>-        , m_constructorKindIsDerived(constructorKindIsDerived)
</del><ins>+        , m_constructorKind(static_cast&lt;unsigned&gt;(constructorKind))
</ins><span class="cx">     {
</span><ins>+        ASSERT(m_constructorKind == static_cast&lt;unsigned&gt;(constructorKind));
</ins><span class="cx">     }
</span><del>-    bool m_needsActivation : 1;
-    bool m_usesEval : 1;
-    bool m_isStrictMode : 1;
-    bool m_isConstructor : 1;
-    bool m_isBuiltinFunction : 1;
-    bool m_constructorKindIsDerived : 1;
</del><ins>+
+    bool needsActivation() const { return m_needsActivation; }
+    bool usesEval() const { return m_usesEval; }
+    bool isStrictMode() const { return m_isStrictMode; }
+    bool isConstructor() const { return m_isConstructor; }
+    bool isBuiltinFunction() const { return m_isBuiltinFunction; }
+    ConstructorKind constructorKind() const { return static_cast&lt;ConstructorKind&gt;(m_constructorKind); }
+
+private:
+    unsigned m_needsActivation : 1;
+    unsigned m_usesEval : 1;
+    unsigned m_isStrictMode : 1;
+    unsigned m_isConstructor : 1;
+    unsigned m_isBuiltinFunction : 1;
+    unsigned m_constructorKind : 2;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> enum UnlinkedFunctionKind {
</span><span class="lines">@@ -118,7 +128,7 @@
</span><span class="cx">             return JSParseStrict;
</span><span class="cx">         return JSParseNormal;
</span><span class="cx">     }
</span><del>-    bool constructorKindIsDerived() const { return m_constructorKindIsDerived; }
</del><ins>+    ConstructorKind constructorKind() const { return static_cast&lt;ConstructorKind&gt;(m_constructorKind); }
</ins><span class="cx"> 
</span><span class="cx">     unsigned unlinkedFunctionNameStart() const { return m_unlinkedFunctionNameStart; }
</span><span class="cx">     unsigned unlinkedBodyStartColumn() const { return m_unlinkedBodyStartColumn; }
</span><span class="lines">@@ -167,10 +177,10 @@
</span><span class="cx">     WriteBarrier&lt;UnlinkedFunctionCodeBlock&gt; m_codeBlockForCall;
</span><span class="cx">     WriteBarrier&lt;UnlinkedFunctionCodeBlock&gt; m_codeBlockForConstruct;
</span><span class="cx"> 
</span><del>-    bool m_isInStrictContext : 1;
-    bool m_hasCapturedVariables : 1;
-    bool m_isBuiltinFunction : 1;
-    bool m_constructorKindIsDerived : 1;
</del><ins>+    unsigned m_isInStrictContext : 1;
+    unsigned m_hasCapturedVariables : 1;
+    unsigned m_isBuiltinFunction : 1;
+    unsigned m_constructorKind : 2;
</ins><span class="cx"> 
</span><span class="cx">     Identifier m_name;
</span><span class="cx">     Identifier m_inferredName;
</span><span class="lines">@@ -346,7 +356,7 @@
</span><span class="cx"> 
</span><span class="cx">     bool isBuiltinFunction() const { return m_isBuiltinFunction; }
</span><span class="cx"> 
</span><del>-    bool constructorKindIsDerived() const { return m_constructorKindIsDerived; }
</del><ins>+    ConstructorKind constructorKind() const { return static_cast&lt;ConstructorKind&gt;(m_constructorKind); }
</ins><span class="cx"> 
</span><span class="cx">     void shrinkToFit()
</span><span class="cx">     {
</span><span class="lines">@@ -532,14 +542,15 @@
</span><span class="cx">     VirtualRegister m_lexicalEnvironmentRegister;
</span><span class="cx">     VirtualRegister m_globalObjectRegister;
</span><span class="cx"> 
</span><del>-    bool m_needsFullScopeChain : 1;
-    bool m_usesEval : 1;
-    bool m_isNumericCompareFunction : 1;
-    bool m_isStrictMode : 1;
-    bool m_isConstructor : 1;
-    bool m_hasCapturedVariables : 1;
-    bool m_isBuiltinFunction : 1;
-    bool m_constructorKindIsDerived : 1;
</del><ins>+    unsigned m_needsFullScopeChain : 1;
+    unsigned m_usesEval : 1;
+    unsigned m_isNumericCompareFunction : 1;
+    unsigned m_isStrictMode : 1;
+    unsigned m_isConstructor : 1;
+    unsigned m_hasCapturedVariables : 1;
+    unsigned m_isBuiltinFunction : 1;
+    unsigned m_constructorKind : 2;
+
</ins><span class="cx">     unsigned m_firstLine;
</span><span class="cx">     unsigned m_lineCount;
</span><span class="cx">     unsigned m_endColumn;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecompilerBytecodeGeneratorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp (181489 => 181490)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp        2015-03-13 22:30:36 UTC (rev 181489)
+++ trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp        2015-03-13 23:01:51 UTC (rev 181490)
</span><span class="lines">@@ -68,7 +68,9 @@
</span><span class="cx">         entry.second-&gt;bindValue(*this, entry.first.get());
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    m_scopeNode-&gt;emitBytecode(*this);
</del><ins>+    bool callingClassConstructor = constructorKind() != ConstructorKind::None &amp;&amp; !isConstructor();
+    if (!callingClassConstructor)
+        m_scopeNode-&gt;emitBytecode(*this);
</ins><span class="cx"> 
</span><span class="cx">     m_staticPropertyAnalyzer.kill();
</span><span class="cx"> 
</span><span class="lines">@@ -401,12 +403,14 @@
</span><span class="cx">     addCallee(functionNode, calleeRegister);
</span><span class="cx"> 
</span><span class="cx">     if (isConstructor()) {
</span><del>-        if (constructorKindIsDerived()) {
</del><ins>+        if (constructorKind() == ConstructorKind::Derived) {
</ins><span class="cx">             m_newTargetRegister = addVar();
</span><span class="cx">             emitMove(m_newTargetRegister, &amp;m_thisRegister);
</span><span class="cx">             emitMove(&amp;m_thisRegister, addConstantEmptyValue());
</span><span class="cx">         } else
</span><span class="cx">             emitCreateThis(&amp;m_thisRegister);
</span><ins>+    } else if (constructorKind() != ConstructorKind::None) {
+        emitThrowTypeError(&quot;Cannot call a class constructor&quot;);
</ins><span class="cx">     } else if (functionNode-&gt;usesThis() || codeBlock-&gt;usesEval()) {
</span><span class="cx">         m_codeBlock-&gt;addPropertyAccessInstruction(instructions().size());
</span><span class="cx">         emitOpcode(op_to_this);
</span><span class="lines">@@ -1912,7 +1916,7 @@
</span><span class="cx">         instructions().append(m_lexicalEnvironmentRegister ? m_lexicalEnvironmentRegister-&gt;index() : emitLoad(0, JSValue())-&gt;index());
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    bool thisMightBeUninitialized = constructorKindIsDerived();
</del><ins>+    bool thisMightBeUninitialized = constructorKind() == ConstructorKind::Derived;
</ins><span class="cx">     bool srcIsThis = src-&gt;index() == m_thisRegister.index();
</span><span class="cx">     if (isConstructor() &amp;&amp; (!srcIsThis || thisMightBeUninitialized)) {
</span><span class="cx">         RefPtr&lt;Label&gt; isObjectOrUndefinedLabel = newLabel();
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecompilerBytecodeGeneratorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h (181489 => 181490)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h        2015-03-13 22:30:36 UTC (rev 181489)
+++ trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h        2015-03-13 23:01:51 UTC (rev 181490)
</span><span class="lines">@@ -271,9 +271,9 @@
</span><span class="cx"> 
</span><span class="cx">         bool isConstructor() const { return m_codeBlock-&gt;isConstructor(); }
</span><span class="cx"> #if ENABLE(ES6_CLASS_SYNTAX)
</span><del>-        bool constructorKindIsDerived() const { return m_codeBlock-&gt;constructorKindIsDerived(); }
</del><ins>+        ConstructorKind constructorKind() const { return m_codeBlock-&gt;constructorKind(); }
</ins><span class="cx"> #else
</span><del>-        bool constructorKindIsDerived() const { return false; }
</del><ins>+        ConstructorKind constructorKind() const { return ConstructorKind::None; }
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">         ParserError generate();
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecompilerNodesCodegencpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp (181489 => 181490)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp        2015-03-13 22:30:36 UTC (rev 181489)
+++ trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp        2015-03-13 23:01:51 UTC (rev 181490)
</span><span class="lines">@@ -144,7 +144,7 @@
</span><span class="cx"> 
</span><span class="cx"> RegisterID* ThisNode::emitBytecode(BytecodeGenerator&amp; generator, RegisterID* dst)
</span><span class="cx"> {
</span><del>-    if (generator.constructorKindIsDerived())
</del><ins>+    if (generator.constructorKind() == ConstructorKind::Derived)
</ins><span class="cx">         generator.emitTDZCheck(generator.thisRegister());
</span><span class="cx"> 
</span><span class="cx">     if (dst == generator.ignoredResult())
</span><span class="lines">@@ -574,7 +574,8 @@
</span><span class="cx">     RefPtr&lt;RegisterID&gt; returnValue = generator.finalDestination(dst, func.get());
</span><span class="cx">     CallArguments callArguments(generator, m_args);
</span><span class="cx">     if (m_expr-&gt;isSuperNode()) {
</span><del>-        ASSERT(generator.constructorKindIsDerived());
</del><ins>+        ASSERT(generator.isConstructor());
+        ASSERT(generator.constructorKind() == ConstructorKind::Derived);
</ins><span class="cx">         generator.emitMove(callArguments.thisRegister(), generator.newTarget());
</span><span class="cx">         RegisterID* ret = generator.emitConstruct(returnValue.get(), func.get(), NoExpectedFunction, callArguments, divot(), divotStart(), divotEnd());
</span><span class="cx">         generator.emitMove(generator.thisRegister(), ret);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreparserNodescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/parser/Nodes.cpp (181489 => 181490)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/parser/Nodes.cpp        2015-03-13 22:30:36 UTC (rev 181489)
+++ trunk/Source/JavaScriptCore/parser/Nodes.cpp        2015-03-13 23:01:51 UTC (rev 181490)
</span><span class="lines">@@ -173,8 +173,9 @@
</span><span class="cx">     , m_endColumn(endColumn)
</span><span class="cx">     , m_startStartOffset(startLocation.startOffset)
</span><span class="cx">     , m_isInStrictContext(isInStrictContext)
</span><del>-    , m_constructorKindIsDerived(constructorKind == ConstructorKind::Derived)
</del><ins>+    , m_constructorKind(static_cast&lt;unsigned&gt;(constructorKind))
</ins><span class="cx"> {
</span><ins>+    ASSERT(m_constructorKind == static_cast&lt;unsigned&gt;(constructorKind));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void FunctionBodyNode::finishParsing(const SourceCode&amp; source, ParameterNode* firstParameter, const Identifier&amp; ident, enum FunctionMode functionMode)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreparserNodesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/parser/Nodes.h (181489 => 181490)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/parser/Nodes.h        2015-03-13 22:30:36 UTC (rev 181489)
+++ trunk/Source/JavaScriptCore/parser/Nodes.h        2015-03-13 23:01:51 UTC (rev 181490)
</span><span class="lines">@@ -1587,7 +1587,7 @@
</span><span class="cx"> 
</span><span class="cx">         int startStartOffset() const { return m_startStartOffset; }
</span><span class="cx">         bool isInStrictContext() const { return m_isInStrictContext; }
</span><del>-        bool constructorKindIsDerived() { return m_constructorKindIsDerived; }
</del><ins>+        ConstructorKind constructorKind() { return static_cast&lt;ConstructorKind&gt;(m_constructorKind); }
</ins><span class="cx"> 
</span><span class="cx">     protected:
</span><span class="cx">         Identifier m_ident;
</span><span class="lines">@@ -1600,8 +1600,8 @@
</span><span class="cx">         unsigned m_endColumn;
</span><span class="cx">         SourceCode m_source;
</span><span class="cx">         int m_startStartOffset;
</span><del>-        bool m_isInStrictContext : 1;
-        bool m_constructorKindIsDerived : 1;
</del><ins>+        unsigned m_isInStrictContext : 1;
+        unsigned m_constructorKind : 2;
</ins><span class="cx">     };
</span><span class="cx"> 
</span><span class="cx">     class FunctionNode final : public ScopeNode {
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreparserParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/parser/Parser.cpp (181489 => 181490)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/parser/Parser.cpp        2015-03-13 22:30:36 UTC (rev 181489)
+++ trunk/Source/JavaScriptCore/parser/Parser.cpp        2015-03-13 23:01:51 UTC (rev 181490)
</span><span class="lines">@@ -1291,7 +1291,7 @@
</span><span class="cx"> 
</span><span class="cx"> template &lt;typename LexerType&gt;
</span><span class="cx"> template &lt;class TreeBuilder&gt; bool Parser&lt;LexerType&gt;::parseFunctionInfo(TreeBuilder&amp; context, FunctionRequirements requirements, FunctionParseMode mode,
</span><del>-    bool nameIsInContainingScope, ConstructorKind constructorKind, ParserFunctionInfo&lt;TreeBuilder&gt;&amp; info)
</del><ins>+    bool nameIsInContainingScope, ConstructorKind ownerClassKind, ParserFunctionInfo&lt;TreeBuilder&gt;&amp; info)
</ins><span class="cx"> {
</span><span class="cx">     AutoPopScopeRef functionScope(this, pushScope());
</span><span class="cx">     functionScope-&gt;setIsFunction();
</span><span class="lines">@@ -1321,7 +1321,12 @@
</span><span class="cx">     }
</span><span class="cx">     consumeOrFail(CLOSEPAREN, &quot;Expected a ')' or a ',' after a parameter declaration&quot;);
</span><span class="cx">     matchOrFail(OPENBRACE, &quot;Expected an opening '{' at the start of a &quot;, stringForFunctionMode(mode), &quot; body&quot;);
</span><del>-    
</del><ins>+
+    // BytecodeGenerator emits code to throw TypeError when a class constructor is &quot;call&quot;ed.
+    // Set ConstructorKind to None for non-constructor methods of classes.
+    bool isClassConstructor = mode == MethodMode &amp;&amp; info.name &amp;&amp; *info.name == m_vm-&gt;propertyNames-&gt;constructor;
+    ConstructorKind constructorKind = isClassConstructor ? ownerClassKind : ConstructorKind::None;
+
</ins><span class="cx">     info.openBraceOffset = m_token.m_data.offset;
</span><span class="cx">     info.bodyStartLine = tokenLine();
</span><span class="cx">     info.bodyStartColumn = m_token.m_data.offset - m_token.m_data.lineStartOffset;
</span><span class="lines">@@ -1377,12 +1382,11 @@
</span><span class="cx">         semanticFailIfTrue(m_vm-&gt;propertyNames-&gt;eval == *info.name, &quot;'&quot;, info.name-&gt;impl(), &quot;' is not a valid function name in strict mode&quot;);
</span><span class="cx">     }
</span><span class="cx">     if (functionScope-&gt;hasDirectSuper()) {
</span><del>-        bool isClassConstructor = mode == MethodMode &amp;&amp; info.name &amp;&amp; *info.name == m_vm-&gt;propertyNames-&gt;constructor;
</del><span class="cx">         semanticFailIfTrue(!isClassConstructor, &quot;Cannot call super() outside of a class constructor&quot;);
</span><del>-        semanticFailIfTrue(constructorKind == ConstructorKind::Base, &quot;Cannot call super() in a base class constructor&quot;);
</del><ins>+        semanticFailIfTrue(ownerClassKind != ConstructorKind::Derived, &quot;Cannot call super() in a base class constructor&quot;);
</ins><span class="cx">     }
</span><span class="cx">     if (functionScope-&gt;needsSuperBinding())
</span><del>-        semanticFailIfTrue(constructorKind == ConstructorKind::Base, &quot;super can only be used in a method of a derived class&quot;);
</del><ins>+        semanticFailIfTrue(ownerClassKind != ConstructorKind::Derived, &quot;super can only be used in a method of a derived class&quot;);
</ins><span class="cx"> 
</span><span class="cx">     info.closeBraceOffset = m_token.m_data.offset;
</span><span class="cx">     unsigned closeBraceLine = m_token.m_data.line;
</span><span class="lines">@@ -1424,7 +1428,7 @@
</span><span class="cx">     unsigned functionKeywordStart = tokenStart();
</span><span class="cx">     next();
</span><span class="cx">     ParserFunctionInfo&lt;TreeBuilder&gt; info;
</span><del>-    failIfFalse((parseFunctionInfo(context, FunctionNeedsName, FunctionMode, true, ConstructorKind::Base, info)), &quot;Cannot parse this function&quot;);
</del><ins>+    failIfFalse((parseFunctionInfo(context, FunctionNeedsName, FunctionMode, true, ConstructorKind::None, info)), &quot;Cannot parse this function&quot;);
</ins><span class="cx">     failIfFalse(info.name, &quot;Function statements must have a name&quot;);
</span><span class="cx">     failIfFalseIfStrict(declareVariable(info.name), &quot;Cannot declare a function named '&quot;, info.name-&gt;impl(), &quot;' in strict mode&quot;);
</span><span class="cx">     return context.createFuncDeclStatement(location, info, functionKeywordStart);
</span><span class="lines">@@ -1512,7 +1516,7 @@
</span><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><del>-            failIfFalse((parseFunctionInfo(context, FunctionNeedsName, MethodMode, false, constructorKind, methodInfo)), &quot;Cannot parse this method&quot;);
</del><ins>+            failIfFalse((parseFunctionInfo(context, FunctionNeedsName, isStaticMethod ? FunctionMode : MethodMode, false, constructorKind, methodInfo)), &quot;Cannot parse this method&quot;);
</ins><span class="cx">             failIfFalse(methodInfo.name, &quot;method must have a name&quot;);
</span><span class="cx">             failIfFalse(declareVariable(methodInfo.name), &quot;Cannot declare a method named '&quot;, methodInfo.name-&gt;impl(), &quot;'&quot;);
</span><span class="cx"> 
</span><span class="lines">@@ -2017,7 +2021,7 @@
</span><span class="cx">     JSTokenLocation methodLocation(tokenLocation());
</span><span class="cx">     unsigned methodStart = tokenStart();
</span><span class="cx">     ParserFunctionInfo&lt;TreeBuilder&gt; methodInfo;
</span><del>-    failIfFalse((parseFunctionInfo(context, FunctionNoRequirements, MethodMode, false, ConstructorKind::Base, methodInfo)), &quot;Cannot parse this method&quot;);
</del><ins>+    failIfFalse((parseFunctionInfo(context, FunctionNoRequirements, MethodMode, false, ConstructorKind::None, methodInfo)), &quot;Cannot parse this method&quot;);
</ins><span class="cx">     methodInfo.name = methodName;
</span><span class="cx">     return context.createFunctionExpr(methodLocation, methodInfo, methodStart);
</span><span class="cx"> }
</span><span class="lines">@@ -2231,7 +2235,7 @@
</span><span class="cx">         next();
</span><span class="cx">         ParserFunctionInfo&lt;TreeBuilder&gt; info;
</span><span class="cx">         info.name = &amp;m_vm-&gt;propertyNames-&gt;nullIdentifier;
</span><del>-        failIfFalse((parseFunctionInfo(context, FunctionNoRequirements, FunctionMode, false, ConstructorKind::Base, info)), &quot;Cannot parse function expression&quot;);
</del><ins>+        failIfFalse((parseFunctionInfo(context, FunctionNoRequirements, FunctionMode, false, ConstructorKind::None, info)), &quot;Cannot parse function expression&quot;);
</ins><span class="cx">         return context.createFunctionExpr(location, info, functionKeywordStart);
</span><span class="cx">     }
</span><span class="cx"> #if ENABLE(ES6_CLASS_SYNTAX)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreparserParserh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/parser/Parser.h (181489 => 181490)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/parser/Parser.h        2015-03-13 22:30:36 UTC (rev 181489)
+++ trunk/Source/JavaScriptCore/parser/Parser.h        2015-03-13 23:01:51 UTC (rev 181490)
</span><span class="lines">@@ -758,7 +758,7 @@
</span><span class="cx">     template &lt;class TreeBuilder&gt; ALWAYS_INLINE TreeArguments parseArguments(TreeBuilder&amp;, SpreadMode);
</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);
</span><del>-    template &lt;class TreeBuilder&gt; TreeProperty parseGetterSetter(TreeBuilder&amp;, bool strict, PropertyNode::Type, unsigned getterOrSetterStartOffset, ConstructorKind = ConstructorKind::Base, SuperBinding = SuperBinding::NotNeeded);
</del><ins>+    template &lt;class TreeBuilder&gt; TreeProperty parseGetterSetter(TreeBuilder&amp;, bool strict, PropertyNode::Type, unsigned getterOrSetterStartOffset, ConstructorKind = ConstructorKind::None, SuperBinding = SuperBinding::NotNeeded);
</ins><span class="cx">     template &lt;class TreeBuilder&gt; ALWAYS_INLINE TreeFunctionBody parseFunctionBody(TreeBuilder&amp;, ConstructorKind);
</span><span class="cx">     template &lt;class TreeBuilder&gt; ALWAYS_INLINE TreeFormalParameterList parseFormalParameters(TreeBuilder&amp;);
</span><span class="cx">     enum VarDeclarationListContext { ForLoopContext, VarDeclarationContext };
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreparserParserModesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/parser/ParserModes.h (181489 => 181490)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/parser/ParserModes.h        2015-03-13 22:30:36 UTC (rev 181489)
+++ trunk/Source/JavaScriptCore/parser/ParserModes.h        2015-03-13 23:01:51 UTC (rev 181490)
</span><span class="lines">@@ -34,7 +34,7 @@
</span><span class="cx"> enum JSParserStrictness { JSParseNormal, JSParseBuiltin, JSParseStrict };
</span><span class="cx"> enum JSParserMode { JSParseProgramCode, JSParseFunctionCode };
</span><span class="cx"> 
</span><del>-enum class ConstructorKind { Base, Derived };
</del><ins>+enum class ConstructorKind { None, Base, Derived };
</ins><span class="cx"> enum class SuperBinding { Needed, NotNeeded };
</span><span class="cx"> 
</span><span class="cx"> enum ProfilerMode { ProfilerOff, ProfilerOn };
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeExecutableh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/Executable.h (181489 => 181490)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/Executable.h        2015-03-13 22:30:36 UTC (rev 181489)
+++ trunk/Source/JavaScriptCore/runtime/Executable.h        2015-03-13 23:01:51 UTC (rev 181490)
</span><span class="lines">@@ -467,7 +467,7 @@
</span><span class="cx"> 
</span><span class="cx">     void clearCode();
</span><span class="cx"> 
</span><del>-    ExecutableInfo executableInfo() const { return ExecutableInfo(needsActivation(), usesEval(), isStrictMode(), false, false, false); }
</del><ins>+    ExecutableInfo executableInfo() const { return ExecutableInfo(needsActivation(), usesEval(), isStrictMode(), false, false, ConstructorKind::None); }
</ins><span class="cx"> 
</span><span class="cx">     unsigned numVariables() { return m_unlinkedEvalCodeBlock-&gt;numVariables(); }
</span><span class="cx">     unsigned numberOfFunctionDecls() { return m_unlinkedEvalCodeBlock-&gt;numberOfFunctionDecls(); }
</span><span class="lines">@@ -522,7 +522,7 @@
</span><span class="cx"> 
</span><span class="cx">     void clearCode();
</span><span class="cx"> 
</span><del>-    ExecutableInfo executableInfo() const { return ExecutableInfo(needsActivation(), usesEval(), isStrictMode(), false, false, false); }
</del><ins>+    ExecutableInfo executableInfo() const { return ExecutableInfo(needsActivation(), usesEval(), isStrictMode(), false, false, ConstructorKind::None); }
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     friend class ScriptExecutable;
</span></span></pre>
</div>
</div>

</body>
</html>