Commit d756c653 authored by adamk's avatar adamk Committed by Commit bot

Revert of Move --harmony-destructuring-bind to shipping (patchset #5 id:80001...

Revert of Move --harmony-destructuring-bind to shipping (patchset #5 id:80001 of https://codereview.chromium.org/1451843002/ )

Reason for revert:
Fails on V8 Fuzzer: https://build.chromium.org/p/client.v8/builders/V8%20Fuzzer/builds/6028

Original issue's description:
> Move --harmony-destructuring-bind to shipping
>
> Also fix CheckConflictingVarDeclarations() to properly handle
> legacy const bindings. Without that change enabling the flag
> causes code like:
>
>   function f() { const x; var x; }
>
> to throw an early error, rather than wait to throw the error
> until f is invoked.
>
> BUG=v8:811
> LOG=y
> CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:linux_chromium_rel_ng;tryserver.blink:linux_blink_rel
>
> Committed: https://crrev.com/515093630a4a925a66d550561e38293d49633f10
> Cr-Commit-Position: refs/heads/master@{#32222}

TBR=rossberg@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=v8:811

Review URL: https://codereview.chromium.org/1470333002

Cr-Commit-Position: refs/heads/master@{#32226}
parent daf185b2
......@@ -207,6 +207,7 @@ DEFINE_IMPLICATION(es_staging, harmony_destructuring_bind)
// Features that are complete (but still behind --harmony/es-staging flag).
#define HARMONY_STAGED(V) \
V(harmony_destructuring_bind, "harmony destructuring") \
V(harmony_regexps, "harmony regular expression extensions") \
V(harmony_sloppy, "harmony features in sloppy mode") \
V(harmony_sloppy_let, "harmony let in sloppy mode")
......@@ -215,7 +216,6 @@ DEFINE_IMPLICATION(es_staging, harmony_destructuring_bind)
#define HARMONY_SHIPPING(V) \
V(harmony_array_includes, "harmony Array.prototype.includes") \
V(harmony_default_parameters, "harmony default parameters") \
V(harmony_destructuring_bind, "harmony destructuring bind") \
V(harmony_object_observe, "harmony Object.observe") \
V(harmony_rest_parameters, "harmony rest parameters") \
V(harmony_concat_spreadable, "harmony isConcatSpreadable") \
......
......@@ -610,11 +610,7 @@ Declaration* Scope::CheckConflictingVarDeclarations() {
int length = decls_.length();
for (int i = 0; i < length; i++) {
Declaration* decl = decls_[i];
// We don't create a separate scope to hold the function name of a function
// expression, so we have to make sure not to consider it when checking for
// conflicts (since it's conceptually "outside" the declaration scope).
if (is_function_scope() && decl == function()) continue;
if (IsLexicalVariableMode(decl->mode()) && !is_block_scope()) continue;
if (decl->mode() != VAR && !is_block_scope()) continue;
const AstRawString* name = decl->proxy()->raw_name();
// Iterate through all scopes until and including the declaration scope.
......@@ -624,11 +620,11 @@ Declaration* Scope::CheckConflictingVarDeclarations() {
// captured in Parser::Declare. The only conflicts we still need to check
// are lexical vs VAR, or any declarations within a declaration block scope
// vs lexical declarations in its surrounding (function) scope.
if (IsLexicalVariableMode(decl->mode())) current = current->outer_scope_;
if (decl->mode() != VAR) current = current->outer_scope_;
do {
// There is a conflict if there exists a non-VAR binding.
Variable* other_var = current->variables_.Lookup(name);
if (other_var != NULL && IsLexicalVariableMode(other_var->mode())) {
if (other_var != NULL && other_var->mode() != VAR) {
return decl;
}
previous = current;
......
......@@ -624,6 +624,11 @@
'js1_5/Regress/regress-417893': [FAIL_OK],
# Unsupported use of "[]" as function parameter. We match JSC.
'js1_5/Regress/regress-416737-01': [FAIL_OK],
'js1_5/Regress/regress-416737-02': [FAIL_OK],
# Illegal escape-sequences in string literals. Has already been fixed
# by most engines (i.e. V8, JSC, Opera and FF).
'ecma/Array/15.4.5.1-1': [FAIL_OK],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment