Skip to content

Commit b4e4193

Browse files
committed
[JSC] Remove Options::useObjectRestSpread
https://bugs.webkit.org/show_bug.cgi?id=190568 Reviewed by Saam Barati. Options::useObjectRestSpread is enabled by default at 2017-06-27. It is already shipped in several releases, and we can think that it is mature. Let's drop Options::useObjectRestSpread() flag. * parser/Parser.cpp: (JSC::Parser<LexerType>::Parser): (JSC::Parser<LexerType>::parseDestructuringPattern): (JSC::Parser<LexerType>::parseProperty): * parser/Parser.h: * runtime/Options.h: Canonical link: https://commits.webkit.org/205470@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237096 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent 25d073a commit b4e4193

4 files changed

Lines changed: 26 additions & 15 deletions

File tree

Source/JavaScriptCore/ChangeLog

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
2018-10-14 Yusuke Suzuki <yusukesuzuki@slowstart.org>
2+
3+
[JSC] Remove Options::useObjectRestSpread
4+
https://bugs.webkit.org/show_bug.cgi?id=190568
5+
6+
Reviewed by Saam Barati.
7+
8+
Options::useObjectRestSpread is enabled by default at 2017-06-27. It is already shipped in several releases,
9+
and we can think that it is mature. Let's drop Options::useObjectRestSpread() flag.
10+
11+
* parser/Parser.cpp:
12+
(JSC::Parser<LexerType>::Parser):
13+
(JSC::Parser<LexerType>::parseDestructuringPattern):
14+
(JSC::Parser<LexerType>::parseProperty):
15+
* parser/Parser.h:
16+
* runtime/Options.h:
17+
118
2018-10-13 Yusuke Suzuki <yusukesuzuki@slowstart.org>
219

320
[JSC] JSON.stringify can accept call-with-no-arguments

Source/JavaScriptCore/parser/Parser.cpp

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,6 @@ Parser<LexerType>::Parser(VM* vm, const SourceCode& source, JSParserBuiltinMode
147147
m_token.m_location.lineStartOffset = source.startOffset();
148148
m_functionCache = vm->addSourceProviderCache(source.provider());
149149
m_expressionErrorClassifier = nullptr;
150-
m_useObjectRestSpread = Options::useObjectRestSpread();
151150

152151
ScopeRef scope = pushScope();
153152
scope->setSourceParseMode(parseMode);
@@ -1174,7 +1173,7 @@ template <class TreeBuilder> TreeDestructuringPattern Parser<LexerType>::parseDe
11741173
if (match(CLOSEBRACE))
11751174
break;
11761175

1177-
if (match(DOTDOTDOT) && m_useObjectRestSpread) {
1176+
if (match(DOTDOTDOT)) {
11781177
JSTokenLocation location = m_token.m_location;
11791178
next();
11801179
auto innerPattern = parseObjectRestBindingOrAssignmentElement(context, kind, exportType, duplicateIdentifier, bindingContext);
@@ -4046,17 +4045,14 @@ template <class TreeBuilder> TreeProperty Parser<LexerType>::parseProperty(TreeB
40464045
return context.createProperty(propertyName, node, static_cast<PropertyNode::Type>(PropertyNode::Constant | PropertyNode::Computed), PropertyNode::Unknown, complete, SuperBinding::NotNeeded, ClassElementTag::No);
40474046
}
40484047
case DOTDOTDOT: {
4049-
if (m_useObjectRestSpread) {
4050-
auto spreadLocation = m_token.m_location;
4051-
auto start = m_token.m_startPosition;
4052-
auto divot = m_token.m_endPosition;
4053-
next();
4054-
TreeExpression elem = parseAssignmentExpressionOrPropagateErrorClass(context);
4055-
failIfFalse(elem, "Cannot parse subject of a spread operation");
4056-
auto node = context.createObjectSpreadExpression(spreadLocation, elem, start, divot, m_lastTokenEndPosition);
4057-
return context.createProperty(node, PropertyNode::Spread, PropertyNode::Unknown, complete, SuperBinding::NotNeeded, ClassElementTag::No);
4058-
}
4059-
FALLTHROUGH;
4048+
auto spreadLocation = m_token.m_location;
4049+
auto start = m_token.m_startPosition;
4050+
auto divot = m_token.m_endPosition;
4051+
next();
4052+
TreeExpression elem = parseAssignmentExpressionOrPropagateErrorClass(context);
4053+
failIfFalse(elem, "Cannot parse subject of a spread operation");
4054+
auto node = context.createObjectSpreadExpression(spreadLocation, elem, start, divot, m_lastTokenEndPosition);
4055+
return context.createProperty(node, PropertyNode::Spread, PropertyNode::Unknown, complete, SuperBinding::NotNeeded, ClassElementTag::No);
40604056
}
40614057
default:
40624058
failIfFalse(m_token.m_type & KeywordTokenFlag, "Expected a property name");

Source/JavaScriptCore/parser/Parser.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1817,7 +1817,6 @@ class Parser {
18171817

18181818
ParserState m_parserState;
18191819

1820-
bool m_useObjectRestSpread;
18211820
bool m_hasStackOverflow;
18221821
String m_errorMessage;
18231822
JSToken m_token;

Source/JavaScriptCore/runtime/Options.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,6 @@ constexpr bool enableWebAssemblyStreamingApi = false;
506506
v(bool, useWebAssemblyStreamingApi, enableWebAssemblyStreamingApi, Normal, "Allow to run WebAssembly's Streaming API") \
507507
v(bool, useCallICsForWebAssemblyToJSCalls, true, Normal, "If true, we will use CallLinkInfo to inline cache Wasm to JS calls.") \
508508
v(bool, useEagerWebAssemblyModuleHashing, false, Normal, "Unnamed WebAssembly modules are identified in backtraces through their hash, if available.") \
509-
v(bool, useObjectRestSpread, true, Normal, "If true, we will enable Object Rest/Spread feature.") \
510509
v(bool, useBigInt, false, Normal, "If true, we will enable BigInt support.") \
511510
v(bool, useIntlNumberFormatToParts, enableIntlNumberFormatToParts, Normal, "If true, we will enable Intl.NumberFormat.prototype.formatToParts") \
512511
v(bool, useIntlPluralRules, enableIntlPluralRules, Normal, "If true, we will enable Intl.PluralRules.") \

0 commit comments

Comments
 (0)