Commit e474e5ff authored by marja's avatar marja Committed by Commit bot

PreParsing inner functions: Fix declaration-only variables, part 2.

If an inner function only declares a variable but doesn't use it, Parser
and PreParser produced different unresolved variables, and that confused
the pessimistic context allocation.

This is continuation to https://codereview.chromium.org/2388183003/

This CL fixes more complicated declarations (which are not just one
identifier). For this, PreParser needs to accumulate identifiers used
in expressions.

In addition, this CL manifests FLAG_lazy_inner_functions in tests, so that
we get clusterfuzz coverage for it.

BUG=chromium:650969, v8:5501

Review-Url: https://codereview.chromium.org/2400613003
Cr-Commit-Position: refs/heads/master@{#40112}
parent c59cf8cd
......@@ -1018,7 +1018,7 @@ bool Scope::RemoveUnresolved(VariableProxy* var) {
}
bool Scope::RemoveUnresolved(const AstRawString* name) {
if (unresolved_->raw_name() == name) {
if (unresolved_ != nullptr && unresolved_->raw_name() == name) {
VariableProxy* removed = unresolved_;
unresolved_ = unresolved_->next_unresolved();
removed->set_next_unresolved(nullptr);
......@@ -1027,7 +1027,7 @@ bool Scope::RemoveUnresolved(const AstRawString* name) {
VariableProxy* current = unresolved_;
while (current != nullptr) {
VariableProxy* next = current->next_unresolved();
if (next->raw_name() == name) {
if (next != nullptr && next->raw_name() == name) {
current->set_next_unresolved(next->next_unresolved());
next->set_next_unresolved(nullptr);
return true;
......
......@@ -124,6 +124,7 @@ class DiscardableZoneScope {
parser_->zone_ = temp_zone;
if (parser_->reusable_preparser_ != nullptr) {
parser_->reusable_preparser_->zone_ = temp_zone;
parser_->reusable_preparser_->factory()->set_zone(temp_zone);
}
}
}
......@@ -132,6 +133,7 @@ class DiscardableZoneScope {
parser_->zone_ = prev_zone_;
if (parser_->reusable_preparser_ != nullptr) {
parser_->reusable_preparser_->zone_ = prev_zone_;
parser_->reusable_preparser_->factory()->set_zone(prev_zone_);
}
ast_node_factory_scope_.Reset();
}
......
......@@ -228,7 +228,7 @@ PreParserExpression PreParser::ExpressionFromIdentifier(
scope()->NewUnresolved(&factory, name.string_, start_position, end_position,
NORMAL_VARIABLE);
}
return PreParserExpression::FromIdentifier(name);
return PreParserExpression::FromIdentifier(name, zone());
}
void PreParser::DeclareAndInitializeVariables(
......@@ -236,20 +236,23 @@ void PreParser::DeclareAndInitializeVariables(
const DeclarationDescriptor* declaration_descriptor,
const DeclarationParsingResult::Declaration* declaration,
ZoneList<const AstRawString*>* names, bool* ok) {
if (declaration->pattern.string_) {
if (declaration->pattern.identifiers_ != nullptr) {
DCHECK(FLAG_lazy_inner_functions);
/* Mimic what Parser does when declaring variables (see
Parser::PatternRewriter::VisitVariableProxy).
var + no initializer -> RemoveUnresolved
let + no initializer -> RemoveUnresolved
let / const + no initializer -> RemoveUnresolved
var + initializer -> RemoveUnresolved followed by NewUnresolved
let + initializer -> RemoveUnresolved
let / const + initializer -> RemoveUnresolved
*/
if (declaration->initializer.IsEmpty() ||
declaration_descriptor->mode == VariableMode::LET) {
declaration_descriptor->scope->RemoveUnresolved(
declaration->pattern.string_);
(declaration_descriptor->mode == VariableMode::LET ||
declaration_descriptor->mode == VariableMode::CONST)) {
for (auto identifier : *(declaration->pattern.identifiers_)) {
declaration_descriptor->scope->RemoveUnresolved(identifier);
}
}
}
}
......
......@@ -118,27 +118,33 @@ class PreParserIdentifier {
const AstRawString* string_;
friend class PreParserExpression;
friend class PreParser;
friend class PreParserFactory;
};
class PreParserExpression {
public:
PreParserExpression() : code_(TypeField::encode(kEmpty)) {}
PreParserExpression()
: code_(TypeField::encode(kEmpty)), identifiers_(nullptr) {}
static PreParserExpression Empty() { return PreParserExpression(); }
static PreParserExpression Default() {
return PreParserExpression(TypeField::encode(kExpression));
static PreParserExpression Default(
ZoneList<const AstRawString*>* identifiers = nullptr) {
return PreParserExpression(TypeField::encode(kExpression), identifiers);
}
static PreParserExpression Spread(PreParserExpression expression) {
return PreParserExpression(TypeField::encode(kSpreadExpression));
return PreParserExpression(TypeField::encode(kSpreadExpression),
expression.identifiers_);
}
static PreParserExpression FromIdentifier(PreParserIdentifier id) {
return PreParserExpression(TypeField::encode(kIdentifierExpression) |
IdentifierTypeField::encode(id.type_),
id.string_);
static PreParserExpression FromIdentifier(PreParserIdentifier id,
Zone* zone) {
PreParserExpression expression(TypeField::encode(kIdentifierExpression) |
IdentifierTypeField::encode(id.type_));
expression.AddIdentifier(id.string_, zone);
return expression;
}
static PreParserExpression BinaryOperation(PreParserExpression left,
......@@ -152,12 +158,16 @@ class PreParserExpression {
ExpressionTypeField::encode(kAssignment));
}
static PreParserExpression ObjectLiteral() {
return PreParserExpression(TypeField::encode(kObjectLiteralExpression));
static PreParserExpression ObjectLiteral(
ZoneList<const AstRawString*>* identifiers = nullptr) {
return PreParserExpression(TypeField::encode(kObjectLiteralExpression),
identifiers);
}
static PreParserExpression ArrayLiteral() {
return PreParserExpression(TypeField::encode(kArrayLiteralExpression));
static PreParserExpression ArrayLiteral(
ZoneList<const AstRawString*>* identifiers = nullptr) {
return PreParserExpression(TypeField::encode(kArrayLiteralExpression),
identifiers);
}
static PreParserExpression StringLiteral() {
......@@ -344,9 +354,20 @@ class PreParserExpression {
kAssignment
};
explicit PreParserExpression(uint32_t expression_code,
const AstRawString* string = nullptr)
: code_(expression_code), string_(string) {}
explicit PreParserExpression(
uint32_t expression_code,
ZoneList<const AstRawString*>* identifiers = nullptr)
: code_(expression_code), identifiers_(identifiers) {}
void AddIdentifier(const AstRawString* identifier, Zone* zone) {
if (identifier == nullptr) {
return;
}
if (identifiers_ == nullptr) {
identifiers_ = new (zone) ZoneList<const AstRawString*>(1, zone);
}
identifiers_->Add(identifier, zone);
}
// The first three bits are for the Type.
typedef BitField<Type, 0, 3> TypeField;
......@@ -368,31 +389,61 @@ class PreParserExpression {
typedef BitField<bool, TypeField::kNext, 1> HasCoverInitializedNameField;
uint32_t code_;
// Non-nullptr if the expression is one identifier.
const AstRawString* string_;
// If the PreParser is used in the identifier tracking mode,
// PreParserExpression accumulates identifiers in that expression.
ZoneList<const AstRawString*>* identifiers_;
friend class PreParser;
friend class PreParserFactory;
template <typename T>
friend class PreParserList;
};
// The pre-parser doesn't need to build lists of expressions, identifiers, or
// the like.
// the like. If the PreParser is used in identifier tracking mode, it needs to
// build lists of identifiers though.
template <typename T>
class PreParserList {
public:
// These functions make list->Add(some_expression) work (and do nothing).
PreParserList() : length_(0) {}
PreParserList() : length_(0), identifiers_(nullptr) {}
PreParserList* operator->() { return this; }
void Add(T, void*) { ++length_; }
void Add(T, Zone* zone);
int length() const { return length_; }
static PreParserList Null() { return PreParserList(-1); }
bool IsNull() const { return length_ == -1; }
private:
explicit PreParserList(int n) : length_(n) {}
explicit PreParserList(int n) : length_(n), identifiers_(nullptr) {}
int length_;
ZoneList<const AstRawString*>* identifiers_;
friend class PreParser;
friend class PreParserFactory;
};
template <>
inline void PreParserList<PreParserExpression>::Add(
PreParserExpression expression, Zone* zone) {
if (expression.identifiers_ != nullptr) {
DCHECK(FLAG_lazy_inner_functions);
DCHECK(zone != nullptr);
if (identifiers_ == nullptr) {
identifiers_ = new (zone) ZoneList<const AstRawString*>(1, zone);
}
for (auto identifier : (*expression.identifiers_)) {
identifiers_->Add(identifier, zone);
}
}
++length_;
}
template <typename T>
void PreParserList<T>::Add(T, Zone* zone) {
++length_;
}
typedef PreParserList<PreParserExpression> PreParserExpressionList;
class PreParserStatement;
......@@ -480,10 +531,18 @@ class PreParserStatement {
class PreParserFactory {
public:
explicit PreParserFactory(void* unused_value_factory) {}
explicit PreParserFactory(AstValueFactory* ast_value_factory)
: zone_(ast_value_factory->zone()) {}
void set_zone(Zone* zone) { zone_ = zone; }
PreParserExpression NewStringLiteral(PreParserIdentifier identifier,
int pos) {
return PreParserExpression::Default();
// This is needed for object literal property names. Property names are
// normalized to string literals during object literal parsing.
PreParserExpression expression = PreParserExpression::Default();
expression.AddIdentifier(identifier.string_, zone_);
return expression;
}
PreParserExpression NewNumberLiteral(double number,
int pos) {
......@@ -500,7 +559,7 @@ class PreParserFactory {
PreParserExpression NewArrayLiteral(PreParserExpressionList values,
int first_spread_index, int literal_index,
int pos) {
return PreParserExpression::ArrayLiteral();
return PreParserExpression::ArrayLiteral(values.identifiers_);
}
PreParserExpression NewClassLiteralProperty(PreParserExpression key,
PreParserExpression value,
......@@ -513,18 +572,18 @@ class PreParserFactory {
PreParserExpression value,
ObjectLiteralProperty::Kind kind,
bool is_computed_name) {
return PreParserExpression::Default();
return PreParserExpression::Default(value.identifiers_);
}
PreParserExpression NewObjectLiteralProperty(PreParserExpression key,
PreParserExpression value,
bool is_computed_name) {
return PreParserExpression::Default();
return PreParserExpression::Default(value.identifiers_);
}
PreParserExpression NewObjectLiteral(PreParserExpressionList properties,
int literal_index,
int boilerplate_properties,
int pos) {
return PreParserExpression::ObjectLiteral();
return PreParserExpression::ObjectLiteral(properties.identifiers_);
}
PreParserExpression NewVariableProxy(void* variable) {
return PreParserExpression::Default();
......@@ -693,6 +752,9 @@ class PreParserFactory {
static int dummy = 42;
return &dummy;
}
private:
Zone* zone_;
};
......@@ -1408,7 +1470,7 @@ class PreParser : public ParserBase<PreParser> {
V8_INLINE PreParserExpression
ExpressionListToExpression(PreParserExpressionList args) {
return PreParserExpression::Default();
return PreParserExpression::Default(args.identifiers_);
}
V8_INLINE void AddAccessorPrefixToFunctionName(bool is_get,
......
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --min-preparse-length 1 --allow-natives-syntax
// Flags: --min-preparse-length 1 --allow-natives-syntax --lazy-inner-functions
// Test that the information on which variables to allocate in context doesn't
// change when recompiling.
......@@ -50,6 +50,24 @@
}
})();
(function TestConstInInnerFunction() {
var a = 1;
var b = 2;
var c = 3;
function inner() {
const a = 0;
a; b; c;
}
for (var i = 0; i < 3; ++i) {
if (i == 1) {
%OptimizeOsr();
}
assertEquals(1, a);
assertEquals(2, b);
assertEquals(3, c);
}
})();
(function TestInnerFunctionParameter() {
var a = 1;
var b = 2;
......@@ -67,6 +85,23 @@
}
})();
(function TestInnerFunctionRestParameter() {
var a = 1;
var b = 2;
var c = 3;
function inner(...a) {
a; b; c;
}
for (var i = 0; i < 3; ++i) {
if (i == 1) {
%OptimizeOsr();
}
assertEquals(1, a);
assertEquals(2, b);
assertEquals(3, c);
}
})();
(function TestInnerInnerFunctionParameter() {
var a = 1;
var b = 2;
......@@ -84,6 +119,23 @@
}
})();
(function TestInnerInnerFunctionRestParameter() {
var a = 1;
var b = 2;
var c = 3;
function inner() {
function innerinner(...a) { a; b; c; }
}
for (var i = 0; i < 3; ++i) {
if (i == 1) {
%OptimizeOsr();
}
assertEquals(1, a);
assertEquals(2, b);
assertEquals(3, c);
}
})();
(function TestInnerArrowFunctionParameter() {
var a = 1;
var b = 2;
......@@ -101,6 +153,23 @@
}
})();
(function TestInnerArrowFunctionRestParameter() {
var a = 1;
var b = 2;
var c = 3;
function inner() {
var f = (...a) => a + b + c;
}
for (var i = 0; i < 3; ++i) {
if (i == 1) {
%OptimizeOsr();
}
assertEquals(1, a);
assertEquals(2, b);
assertEquals(3, c);
}
})();
(function TestInnerFunctionInnerFunction() {
var a = 1;
var b = 2;
......@@ -252,9 +321,171 @@
}
})();
(function TestInnerFunctionDestructuring1() {
var a = 1;
var b = 2;
var c = 3;
function inner() {
var [a, a2] = [1, 2];
a; b; c;
}
for (var i = 0; i < 3; ++i) {
if (i == 1) {
%OptimizeOsr();
}
assertEquals(1, a);
assertEquals(2, b);
assertEquals(3, c);
}
})();
(function TestInnerFunctionDestructuring2() {
var a = 1;
var b = 2;
var c = 3;
function inner() {
let [a, a2] = [1, 2];
a; b; c;
}
for (var i = 0; i < 3; ++i) {
if (i == 1) {
%OptimizeOsr();
}
assertEquals(1, a);
assertEquals(2, b);
assertEquals(3, c);
}
})();
(function TestInnerFunctionDestructuring3() {
var a = 1;
var b = 2;
var c = 3;
function inner() {
const [a, a2] = [1, 2];
a; b; c;
}
for (var i = 0; i < 3; ++i) {
if (i == 1) {
%OptimizeOsr();
}
assertEquals(1, a);
assertEquals(2, b);
assertEquals(3, c);
}
})();
(function TestInnerFunctionDestructuring4() {
var a = 1;
var b = 2;
var c = 3;
function inner() {
var [a2, ...a] = [1, 2];
a; b; c;
}
for (var i = 0; i < 3; ++i) {
if (i == 1) {
%OptimizeOsr();
}
assertEquals(1, a);
assertEquals(2, b);
assertEquals(3, c);
}
})();
(function TestInnerFunctionDestructuring5() {
var a = 1;
var b = 2;
var c = 3;
function inner() {
let [a2, ...a] = [1, 2];
a; b; c;
}
for (var i = 0; i < 3; ++i) {
if (i == 1) {
%OptimizeOsr();
}
assertEquals(1, a);
assertEquals(2, b);
assertEquals(3, c);
}
})();
(function TestInnerFunctionDestructuring6() {
var a = 1;
var b = 2;
var c = 3;
function inner() {
const [a2, ...a] = [1, 2];
a; b; c;
}
for (var i = 0; i < 3; ++i) {
if (i == 1) {
%OptimizeOsr();
}
assertEquals(1, a);
assertEquals(2, b);
assertEquals(3, c);
}
})();
(function TestInnerFunctionDestructuring7() {
var a = 1;
var b = 2;
var c = 3;
function inner() {
var {a, a2} = {a: 1, a2: 2};
a; b; c;
}
for (var i = 0; i < 3; ++i) {
if (i == 1) {
%OptimizeOsr();
}
assertEquals(1, a);
assertEquals(2, b);
assertEquals(3, c);
}
})();
(function TestInnerFunctionDestructuring8() {
var a = 1;
var b = 2;
var c = 3;
function inner() {
let {a, a2} = {a: 1, a2: 2};
a; b; c;
}
for (var i = 0; i < 3; ++i) {
if (i == 1) {
%OptimizeOsr();
}
assertEquals(1, a);
assertEquals(2, b);
assertEquals(3, c);
}
})();
(function TestInnerFunctionDestructuring9() {
var a = 1;
var b = 2;
var c = 3;
function inner() {
const {a, a2} = {a: 1, a2: 2};
a; b; c;
}
for (var i = 0; i < 3; ++i) {
if (i == 1) {
%OptimizeOsr();
}
assertEquals(1, a);
assertEquals(2, b);
assertEquals(3, c);
}
})();
// A cluster of similar tests where the inner function only declares a variable
// whose name clashes with an outer function variable name, but doesn't use it.
(function TestRegress650969_1() {
(function TestRegress650969_1_var() {
for (var i = 0; i < 3; ++i) {
if (i == 1) {
%OptimizeOsr();
......@@ -266,67 +497,67 @@
}
})();
(function TestRegress650969_2() {
(function TestRegress650969_1_let() {
for (var i = 0; i < 3; ++i) {
if (i == 1) {
%OptimizeOsr();
}
var a;
function inner() {
var a = 6;
let a;
}
}
})();
(function TestRegress650969_3() {
(function TestRegress650969_2_var() {
for (var i = 0; i < 3; ++i) {
if (i == 1) {
%OptimizeOsr();
}
var a;
function inner() {
var a, b;
var a = 6;
}
}
})();
(function TestRegress650969_4() {
(function TestRegress650969_2_let() {
for (var i = 0; i < 3; ++i) {
if (i == 1) {
%OptimizeOsr();
}
var a;
function inner() {
var a = 6, b;
let a = 6;
}
}
})();
(function TestRegress650969_5() {
(function TestRegress650969_2_const() {
for (var i = 0; i < 3; ++i) {
if (i == 1) {
%OptimizeOsr();
}
var a;
function inner() {
let a;
const a = 6;
}
}
})();
(function TestRegress650969_6() {
(function TestRegress650969_3_var() {
for (var i = 0; i < 3; ++i) {
if (i == 1) {
%OptimizeOsr();
}
var a;
function inner() {
let a = 6;
var a, b;
}
}
})();
(function TestRegress650969_7() {
(function TestRegress650969_3_let() {
for (var i = 0; i < 3; ++i) {
if (i == 1) {
%OptimizeOsr();
......@@ -338,7 +569,19 @@
}
})();
(function TestRegress650969_8() {
(function TestRegress650969_4_var() {
for (var i = 0; i < 3; ++i) {
if (i == 1) {
%OptimizeOsr();
}
var a;
function inner() {
var a = 6, b;
}
}
})();
(function TestRegress650969_4_let() {
for (var i = 0; i < 3; ++i) {
if (i == 1) {
%OptimizeOsr();
......@@ -350,6 +593,18 @@
}
})();
(function TestRegress650969_4_const() {
for (var i = 0; i < 3; ++i) {
if (i == 1) {
%OptimizeOsr();
}
var a;
function inner() {
const a = 0, b = 0;
}
}
})();
(function TestRegress650969_9() {
for (var i = 0; i < 3; ++i) {
if (i == 1) {
......@@ -360,3 +615,307 @@
}
}
})();
(function TestRegress650969_10() {
for (var i = 0; i < 3; ++i) {
if (i == 1) {
%OptimizeOsr();
}
var a;
function inner(...a) {
}
}
})();
(function TestRegress650969_11_var() {
for (var i = 0; i < 3; ++i) {
if (i == 1) {
%OptimizeOsr();
}
var a;
function inner() {
var [a, b] = [1, 2];
}
}
})();
(function TestRegress650969_11_let() {
for (var i = 0; i < 3; ++i) {
if (i == 1) {
%OptimizeOsr();
}
var a;
function inner() {
let [a, b] = [1, 2];
}
}
})();
(function TestRegress650969_11_const() {
for (var i = 0; i < 3; ++i) {
if (i == 1) {
%OptimizeOsr();
}
var a;
function inner() {
const [a, b] = [1, 2];
}
}
})();
(function TestRegress650969_12_var() {
for (var i = 0; i < 3; ++i) {
if (i == 1) {
%OptimizeOsr();
}
var a;
function inner() {
var [b, a] = [1, 2];
}
}
})();
(function TestRegress650969_12_let() {
for (var i = 0; i < 3; ++i) {
if (i == 1) {
%OptimizeOsr();
}
var a;
function inner() {
let [b, a] = [1, 2];
}
}
})();
(function TestRegress650969_12_const() {
for (var i = 0; i < 3; ++i) {
if (i == 1) {
%OptimizeOsr();
}
var a;
function inner() {
const [b, a] = [1, 2];
}
}
})();
(function TestRegress650969_13_var() {
for (var i = 0; i < 3; ++i) {
if (i == 1) {
%OptimizeOsr();
}
var a;
function inner() {
var [b, ...a] = [1, 2];
}
}
})();
(function TestRegress650969_13_let() {
for (var i = 0; i < 3; ++i) {
if (i == 1) {
%OptimizeOsr();
}
var a;
function inner() {
let [b, ...a] = [1, 2];
}
}
})();
(function TestRegress650969_13_const() {
for (var i = 0; i < 3; ++i) {
if (i == 1) {
%OptimizeOsr();
}
var a;
function inner() {
const [b, ...a] = [1, 2];
}
}
})();
(function TestRegress650969_14_var() {
for (var i = 0; i < 3; ++i) {
if (i == 1) {
%OptimizeOsr();
}
var a;
function inner() {
var {a, b} = {a: 1, b: 2};
}
}
})();
(function TestRegress650969_14_let() {
for (var i = 0; i < 3; ++i) {
if (i == 1) {
%OptimizeOsr();
}
var a;
function inner() {
let {a, b} = {a: 1, b: 2};
}
}
})();
(function TestRegress650969_14_const() {
for (var i = 0; i < 3; ++i) {
if (i == 1) {
%OptimizeOsr();
}
var a;
function inner() {
const {a, b} = {a: 1, b: 2};
}
}
})();
(function TestRegress650969_15_var() {
for (var i = 0; i < 3; ++i) {
if (i == 1) {
%OptimizeOsr();
}
var a;
function inner() {
var {b: {a}, c} = {b: {a: 1}, c: 2};
}
}
})();
(function TestRegress650969_15_let() {
for (var i = 0; i < 3; ++i) {
if (i == 1) {
%OptimizeOsr();
}
var a;
function inner() {
let {b: {a}, c} = {b: {a: 1}, c: 2};
}
}
})();
(function TestRegress650969_15_const() {
for (var i = 0; i < 3; ++i) {
if (i == 1) {
%OptimizeOsr();
}
var a;
function inner() {
const {b: {a}, c} = {b: {a: 1}, c: 2};
}
}
})();
(function TestRegress650969_16_var() {
for (var i = 0; i < 3; ++i) {
if (i == 1) {
%OptimizeOsr();
}
var a;
function inner() {
var {a: {b}, c} = {a: {b: 1}, c: 2};
}
}
})();
(function TestRegress650969_16_let() {
for (var i = 0; i < 3; ++i) {
if (i == 1) {
%OptimizeOsr();
}
var a;
function inner() {
let {a: {b}, c} = {a: {b: 1}, c: 2};
}
}
})();
(function TestRegress650969_16_const() {
for (var i = 0; i < 3; ++i) {
if (i == 1) {
%OptimizeOsr();
}
var a;
function inner() {
const {a: {b}, c} = {a: {b: 1}, c: 2};
}
}
})();
(function TestRegress650969_17_var() {
for (var i = 0; i < 3; ++i) {
if (i == 1) {
%OptimizeOsr();
}
var a;
function inner() {
for (var a = 0; 0 == 1; ) { }
}
}
})();
(function TestRegress650969_17_let() {
for (var i = 0; i < 3; ++i) {
if (i == 1) {
%OptimizeOsr();
}
var a;
function inner() {
for (let a = 0; 0 == 1; ) { }
}
}
})();
(function TestRegress650969_17_const() {
for (var i = 0; i < 3; ++i) {
if (i == 1) {
%OptimizeOsr();
}
var a;
function inner() {
for (const a = 0; 0 == 1; ) { }
}
}
})();
// Regression tests for an intermediate stage where unresolved references were
// discarded too aggressively.
(function TestRegress650969_sidetrack_var() {
for (var i = 0; i < 3; ++i) {
if (i == 1) {
%OptimizeOsr();
}
var a = 0;
function inner() {
return a;
var {b: {a}, c} = {b: {a: 1}, c: 2};
}
}
})();
(function TestRegress650969_sidetrack_let() {
for (var i = 0; i < 3; ++i) {
if (i == 1) {
%OptimizeOsr();
}
var a = 0;
function inner() {
return a;
let {b: {a}, c} = {b: {a: 1}, c: 2};
}
}
})();
(function TestRegress650969_sidetrack_const() {
for (var i = 0; i < 3; ++i) {
if (i == 1) {
%OptimizeOsr();
}
var a = 0;
function inner() {
return a;
const {b: {a}, c} = {b: {a: 1}, c: 2};
}
}
})();
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