Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion lib/Parser/Parse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3146,7 +3146,6 @@ LFunction :
}

case tkCLASS:
fAllowCall = FALSE;
if (m_scriptContext->GetConfig()->IsES6ClassAndExtendsEnabled())
{
pnode = ParseClassDecl<buildAST>(FALSE, pNameHint, pHintLength, pShortNameOffset);
Expand Down
12 changes: 12 additions & 0 deletions test/es6/classes_bugfixes.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@
WScript.LoadScriptFile("..\\UnitTestFramework\\UnitTestFramework.js");

var tests = [
{
name: "GitHub ChakraCore #1465 - call syntax is allowed after class expression",
body: function () {
var s1 = class { }.toString();
var s2 = class x { }.toString();
var s3 = class x { }.toString(1, 2, 3); // arguments should not affect valid parse

assert.areEqual("class { }", s1, "Calling toString after a class expression with no name parses and behaves correctly");
assert.areEqual("class x { }", s2, "Calling toString after a class expression with a name parses and behaves correctly");
assert.areEqual("class x { }", s3, "Calling toString with arguments after a class expression with a name parses and behaves correctly");
}
},
{
name: "BLUE 540289: AV on deferred parse of first class method",
body: function () {
Expand Down