Skip to content

Commit

Permalink
Remove -ES6Classes feature switch
Browse files Browse the repository at this point in the history
Re issue chakra-core#6
  • Loading branch information
Ian Halliday committed Feb 11, 2016
1 parent b142f22 commit b5bd41c
Show file tree
Hide file tree
Showing 10 changed files with 45 additions and 81 deletions.
29 changes: 4 additions & 25 deletions lib/Parser/parse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2232,7 +2232,7 @@ ParseNodePtr Parser::ParseTerm(BOOL fAllowCall,
ichMin = m_pscan->IchMinTok();
m_pscan->Scan();

if (m_token.tk == tkDot && m_scriptContext->GetConfig()->IsES6ClassAndExtendsEnabled())
if (m_token.tk == tkDot)
{
pnode = ParseMetaProperty<buildAST>(tkNEW, ichMin, &fCanAssign);

Expand Down Expand Up @@ -2341,14 +2341,7 @@ LFunction :

case tkCLASS:
fAllowCall = FALSE;
if (m_scriptContext->GetConfig()->IsES6ClassAndExtendsEnabled())
{
pnode = ParseClassDecl<buildAST>(FALSE, pNameHint, pHintLength, pShortNameOffset);
}
else
{
goto LUnknown;
}
pnode = ParseClassDecl<buildAST>(FALSE, pNameHint, pHintLength, pShortNameOffset);
fCanAssign = FALSE;
break;

Expand All @@ -2359,14 +2352,7 @@ LFunction :
break;

case tkSUPER:
if (m_scriptContext->GetConfig()->IsES6ClassAndExtendsEnabled())
{
pnode = ParseSuper<buildAST>(pnode, !!fAllowCall);
}
else
{
goto LUnknown;
}
pnode = ParseSuper<buildAST>(pnode, !!fAllowCall);
break;

case tkCASE:
Expand Down Expand Up @@ -8275,14 +8261,7 @@ ParseNodePtr Parser::ParseStatement()
}

case tkCLASS:
if (m_scriptContext->GetConfig()->IsES6ClassAndExtendsEnabled())
{
pnode = ParseClassDecl<buildAST>(TRUE, nullptr, nullptr, nullptr);
}
else
{
goto LDefaultToken;
}
pnode = ParseClassDecl<buildAST>(TRUE, nullptr, nullptr, nullptr);
break;

case tkID:
Expand Down
1 change: 0 additions & 1 deletion lib/Runtime/Base/ThreadConfigFlagsList.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ FLAG(IsErrorStackTraceEnabled, errorStackTrace)
FLAG(IsES6UnicodeVerboseEnabled, ES6UnicodeVerbose)
FLAG_RELEASE(IsIntlEnabled, Intl)
FLAG_RELEASE(IsES6SpeciesEnabled, ES6Species)
FLAG_RELEASE(IsES6ClassAndExtendsEnabled, ES6Classes)
FLAG_RELEASE(IsES6DateParseFixEnabled, ES6DateParseFix)
FLAG_RELEASE(IsES6DefaultArgsEnabled, ES6DefaultArgs)
FLAG_RELEASE(IsES6DestructuringEnabled, ES6Destructuring)
Expand Down
2 changes: 1 addition & 1 deletion lib/Runtime/ByteCode/ByteCodeEmitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2035,7 +2035,7 @@ void ByteCodeGenerator::InvalidateCachedOuterScopes(FuncInfo *funcInfo)

void ByteCodeGenerator::LoadThisObject(FuncInfo *funcInfo, bool thisLoadedFromParams)
{
if (this->scriptContext->GetConfig()->IsES6ClassAndExtendsEnabled() && funcInfo->IsClassConstructor())
if (funcInfo->IsClassConstructor())
{
// Derived class constructors initialize 'this' to be Undecl
// - we'll check this value during a super call and during 'this' access
Expand Down
20 changes: 9 additions & 11 deletions lib/Runtime/Library/JavascriptReflect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -414,21 +414,19 @@ namespace Js
}

Var newTarget = nullptr;
if (scriptContext->GetConfig()->IsES6ClassAndExtendsEnabled())

if (args.Info.Count > 3)
{
if (args.Info.Count > 3)
{
newTarget = args[3];
if (!JavascriptOperators::IsConstructor(newTarget))
{
JavascriptError::ThrowTypeError(scriptContext, JSERR_NeedConstructor, L"newTarget");
}
}
else
newTarget = args[3];
if (!JavascriptOperators::IsConstructor(newTarget))
{
newTarget = target;
JavascriptError::ThrowTypeError(scriptContext, JSERR_NeedConstructor, L"newTarget");
}
}
else
{
newTarget = target;
}

RecyclableObject* thisArg = RecyclableObject::FromVar(undefinedValue);
if (newTarget != nullptr)
Expand Down
2 changes: 0 additions & 2 deletions lib/common/ConfigFlagsList.h
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,6 @@ PHASE(All)
// ES6 sub-feature gate - to enable-disable ES6 sub-feature when ES6 flag is enabled
#define DEFAULT_CONFIG_ES6Species (true)
#define DEFAULT_CONFIG_ES6AsyncAwait (false)
#define DEFAULT_CONFIG_ES6Classes (true)
#define DEFAULT_CONFIG_ES6DateParseFix (true)
#define DEFAULT_CONFIG_ES6DefaultArgs (false)
#define DEFAULT_CONFIG_ES6Destructuring (true)
Expand Down Expand Up @@ -848,7 +847,6 @@ FLAGNRC(Boolean, ES6Experimental , "Enable all experimental features",

FLAGPR (Boolean, ES6, ES6Species , "Enable ES6 '@@species' properties and built-in behaviors" , DEFAULT_CONFIG_ES6Species)
FLAGPR_REGOVR_EXP(Boolean, ES6, ES7AsyncAwait , "Enable ES7 'async' and 'await' keywords" , DEFAULT_CONFIG_ES6AsyncAwait)
FLAGPR (Boolean, ES6, ES6Classes , "Enable ES6 'class' and 'extends' keywords" , DEFAULT_CONFIG_ES6Classes)
FLAGPR (Boolean, ES6, ES6DateParseFix , "Enable ES6 Date.parse fixes" , DEFAULT_CONFIG_ES6DateParseFix)
FLAGPR_REGOVR_EXP(Boolean, ES6, ES6DefaultArgs , "Enable ES6 Default Arguments" , DEFAULT_CONFIG_ES6DefaultArgs)
FLAGPR (Boolean, ES6, ES6Destructuring , "Enable ES6 Destructuring" , DEFAULT_CONFIG_ES6Destructuring)
Expand Down
2 changes: 1 addition & 1 deletion test/Basics/rlexe.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<test>
<default>
<files>ie12ScriptFunctionToStrings.js</files>
<compile-flags>-ES6Generators -ES6Classes -args summary -endargs</compile-flags>
<compile-flags>-ES6Generators -args summary -endargs</compile-flags>
</default>
</test>-->
<test>
Expand Down
2 changes: 0 additions & 2 deletions test/es6/es6_all.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ FLAG ES6 = 1 - setting child flag ES6Species = 1
FLAG ES6Species = 1
FLAG ES6 = 1 - setting child flag ES7AsyncAwait = 1
FLAG ES7AsyncAwait = 1
FLAG ES6 = 1 - setting child flag ES6Classes = 1
FLAG ES6Classes = 1
FLAG ES6 = 1 - setting child flag ES6DateParseFix = 1
FLAG ES6DateParseFix = 1
FLAG ES6 = 1 - setting child flag ES6DefaultArgs = 1
Expand Down
2 changes: 0 additions & 2 deletions test/es6/es6_stable.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ FLAG ES6 = 1 - setting child flag ES6Species = 1
FLAG ES6Species = 1
FLAG ES6 = 1 - setting child flag ES7AsyncAwait = 0
FLAG ES7AsyncAwait = 0
FLAG ES6 = 1 - setting child flag ES6Classes = 1
FLAG ES6Classes = 1
FLAG ES6 = 1 - setting child flag ES6DateParseFix = 1
FLAG ES6DateParseFix = 1
FLAG ES6 = 1 - setting child flag ES6DefaultArgs = 0
Expand Down
4 changes: 0 additions & 4 deletions test/es6/es6_stable.enable_disable.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ FLAG ES6 = 1 - setting child flag ES6Species = 1
FLAG ES6Species = 1
FLAG ES6 = 1 - setting child flag ES7AsyncAwait = 0
FLAG ES7AsyncAwait = 0
FLAG ES6 = 1 - setting child flag ES6Classes = 1
FLAG ES6Classes = 1
FLAG ES6 = 1 - setting child flag ES6DateParseFix = 1
FLAG ES6DateParseFix = 1
FLAG ES6 = 1 - setting child flag ES6DefaultArgs = 0
Expand Down Expand Up @@ -72,8 +70,6 @@ FLAG ES6 = 0 - setting child flag ES6Species = 0
FLAG ES6Species = 0
FLAG ES6 = 0 - setting child flag ES7AsyncAwait = 0
FLAG ES7AsyncAwait = 0
FLAG ES6 = 0 - setting child flag ES6Classes = 0
FLAG ES6Classes = 0
FLAG ES6 = 0 - setting child flag ES6DateParseFix = 0
FLAG ES6DateParseFix = 0
FLAG ES6 = 0 - setting child flag ES6DefaultArgs = 0
Expand Down
Loading

0 comments on commit b5bd41c

Please sign in to comment.