Skip to content

Commit

Permalink
Remove -ES6NumericLiteral feature switch
Browse files Browse the repository at this point in the history
Re issue chakra-core#6
  • Loading branch information
Ian Halliday committed Jan 14, 2016
1 parent 97df5d5 commit b0c9623
Show file tree
Hide file tree
Showing 8 changed files with 1 addition and 41 deletions.
19 changes: 0 additions & 19 deletions lib/Parser/scan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -677,10 +677,6 @@ typename Scanner<EncodingPolicy>::EncodedCharPtr Scanner<EncodingPolicy>::FScanN
return pchT;
case 'o':
case 'O':
if (!this->m_scriptContext->GetConfig()->IsES6NumericLiteralEnabled())
{
goto LDefaultFScanNumber;
}
// Octal
*pdbl = Js::NumberUtilities::DblFromOctal(p + 2, &pchT);
if (pchT == p + 2)
Expand All @@ -693,10 +689,6 @@ typename Scanner<EncodingPolicy>::EncodedCharPtr Scanner<EncodingPolicy>::FScanN

case 'b':
case 'B':
if (!this->m_scriptContext->GetConfig()->IsES6NumericLiteralEnabled())
{
goto LDefaultFScanNumber;
}
// Binary
*pdbl = Js::NumberUtilities::DblFromBinary(p + 2, &pchT);
if (pchT == p + 2)
Expand All @@ -708,7 +700,6 @@ typename Scanner<EncodingPolicy>::EncodedCharPtr Scanner<EncodingPolicy>::FScanN
return pchT;

default:
LDefaultFScanNumber :
// Octal
*pdbl = Js::NumberUtilities::DblFromOctal(p, &pchT);
Assert(pchT > p);
Expand Down Expand Up @@ -773,10 +764,6 @@ BOOL Scanner<EncodingPolicy>::oFScanNumber(double *pdbl, bool& likelyInt)
break;
case 'o':
case 'O':
if (!this->m_scriptContext->GetConfig()->IsES6NumericLiteralEnabled())
{
goto LDefaultoFScanNumber;
}
*pdbl = Js::NumberUtilities::DblFromOctal(m_currentCharacter + 2, &pchT);
if (pchT == m_currentCharacter + 2)
{
Expand All @@ -790,11 +777,6 @@ BOOL Scanner<EncodingPolicy>::oFScanNumber(double *pdbl, bool& likelyInt)

case 'b':
case 'B':
if (!this->m_scriptContext->GetConfig()->IsES6NumericLiteralEnabled())
{
goto LDefaultoFScanNumber;
}

*pdbl = Js::NumberUtilities::DblFromBinary(m_currentCharacter + 2, &pchT);
if (pchT == m_currentCharacter + 2)
{
Expand All @@ -807,7 +789,6 @@ BOOL Scanner<EncodingPolicy>::oFScanNumber(double *pdbl, bool& likelyInt)
break;

default:
LDefaultoFScanNumber :
// Octal.
*pdbl = Js::NumberUtilities::DblFromOctal(m_currentCharacter, &pchT);
Assert(pchT > m_currentCharacter);
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 @@ -22,7 +22,6 @@ FLAG_RELEASE(IsES7ExponentiationOperatorEnabled, ES7ExponentiationOperator)
FLAG_RELEASE(IsES7TrailingCommaEnabled, ES7TrailingComma)
FLAG_RELEASE(IsES7BuiltinsEnabled, ES7Builtins)
FLAG_RELEASE(IsES6IsConcatSpreadableEnabled, ES6IsConcatSpreadable)
FLAG_RELEASE(IsES6NumericLiteralEnabled, ES6NumericLiterals)
FLAG_RELEASE(IsES6ObjectLiteralsEnabled, ES6ObjectLiterals)
FLAG_RELEASE(IsES6PromiseEnabled, ES6Promise)
FLAG_RELEASE(IsES6ProxyEnabled, ES6Proxy)
Expand Down
10 changes: 0 additions & 10 deletions lib/Runtime/Library/JavascriptString.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2670,10 +2670,8 @@ namespace Js

bool JavascriptString::ToDouble(double * result)
{

const wchar_t* pch;
long len = this->m_charLength;
ScriptContext *scriptContext = this->GetScriptContext();
if (0 == len)
{
*result = 0;
Expand Down Expand Up @@ -2709,19 +2707,11 @@ namespace Js
break;
case 'o':
case 'O':
if (!scriptContext->GetConfig()->IsES6NumericLiteralEnabled())
{
break;
}
*result = NumberUtilities::DblFromOctal(pchT, &pch);
isNumericLiteral = true;
break;
case 'b':
case 'B':
if (!scriptContext->GetConfig()->IsES6NumericLiteralEnabled())
{
break;
}
*result = NumberUtilities::DblFromBinary(pchT, &pch);
isNumericLiteral = true;
break;
Expand Down
2 changes: 0 additions & 2 deletions lib/common/ConfigFlagsList.h
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,6 @@ PHASE(All)
#define DEFAULT_CONFIG_ES6FunctionNameFull (false)
#define DEFAULT_CONFIG_ES6Generators (true)
#define DEFAULT_CONFIG_ES6IsConcatSpreadable (false)
#define DEFAULT_CONFIG_ES6NumericLiterals (true)
#define DEFAULT_CONFIG_ES6ObjectLiterals (true)
#define DEFAULT_CONFIG_ES6Promise (true)
#define DEFAULT_CONFIG_ES6Proxy (true)
Expand Down Expand Up @@ -867,7 +866,6 @@ FLAGPR_REGOVR_EXP(Boolean, ES6, ES7ExponentiationOperator, "Enable ES7 exponenti
FLAGPR_REGOVR_EXP(Boolean, ES6, ES7Builtins , "Enable ES7 built-ins" , DEFAULT_CONFIG_ES7Builtins)
FLAGPR (Boolean, ES6, ES7TrailingComma , "Enable ES7 trailing comma in function" , DEFAULT_CONFIG_ES7TrailingComma)
FLAGPR (Boolean, ES6, ES6IsConcatSpreadable , "Enable ES6 isConcatSpreadable Symbol" , DEFAULT_CONFIG_ES6IsConcatSpreadable)
FLAGPR (Boolean, ES6, ES6NumericLiterals , "Enable ES6 NumericLiterals" , DEFAULT_CONFIG_ES6NumericLiterals)
FLAGPR (Boolean, ES6, ES6ObjectLiterals , "Enable ES6 Object literal extensions" , DEFAULT_CONFIG_ES6ObjectLiterals)
FLAGPR (Boolean, ES6, ES6Promise , "Enable ES6 Promise feature" , DEFAULT_CONFIG_ES6Promise)
FLAGPR (Boolean, ES6, ES6Proxy , "Enable ES6 Proxy feature" , DEFAULT_CONFIG_ES6Proxy)
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 @@ -29,8 +29,6 @@ FLAG ES6 = 1 - setting child flag ES7TrailingComma = 1
FLAG ES7TrailingComma = 1
FLAG ES6 = 1 - setting child flag ES6IsConcatSpreadable = 1
FLAG ES6IsConcatSpreadable = 1
FLAG ES6 = 1 - setting child flag ES6NumericLiterals = 1
FLAG ES6NumericLiterals = 1
FLAG ES6 = 1 - setting child flag ES6ObjectLiterals = 1
FLAG ES6ObjectLiterals = 1
FLAG ES6 = 1 - setting child flag ES6Promise = 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 @@ -29,8 +29,6 @@ FLAG ES6 = 1 - setting child flag ES7TrailingComma = 1
FLAG ES7TrailingComma = 1
FLAG ES6 = 1 - setting child flag ES6IsConcatSpreadable = 0
FLAG ES6IsConcatSpreadable = 0
FLAG ES6 = 1 - setting child flag ES6NumericLiterals = 1
FLAG ES6NumericLiterals = 1
FLAG ES6 = 1 - setting child flag ES6ObjectLiterals = 1
FLAG ES6ObjectLiterals = 1
FLAG ES6 = 1 - setting child flag ES6Promise = 1
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 @@ -29,8 +29,6 @@ FLAG ES6 = 1 - setting child flag ES7TrailingComma = 1
FLAG ES7TrailingComma = 1
FLAG ES6 = 1 - setting child flag ES6IsConcatSpreadable = 0
FLAG ES6IsConcatSpreadable = 0
FLAG ES6 = 1 - setting child flag ES6NumericLiterals = 1
FLAG ES6NumericLiterals = 1
FLAG ES6 = 1 - setting child flag ES6ObjectLiterals = 1
FLAG ES6ObjectLiterals = 1
FLAG ES6 = 1 - setting child flag ES6Promise = 1
Expand Down Expand Up @@ -100,8 +98,6 @@ FLAG ES6 = 0 - setting child flag ES7TrailingComma = 0
FLAG ES7TrailingComma = 0
FLAG ES6 = 0 - setting child flag ES6IsConcatSpreadable = 0
FLAG ES6IsConcatSpreadable = 0
FLAG ES6 = 0 - setting child flag ES6NumericLiterals = 0
FLAG ES6NumericLiterals = 0
FLAG ES6 = 0 - setting child flag ES6ObjectLiterals = 0
FLAG ES6ObjectLiterals = 0
FLAG ES6 = 0 - setting child flag ES6Promise = 0
Expand Down
2 changes: 1 addition & 1 deletion test/es6/rlexe.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<test>
<default>
<files>NumericLiteralTest.js</files>
<compile-flags>-ES6NumericLiterals -args summary -endargs</compile-flags>
<compile-flags>-args summary -endargs</compile-flags>
</default>
</test>
<test>
Expand Down

0 comments on commit b0c9623

Please sign in to comment.