Commit 9bb78e32 authored by Maya Lekova's avatar Maya Lekova Committed by Commit Bot

Revert "[parser] Create arrow function scopes while parsing the head"

This reverts commit 3411e7c3.

Reason for revert: Breaks test expecations - https://ci.chromium.org/p/chromium/builders/luci.chromium.try/linux_chromium_rel_ng/260731

Original change's description:
> [parser] Create arrow function scopes while parsing the head
> 
> This simplifies NextArrowFunctionInfo, allows us to Scope::Snapshot::Reparent
> directly rather than moving it, and allows us to skip reparenting in the simple
> parameter arrow function cases.
> 
> This CL additionally fixes arrow function name inferring.
> 
> Change-Id: Ie3e5ea778f3d7b84b2a10d4f4ff73931cfc9384a
> Reviewed-on: https://chromium-review.googlesource.com/c/1386147
> Reviewed-by: Igor Sheludko <ishell@chromium.org>
> Commit-Queue: Toon Verwaest <verwaest@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#58405}

TBR=ishell@chromium.org,verwaest@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: I8f31b96f844f0673364bf435fa6c809e40d62fa3
Reviewed-on: https://chromium-review.googlesource.com/c/1388541Reviewed-by: 's avatarMaya Lekova <mslekova@chromium.org>
Commit-Queue: Maya Lekova <mslekova@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58446}
parent 84bad8ec
...@@ -888,15 +888,11 @@ void Scope::Snapshot::Reparent(DeclarationScope* new_parent) { ...@@ -888,15 +888,11 @@ void Scope::Snapshot::Reparent(DeclarationScope* new_parent) {
outer_closure->locals_.Rewind(top_local_); outer_closure->locals_.Rewind(top_local_);
// Move eval calls since Snapshot's creation into new_parent. // Move eval calls since Snapshot's creation into new_parent.
if (outer_scope_and_calls_eval_->scope_calls_eval_) { if (outer_scope_and_calls_eval_.GetPayload()) {
new_parent->scope_calls_eval_ = true; new_parent->scope_calls_eval_ = true;
new_parent->inner_scope_calls_eval_ = true; new_parent->inner_scope_calls_eval_ = true;
} }
// We are in the arrow function case. The calls eval we may have recorded
// is intended for the inner scope and we should simply restore the
// original "calls eval" flag of the outer scope.
RestoreEvalFlag();
Clear(); Clear();
} }
......
...@@ -147,6 +147,24 @@ class V8_EXPORT_PRIVATE Scope : public NON_EXPORTED_BASE(ZoneObject) { ...@@ -147,6 +147,24 @@ class V8_EXPORT_PRIVATE Scope : public NON_EXPORTED_BASE(ZoneObject) {
outer_scope_and_calls_eval_.GetPayload(); outer_scope_and_calls_eval_.GetPayload();
} }
Snapshot& operator=(Snapshot&& source) V8_NOEXCEPT {
outer_scope_and_calls_eval_.SetPointer(
source.outer_scope_and_calls_eval_.GetPointer());
outer_scope_and_calls_eval_.SetPayload(
outer_scope_and_calls_eval_->scope_calls_eval_);
top_inner_scope_ = source.top_inner_scope_;
top_unresolved_ = source.top_unresolved_;
top_local_ = source.top_local_;
// We are in the arrow function case. The calls eval we may have recorded
// is intended for the inner scope and we should simply restore the
// original "calls eval" flag of the outer scope.
source.RestoreEvalFlag();
source.Clear();
return *this;
}
void Reparent(DeclarationScope* new_parent); void Reparent(DeclarationScope* new_parent);
bool IsCleared() const { bool IsCleared() const {
return outer_scope_and_calls_eval_.GetPointer() == nullptr; return outer_scope_and_calls_eval_.GetPointer() == nullptr;
......
...@@ -271,6 +271,8 @@ class ParserBase { ...@@ -271,6 +271,8 @@ class ParserBase {
pointer_buffer_.reserve(128); pointer_buffer_.reserve(128);
} }
~ParserBase() { next_arrow_function_info_.scope_snapshot.Clear(); }
#define ALLOW_ACCESSORS(name) \ #define ALLOW_ACCESSORS(name) \
bool allow_##name() const { return allow_##name##_; } \ bool allow_##name() const { return allow_##name##_; } \
void set_allow_##name(bool allow) { allow_##name##_ = allow; } void set_allow_##name(bool allow) { allow_##name##_ = allow; }
...@@ -1383,6 +1385,7 @@ class ParserBase { ...@@ -1383,6 +1385,7 @@ class ParserBase {
// Preallocating the struct as part of the parser minimizes the cost of // Preallocating the struct as part of the parser minimizes the cost of
// supporting arrow functions on non-arrow expressions. // supporting arrow functions on non-arrow expressions.
struct NextArrowFunctionInfo { struct NextArrowFunctionInfo {
Scope::Snapshot scope_snapshot;
// `rewritable_length`: length of the destructuring_assignments_to_rewrite() // `rewritable_length`: length of the destructuring_assignments_to_rewrite()
// queue in the parent function state, prior to parsing of formal // queue in the parent function state, prior to parsing of formal
// parameters. If the arrow function is lazy, any items added during formal // parameters. If the arrow function is lazy, any items added during formal
...@@ -1391,15 +1394,19 @@ class ParserBase { ...@@ -1391,15 +1394,19 @@ class ParserBase {
Scanner::Location strict_parameter_error_location = Scanner::Location strict_parameter_error_location =
Scanner::Location::invalid(); Scanner::Location::invalid();
MessageTemplate strict_parameter_error_message = MessageTemplate::kNone; MessageTemplate strict_parameter_error_message = MessageTemplate::kNone;
DeclarationScope* scope = nullptr; FunctionKind kind = FunctionKind::kArrowFunction;
bool has_simple_parameter_list = true;
bool HasInitialState() const { bool HasInitialState() const {
return rewritable_length == -1 && scope == nullptr; return rewritable_length == -1 && scope_snapshot.IsCleared() &&
kind == FunctionKind::kArrowFunction && has_simple_parameter_list;
} }
void Reset() { void Reset() {
rewritable_length = -1; rewritable_length = -1;
scope = nullptr; scope_snapshot.Clear();
kind = FunctionKind::kArrowFunction;
has_simple_parameter_list = true;
ClearStrictParameterError(); ClearStrictParameterError();
DCHECK(HasInitialState()); DCHECK(HasInitialState());
} }
...@@ -1655,7 +1662,8 @@ ParserBase<Impl>::ParsePrimaryExpression() { ...@@ -1655,7 +1662,8 @@ ParserBase<Impl>::ParsePrimaryExpression() {
if (Token::IsAnyIdentifier(token)) { if (Token::IsAnyIdentifier(token)) {
Consume(token); Consume(token);
FunctionKind kind = FunctionKind::kArrowFunction; IdentifierT name;
InferName infer = InferName::kYes;
if (V8_UNLIKELY(token == Token::ASYNC && if (V8_UNLIKELY(token == Token::ASYNC &&
!scanner()->HasLineTerminatorBeforeNext())) { !scanner()->HasLineTerminatorBeforeNext())) {
...@@ -1666,28 +1674,28 @@ ParserBase<Impl>::ParsePrimaryExpression() { ...@@ -1666,28 +1674,28 @@ ParserBase<Impl>::ParsePrimaryExpression() {
if (peek_any_identifier() && PeekAhead() == Token::ARROW) { if (peek_any_identifier() && PeekAhead() == Token::ARROW) {
token = Next(); token = Next();
beg_pos = position(); beg_pos = position();
kind = FunctionKind::kAsyncArrowFunction; next_arrow_function_info_.kind = FunctionKind::kAsyncArrowFunction;
infer = InferName::kNo;
} }
} }
if (V8_UNLIKELY(peek() == Token::ARROW)) { if (V8_UNLIKELY(peek() == Token::ARROW)) {
next_arrow_function_info_.scope = NewFunctionScope(kind);
ArrowHeadParsingScope parsing_scope( ArrowHeadParsingScope parsing_scope(
impl(), kind == FunctionKind::kArrowFunction impl(), next_arrow_function_info_.kind == FunctionKind::kArrowFunction
? ExpressionScope::kMaybeArrowParameterDeclaration ? ExpressionScope::kMaybeArrowParameterDeclaration
: ExpressionScope::kMaybeAsyncArrowParameterDeclaration); : ExpressionScope::kMaybeAsyncArrowParameterDeclaration);
next_arrow_function_info_.scope_snapshot =
std::move(Scope::Snapshot(scope()));
next_arrow_function_info_.rewritable_length = static_cast<int>( next_arrow_function_info_.rewritable_length = static_cast<int>(
function_state_->destructuring_assignments_to_rewrite().size()); function_state_->destructuring_assignments_to_rewrite().size());
IdentifierT name = ParseAndClassifyIdentifier(token); name = ParseAndClassifyIdentifier(token);
ClassifyParameter(name, beg_pos, end_position()); ClassifyParameter(name, beg_pos, end_position());
parsing_scope.ValidateDeclaration(); parsing_scope.ValidateDeclaration();
FunctionState function_state(&function_state_, &scope_, } else {
next_arrow_function_info_.scope); name = ParseAndClassifyIdentifier(token);
return impl()->ExpressionFromIdentifier(name, beg_pos, InferName::kNo);
} }
IdentifierT name = ParseAndClassifyIdentifier(token); return impl()->ExpressionFromIdentifier(name, beg_pos, infer);
return impl()->ExpressionFromIdentifier(name, beg_pos);
} }
if (Token::IsLiteral(token)) { if (Token::IsLiteral(token)) {
...@@ -1712,18 +1720,17 @@ ParserBase<Impl>::ParsePrimaryExpression() { ...@@ -1712,18 +1720,17 @@ ParserBase<Impl>::ParsePrimaryExpression() {
case Token::LPAREN: { case Token::LPAREN: {
Consume(Token::LPAREN); Consume(Token::LPAREN);
Scope::Snapshot scope_snapshot(scope());
int rewritable_length = static_cast<int>( int rewritable_length = static_cast<int>(
function_state_->destructuring_assignments_to_rewrite().size()); function_state_->destructuring_assignments_to_rewrite().size());
if (Check(Token::RPAREN)) { if (Check(Token::RPAREN)) {
// ()=>x. The continuation that consumes the => is in // ()=>x. The continuation that consumes the => is in
// ParseAssignmentExpressionCoverGrammar. // ParseAssignmentExpressionCoverGrammar.
if (peek() != Token::ARROW) ReportUnexpectedToken(Token::RPAREN); if (peek() != Token::ARROW) ReportUnexpectedToken(Token::RPAREN);
next_arrow_function_info_.scope = next_arrow_function_info_.scope_snapshot = std::move(scope_snapshot);
NewFunctionScope(FunctionKind::kArrowFunction);
next_arrow_function_info_.rewritable_length = rewritable_length; next_arrow_function_info_.rewritable_length = rewritable_length;
return factory()->NewEmptyParentheses(beg_pos); return factory()->NewEmptyParentheses(beg_pos);
} }
Scope::Snapshot scope_snapshot(scope());
ArrowHeadParsingScope maybe_arrow( ArrowHeadParsingScope maybe_arrow(
impl(), ExpressionScope::kMaybeArrowParameterDeclaration); impl(), ExpressionScope::kMaybeArrowParameterDeclaration);
// Heuristically try to detect immediately called functions before // Heuristically try to detect immediately called functions before
...@@ -1738,12 +1745,9 @@ ParserBase<Impl>::ParsePrimaryExpression() { ...@@ -1738,12 +1745,9 @@ ParserBase<Impl>::ParsePrimaryExpression() {
Expect(Token::RPAREN); Expect(Token::RPAREN);
if (peek() == Token::ARROW) { if (peek() == Token::ARROW) {
next_arrow_function_info_.scope = next_arrow_function_info_.scope_snapshot = std::move(scope_snapshot);
NewFunctionScope(FunctionKind::kArrowFunction); next_arrow_function_info_.has_simple_parameter_list =
scope_snapshot.Reparent(next_arrow_function_info_.scope); maybe_arrow.has_simple_parameter_list();
if (!maybe_arrow.has_simple_parameter_list()) {
next_arrow_function_info_.scope->SetHasNonSimpleParameters();
}
next_arrow_function_info_.rewritable_length = rewritable_length; next_arrow_function_info_.rewritable_length = rewritable_length;
maybe_arrow.ValidateDeclaration(); maybe_arrow.ValidateDeclaration();
} else { } else {
...@@ -2614,6 +2618,7 @@ ParserBase<Impl>::ParseAssignmentExpressionCoverGrammar() { ...@@ -2614,6 +2618,7 @@ ParserBase<Impl>::ParseAssignmentExpressionCoverGrammar() {
// Arrow functions. // Arrow functions.
if (V8_UNLIKELY(op == Token::ARROW)) { if (V8_UNLIKELY(op == Token::ARROW)) {
Scanner::Location loc(lhs_beg_pos, end_position()); Scanner::Location loc(lhs_beg_pos, end_position());
DeclarationScope* scope = NewFunctionScope(next_arrow_function_info_.kind);
if (!impl()->IsIdentifier(expression) && !expression->is_parenthesized()) { if (!impl()->IsIdentifier(expression) && !expression->is_parenthesized()) {
impl()->ReportMessageAt( impl()->ReportMessageAt(
...@@ -2622,19 +2627,26 @@ ParserBase<Impl>::ParseAssignmentExpressionCoverGrammar() { ...@@ -2622,19 +2627,26 @@ ParserBase<Impl>::ParseAssignmentExpressionCoverGrammar() {
return impl()->FailureExpression(); return impl()->FailureExpression();
} }
DeclarationScope* scope = next_arrow_function_info_.scope; // Because the arrow's parameters were parsed in the outer scope,
scope->set_start_position(lhs_beg_pos); // we need to fix up the scope chain appropriately.
next_arrow_function_info_.scope_snapshot.Reparent(scope);
FormalParametersT parameters(scope); FormalParametersT parameters(scope);
parameters.set_strict_parameter_error( parameters.set_strict_parameter_error(
next_arrow_function_info_.strict_parameter_error_location, next_arrow_function_info_.strict_parameter_error_location,
next_arrow_function_info_.strict_parameter_error_message); next_arrow_function_info_.strict_parameter_error_message);
parameters.is_simple = scope->has_simple_parameters(); if (!next_arrow_function_info_.has_simple_parameter_list) {
scope->SetHasNonSimpleParameters();
parameters.is_simple = false;
}
scope->set_start_position(lhs_beg_pos);
impl()->DeclareArrowFunctionFormalParameters(&parameters, expression, loc); impl()->DeclareArrowFunctionFormalParameters(&parameters, expression, loc);
expression = ParseArrowFunctionLiteral(parameters); expression = ParseArrowFunctionLiteral(parameters);
fni_.Infer();
return expression; return expression;
} }
...@@ -2911,13 +2923,12 @@ ParserBase<Impl>::ParseUnaryOrPrefixExpression() { ...@@ -2911,13 +2923,12 @@ ParserBase<Impl>::ParseUnaryOrPrefixExpression() {
DCHECK(Token::IsCountOp(op)); DCHECK(Token::IsCountOp(op));
if (V8_LIKELY(IsValidReferenceExpression(expression))) { if (V8_UNLIKELY(!IsValidReferenceExpression(expression))) {
if (peek() != Token::ARROW) impl()->MarkExpressionAsAssigned(expression);
} else {
expression = RewriteInvalidReferenceExpression( expression = RewriteInvalidReferenceExpression(
expression, expression_position, end_position(), expression, expression_position, end_position(),
MessageTemplate::kInvalidLhsInPrefixOp); MessageTemplate::kInvalidLhsInPrefixOp);
} }
impl()->MarkExpressionAsAssigned(expression);
return factory()->NewCountOperation(op, true /* prefix */, expression, return factory()->NewCountOperation(op, true /* prefix */, expression,
position()); position());
...@@ -3026,17 +3037,15 @@ ParserBase<Impl>::ParseLeftHandSideContinuation(ExpressionT result) { ...@@ -3026,17 +3037,15 @@ ParserBase<Impl>::ParseLeftHandSideContinuation(ExpressionT result) {
if (V8_LIKELY(peek() == Token::ARROW)) { if (V8_LIKELY(peek() == Token::ARROW)) {
maybe_arrow.ValidateDeclaration(); maybe_arrow.ValidateDeclaration();
fni_.RemoveAsyncKeywordFromEnd(); fni_.RemoveAsyncKeywordFromEnd();
next_arrow_function_info_.scope = next_arrow_function_info_.kind = FunctionKind::kAsyncArrowFunction;
NewFunctionScope(FunctionKind::kAsyncArrowFunction); next_arrow_function_info_.scope_snapshot = std::move(scope_snapshot);
scope_snapshot.Reparent(next_arrow_function_info_.scope);
next_arrow_function_info_.rewritable_length = rewritable_length; next_arrow_function_info_.rewritable_length = rewritable_length;
// async () => ... // async () => ...
if (!args.length()) return factory()->NewEmptyParentheses(pos); if (!args.length()) return factory()->NewEmptyParentheses(pos);
// async ( Arguments ) => ... // async ( Arguments ) => ...
ExpressionT result = impl()->ExpressionListToExpression(args); ExpressionT result = impl()->ExpressionListToExpression(args);
if (!maybe_arrow.has_simple_parameter_list()) { next_arrow_function_info_.has_simple_parameter_list =
next_arrow_function_info_.scope->SetHasNonSimpleParameters(); maybe_arrow.has_simple_parameter_list();
}
result->mark_parenthesized(); result->mark_parenthesized();
return result; return result;
} }
...@@ -4071,13 +4080,10 @@ ParserBase<Impl>::ParseArrowFunctionLiteral( ...@@ -4071,13 +4080,10 @@ ParserBase<Impl>::ParseArrowFunctionLiteral(
// In case we did not sucessfully preparse the function because of an // In case we did not sucessfully preparse the function because of an
// unidentified error we do a full reparse to return the error. // unidentified error we do a full reparse to return the error.
ExpressionT expression = ParseConditionalExpression(); ExpressionT expression = ParseConditionalExpression();
DeclarationScope* function_scope = next_arrow_function_info_.scope; Scanner::Location loc(scope()->start_position(), end_position());
FunctionState function_state(&function_state_, &scope_, FormalParametersT parameters(formal_parameters.scope);
function_scope); parameters.is_simple =
Scanner::Location loc(function_scope->start_position(), next_arrow_function_info_.has_simple_parameter_list;
end_position());
FormalParametersT parameters(function_scope);
parameters.is_simple = function_scope->has_simple_parameters();
impl()->DeclareArrowFunctionFormalParameters(&parameters, expression, impl()->DeclareArrowFunctionFormalParameters(&parameters, expression,
loc); loc);
next_arrow_function_info_.Reset(); next_arrow_function_info_.Reset();
......
...@@ -42,7 +42,7 @@ userFunction (test.js:1:36) ...@@ -42,7 +42,7 @@ userFunction (test.js:1:36)
-- inner async -- -- inner async --
runWithRegular (utils.js:2:12) runWithRegular (utils.js:2:12)
inner (test.js:2:28) inner (test.js:2:28)
(anonymous) (utils.js:21:4) runWithRegular (utils.js:21:4)
<external stack> <external stack>
EmptyName EmptyName
...@@ -88,7 +88,7 @@ userFunction (test.js:1:36) ...@@ -88,7 +88,7 @@ userFunction (test.js:1:36)
-- <empty> -- -- <empty> --
runWithEmptyName (utils.js:6:12) runWithEmptyName (utils.js:6:12)
inner (test.js:2:28) inner (test.js:2:28)
(anonymous) (utils.js:21:4) runWithRegular (utils.js:21:4)
<external stack> <external stack>
EmptyStack EmptyStack
...@@ -147,6 +147,6 @@ userFunction (test.js:1:36) ...@@ -147,6 +147,6 @@ userFunction (test.js:1:36)
External External
userFunction (test.js:1:36) userFunction (test.js:1:36)
(anonymous) (utils.js:21:4) runWithRegular (utils.js:21:4)
<external stack> <external stack>
...@@ -80,11 +80,11 @@ thenableJob2 (test.js:64:57) ...@@ -80,11 +80,11 @@ thenableJob2 (test.js:64:57)
Running test: testSetTimeouts Running test: testSetTimeouts
foo1 (test.js:10:2) foo1 (test.js:10:2)
(anonymous) (test.js:72:25) setTimeout (test.js:72:25)
-- setTimeout -- -- setTimeout --
(anonymous) (test.js:72:6) setTimeout (test.js:72:6)
-- setTimeout -- -- setTimeout --
(anonymous) (test.js:71:4) setTimeout (test.js:71:4)
-- setTimeout -- -- setTimeout --
setTimeouts (test.js:70:2) setTimeouts (test.js:70:2)
(anonymous) (expr.js:0:0) (anonymous) (expr.js:0:0)
......
...@@ -101,11 +101,11 @@ foo1 (test.js:156:4) ...@@ -101,11 +101,11 @@ foo1 (test.js:156:4)
complex (test.js:202:5) complex (test.js:202:5)
(anonymous) (testComplex.js:0:0) (anonymous) (testComplex.js:0:0)
(anonymous) (test.js:207:8) p.then (test.js:207:8)
-- Promise.then -- -- Promise.then --
(anonymous) (test.js:206:8) p.then (test.js:206:8)
-- Promise.then -- -- Promise.then --
(anonymous) (test.js:205:6) setTimeout (test.js:205:6)
-- setTimeout -- -- setTimeout --
complex (test.js:204:2) complex (test.js:204:2)
(anonymous) (testComplex.js:0:0) (anonymous) (testComplex.js:0:0)
......
Tests super long async stacks. Tests super long async stacks.
(anonymous) (expr.js:0:26) callWithAsyncStack (expr.js:0:26)
callWithAsyncStack (utils.js:3:4) callWithAsyncStack (utils.js:3:4)
call1 (wrapper.js:0:20) call1 (wrapper.js:0:20)
--Promise.then-- --Promise.then--
......
...@@ -213,12 +213,12 @@ f1 (test.js:4:36) ...@@ -213,12 +213,12 @@ f1 (test.js:4:36)
return await Promise.resolve(2);# return await Promise.resolve(2);#
} }
(anonymous) (test.js:10:27) f1.then.x (test.js:10:27)
await f1(); await f1();
await f1().then(x => x #* 2); await f1().then(x => x #* 2);
await [1].map(x => Promise.resolve(x))[0]; await [1].map(x => Promise.resolve(x))[0];
(anonymous) (test.js:10:30) f1.then.x (test.js:10:30)
await f1(); await f1();
await f1().then(x => x * 2#); await f1().then(x => x * 2#);
await [1].map(x => Promise.resolve(x))[0]; await [1].map(x => Promise.resolve(x))[0];
...@@ -228,13 +228,13 @@ f2 (test.js:11:4) ...@@ -228,13 +228,13 @@ f2 (test.js:11:4)
#await [1].map(x => Promise.resolve(x))[0]; #await [1].map(x => Promise.resolve(x))[0];
await Promise.resolve().then(x => x * 2); await Promise.resolve().then(x => x * 2);
(anonymous) (test.js:11:31) map.x (test.js:11:31)
f2 (test.js:11:14) f2 (test.js:11:14)
await f1().then(x => x * 2); await f1().then(x => x * 2);
await [1].map(x => Promise.#resolve(x))[0]; await [1].map(x => Promise.#resolve(x))[0];
await Promise.resolve().then(x => x * 2); await Promise.resolve().then(x => x * 2);
(anonymous) (test.js:11:41) map.x (test.js:11:41)
f2 (test.js:11:14) f2 (test.js:11:14)
await f1().then(x => x * 2); await f1().then(x => x * 2);
await [1].map(x => Promise.resolve(x)#)[0]; await [1].map(x => Promise.resolve(x)#)[0];
......
...@@ -153,32 +153,32 @@ asyncF (test.js:17:13) ...@@ -153,32 +153,32 @@ asyncF (test.js:17:13)
return r;# return r;#
})(); })();
(anonymous) (test.js:4:64) Promise.resolve.then.then.x (test.js:4:64)
var arr1 = [1]; var arr1 = [1];
var promise = Promise.resolve(1).then(x => x * 2).then(x => x #/ 2); var promise = Promise.resolve(1).then(x => x * 2).then(x => x #/ 2);
Promise.resolve(1).then(x => x * 2).then(x => x / 2); Promise.resolve(1).then(x => x * 2).then(x => x / 2);
(anonymous) (test.js:4:67) Promise.resolve.then.then.x (test.js:4:67)
var arr1 = [1]; var arr1 = [1];
var promise = Promise.resolve(1).then(x => x * 2).then(x => x / 2#); var promise = Promise.resolve(1).then(x => x * 2).then(x => x / 2#);
Promise.resolve(1).then(x => x * 2).then(x => x / 2); Promise.resolve(1).then(x => x * 2).then(x => x / 2);
(anonymous) (test.js:5:50) Promise.resolve.then.then.x (test.js:5:50)
var promise = Promise.resolve(1).then(x => x * 2).then(x => x / 2); var promise = Promise.resolve(1).then(x => x * 2).then(x => x / 2);
Promise.resolve(1).then(x => x * 2).then(x => x #/ 2); Promise.resolve(1).then(x => x * 2).then(x => x #/ 2);
promise = Promise.resolve(1).then(x => x * 2).then(x => x / 2); promise = Promise.resolve(1).then(x => x * 2).then(x => x / 2);
(anonymous) (test.js:5:53) Promise.resolve.then.then.x (test.js:5:53)
var promise = Promise.resolve(1).then(x => x * 2).then(x => x / 2); var promise = Promise.resolve(1).then(x => x * 2).then(x => x / 2);
Promise.resolve(1).then(x => x * 2).then(x => x / 2#); Promise.resolve(1).then(x => x * 2).then(x => x / 2#);
promise = Promise.resolve(1).then(x => x * 2).then(x => x / 2); promise = Promise.resolve(1).then(x => x * 2).then(x => x / 2);
(anonymous) (test.js:6:60) Promise.resolve.then.then.x (test.js:6:60)
Promise.resolve(1).then(x => x * 2).then(x => x / 2); Promise.resolve(1).then(x => x * 2).then(x => x / 2);
promise = Promise.resolve(1).then(x => x * 2).then(x => x #/ 2); promise = Promise.resolve(1).then(x => x * 2).then(x => x #/ 2);
var a = 1; var a = 1;
(anonymous) (test.js:6:63) Promise.resolve.then.then.x (test.js:6:63)
Promise.resolve(1).then(x => x * 2).then(x => x / 2); Promise.resolve(1).then(x => x * 2).then(x => x / 2);
promise = Promise.resolve(1).then(x => x * 2).then(x => x / 2#); promise = Promise.resolve(1).then(x => x * 2).then(x => x / 2#);
var a = 1; var a = 1;
......
...@@ -81,10 +81,10 @@ function foo2() { Promise.resolve().then(() => 42) } ...@@ -81,10 +81,10 @@ function foo2() { Promise.resolve().then(() => 42) }
paused in foo1 paused in foo1
function foo1() { Promise.resolve().then(() => 42) ^} function foo1() { Promise.resolve().then(() => 42) ^}
function foo2() { Promise.resolve().then(() => 42) } function foo2() { Promise.resolve().then(() => 42) }
paused in paused in Promise.resolve.then
function foo1() { Promise.resolve().then(() => ^42) } function foo1() { Promise.resolve().then(() => ^42) }
function foo2() { Promise.resolve().then(() => 42) } function foo2() { Promise.resolve().then(() => 42) }
paused in paused in Promise.resolve.then
function foo1() { Promise.resolve().then(() => 42^) } function foo1() { Promise.resolve().then(() => 42^) }
function foo2() { Promise.resolve().then(() => 42) } function foo2() { Promise.resolve().then(() => 42) }
...@@ -148,22 +148,22 @@ debugger; function foo3() { Promise.resolve().then(() => 42) } ...@@ -148,22 +148,22 @@ debugger; function foo3() { Promise.resolve().then(() => 42) }
function foo4() { Promise.resolve().then(() => 42) }; function foo4() { Promise.resolve().then(() => 42) };
foo3(); foo3();
foo4();^ foo4();^
paused in paused in Promise.resolve.then
debugger; function foo3() { Promise.resolve().then(() => ^42) } debugger; function foo3() { Promise.resolve().then(() => ^42) }
function foo4() { Promise.resolve().then(() => 42) }; function foo4() { Promise.resolve().then(() => 42) };
foo3(); foo3();
foo4(); foo4();
paused in paused in Promise.resolve.then
debugger; function foo3() { Promise.resolve().then(() => 42^) } debugger; function foo3() { Promise.resolve().then(() => 42^) }
function foo4() { Promise.resolve().then(() => 42) }; function foo4() { Promise.resolve().then(() => 42) };
foo3(); foo3();
foo4(); foo4();
paused in paused in Promise.resolve.then
debugger; function foo3() { Promise.resolve().then(() => 42) } debugger; function foo3() { Promise.resolve().then(() => 42) }
function foo4() { Promise.resolve().then(() => ^42) }; function foo4() { Promise.resolve().then(() => ^42) };
foo3(); foo3();
foo4(); foo4();
paused in paused in Promise.resolve.then
debugger; function foo3() { Promise.resolve().then(() => 42) } debugger; function foo3() { Promise.resolve().then(() => 42) }
function foo4() { Promise.resolve().then(() => 42^) }; function foo4() { Promise.resolve().then(() => 42^) };
foo3(); foo3();
...@@ -247,19 +247,19 @@ paused in foo6 ...@@ -247,19 +247,19 @@ paused in foo6
function foo5() { Promise.resolve().then(() => 42) } function foo5() { Promise.resolve().then(() => 42) }
function foo6() { Promise.resolve().then(() => 42) ^} function foo6() { Promise.resolve().then(() => 42) ^}
paused in paused in Promise.resolve.then
function foo5() { Promise.resolve().then(() => ^42) } function foo5() { Promise.resolve().then(() => ^42) }
function foo6() { Promise.resolve().then(() => 42) } function foo6() { Promise.resolve().then(() => 42) }
paused in paused in Promise.resolve.then
function foo5() { Promise.resolve().then(() => 42^) } function foo5() { Promise.resolve().then(() => 42^) }
function foo6() { Promise.resolve().then(() => 42) } function foo6() { Promise.resolve().then(() => 42) }
paused in paused in Promise.resolve.then
function foo5() { Promise.resolve().then(() => 42) } function foo5() { Promise.resolve().then(() => 42) }
function foo6() { Promise.resolve().then(() => ^42) } function foo6() { Promise.resolve().then(() => ^42) }
paused in paused in Promise.resolve.then
function foo5() { Promise.resolve().then(() => 42) } function foo5() { Promise.resolve().then(() => 42) }
function foo6() { Promise.resolve().then(() => 42^) } function foo6() { Promise.resolve().then(() => 42^) }
......
...@@ -46,7 +46,7 @@ Running test: testConsoleTraceWithEmptySync ...@@ -46,7 +46,7 @@ Running test: testConsoleTraceWithEmptySync
callFrames : [ callFrames : [
[0] : { [0] : {
columnNumber : 66 columnNumber : 66
functionName : functionName : Promise.then
lineNumber : 0 lineNumber : 0
scriptId : <scriptId> scriptId : <scriptId>
url : url :
......
...@@ -23,7 +23,7 @@ Run expression 'console.trace()' with async chain len: 3 ...@@ -23,7 +23,7 @@ Run expression 'console.trace()' with async chain len: 3
} }
[1] : { [1] : {
columnNumber : 33 columnNumber : 33
functionName : functionName : Promise.resolve.then
lineNumber : 5 lineNumber : 5
scriptId : <scriptId> scriptId : <scriptId>
url : url :
...@@ -40,7 +40,7 @@ Run expression 'console.trace()' with async chain len: 3 ...@@ -40,7 +40,7 @@ Run expression 'console.trace()' with async chain len: 3
} }
[1] : { [1] : {
columnNumber : 33 columnNumber : 33
functionName : functionName : Promise.resolve.then
lineNumber : 5 lineNumber : 5
scriptId : <scriptId> scriptId : <scriptId>
url : url :
...@@ -58,7 +58,7 @@ Run expression 'console.trace()' with async chain len: 3 ...@@ -58,7 +58,7 @@ Run expression 'console.trace()' with async chain len: 3
} }
[1] : { [1] : {
columnNumber : 33 columnNumber : 33
functionName : functionName : Promise.resolve.then
lineNumber : 5 lineNumber : 5
scriptId : <scriptId> scriptId : <scriptId>
url : url :
...@@ -114,7 +114,7 @@ Run expression 'console.trace()' with async chain len: 3 ...@@ -114,7 +114,7 @@ Run expression 'console.trace()' with async chain len: 3
} }
[1] : { [1] : {
columnNumber : 33 columnNumber : 33
functionName : functionName : Promise.resolve.then
lineNumber : 5 lineNumber : 5
scriptId : <scriptId> scriptId : <scriptId>
url : url :
...@@ -131,7 +131,7 @@ Run expression 'console.trace()' with async chain len: 3 ...@@ -131,7 +131,7 @@ Run expression 'console.trace()' with async chain len: 3
} }
[1] : { [1] : {
columnNumber : 33 columnNumber : 33
functionName : functionName : Promise.resolve.then
lineNumber : 5 lineNumber : 5
scriptId : <scriptId> scriptId : <scriptId>
url : url :
...@@ -149,7 +149,7 @@ Run expression 'console.trace()' with async chain len: 3 ...@@ -149,7 +149,7 @@ Run expression 'console.trace()' with async chain len: 3
} }
[1] : { [1] : {
columnNumber : 33 columnNumber : 33
functionName : functionName : Promise.resolve.then
lineNumber : 5 lineNumber : 5
scriptId : <scriptId> scriptId : <scriptId>
url : url :
...@@ -205,7 +205,7 @@ Run expression 'console.trace()' with async chain len: 3 ...@@ -205,7 +205,7 @@ Run expression 'console.trace()' with async chain len: 3
} }
[1] : { [1] : {
columnNumber : 33 columnNumber : 33
functionName : functionName : Promise.resolve.then
lineNumber : 5 lineNumber : 5
scriptId : <scriptId> scriptId : <scriptId>
url : url :
...@@ -222,7 +222,7 @@ Run expression 'console.trace()' with async chain len: 3 ...@@ -222,7 +222,7 @@ Run expression 'console.trace()' with async chain len: 3
} }
[1] : { [1] : {
columnNumber : 33 columnNumber : 33
functionName : functionName : Promise.resolve.then
lineNumber : 5 lineNumber : 5
scriptId : <scriptId> scriptId : <scriptId>
url : url :
...@@ -240,7 +240,7 @@ Run expression 'console.trace()' with async chain len: 3 ...@@ -240,7 +240,7 @@ Run expression 'console.trace()' with async chain len: 3
} }
[1] : { [1] : {
columnNumber : 33 columnNumber : 33
functionName : functionName : Promise.resolve.then
lineNumber : 5 lineNumber : 5
scriptId : <scriptId> scriptId : <scriptId>
url : url :
...@@ -296,7 +296,7 @@ Run expression 'console.trace()' with async chain len: 3 ...@@ -296,7 +296,7 @@ Run expression 'console.trace()' with async chain len: 3
} }
[1] : { [1] : {
columnNumber : 33 columnNumber : 33
functionName : functionName : Promise.resolve.then
lineNumber : 5 lineNumber : 5
scriptId : <scriptId> scriptId : <scriptId>
url : url :
...@@ -313,7 +313,7 @@ Run expression 'console.trace()' with async chain len: 3 ...@@ -313,7 +313,7 @@ Run expression 'console.trace()' with async chain len: 3
} }
[1] : { [1] : {
columnNumber : 33 columnNumber : 33
functionName : functionName : Promise.resolve.then
lineNumber : 5 lineNumber : 5
scriptId : <scriptId> scriptId : <scriptId>
url : url :
...@@ -331,7 +331,7 @@ Run expression 'console.trace()' with async chain len: 3 ...@@ -331,7 +331,7 @@ Run expression 'console.trace()' with async chain len: 3
} }
[1] : { [1] : {
columnNumber : 33 columnNumber : 33
functionName : functionName : Promise.resolve.then
lineNumber : 5 lineNumber : 5
scriptId : <scriptId> scriptId : <scriptId>
url : url :
...@@ -387,7 +387,7 @@ Run expression 'console.trace()' with async chain len: 3 ...@@ -387,7 +387,7 @@ Run expression 'console.trace()' with async chain len: 3
} }
[1] : { [1] : {
columnNumber : 33 columnNumber : 33
functionName : functionName : Promise.resolve.then
lineNumber : 5 lineNumber : 5
scriptId : <scriptId> scriptId : <scriptId>
url : url :
...@@ -404,7 +404,7 @@ Run expression 'console.trace()' with async chain len: 3 ...@@ -404,7 +404,7 @@ Run expression 'console.trace()' with async chain len: 3
} }
[1] : { [1] : {
columnNumber : 33 columnNumber : 33
functionName : functionName : Promise.resolve.then
lineNumber : 5 lineNumber : 5
scriptId : <scriptId> scriptId : <scriptId>
url : url :
...@@ -422,7 +422,7 @@ Run expression 'console.trace()' with async chain len: 3 ...@@ -422,7 +422,7 @@ Run expression 'console.trace()' with async chain len: 3
} }
[1] : { [1] : {
columnNumber : 33 columnNumber : 33
functionName : functionName : Promise.resolve.then
lineNumber : 5 lineNumber : 5
scriptId : <scriptId> scriptId : <scriptId>
url : url :
...@@ -478,7 +478,7 @@ Run expression 'console.trace()' with async chain len: 3 ...@@ -478,7 +478,7 @@ Run expression 'console.trace()' with async chain len: 3
} }
[1] : { [1] : {
columnNumber : 33 columnNumber : 33
functionName : functionName : Promise.resolve.then
lineNumber : 5 lineNumber : 5
scriptId : <scriptId> scriptId : <scriptId>
url : url :
...@@ -495,7 +495,7 @@ Run expression 'console.trace()' with async chain len: 3 ...@@ -495,7 +495,7 @@ Run expression 'console.trace()' with async chain len: 3
} }
[1] : { [1] : {
columnNumber : 33 columnNumber : 33
functionName : functionName : Promise.resolve.then
lineNumber : 5 lineNumber : 5
scriptId : <scriptId> scriptId : <scriptId>
url : url :
...@@ -513,7 +513,7 @@ Run expression 'console.trace()' with async chain len: 3 ...@@ -513,7 +513,7 @@ Run expression 'console.trace()' with async chain len: 3
} }
[1] : { [1] : {
columnNumber : 33 columnNumber : 33
functionName : functionName : Promise.resolve.then
lineNumber : 5 lineNumber : 5
scriptId : <scriptId> scriptId : <scriptId>
url : url :
......
...@@ -16,7 +16,7 @@ Debugger.scriptParsed.stackTrace should contain only one frame ...@@ -16,7 +16,7 @@ Debugger.scriptParsed.stackTrace should contain only one frame
callFrames : [ callFrames : [
[0] : { [0] : {
columnNumber : 17 columnNumber : 17
functionName : functionName : setTimeout
lineNumber : 0 lineNumber : 0
scriptId : <scriptId> scriptId : <scriptId>
url : url :
......
...@@ -3,11 +3,11 @@ Test for Debugger.stepInto with breakOnAsyncCall. ...@@ -3,11 +3,11 @@ Test for Debugger.stepInto with breakOnAsyncCall.
Running test: testSetTimeout Running test: testSetTimeout
(anonymous) (test.js:0:0) (anonymous) (test.js:0:0)
asyncCallStackTraceId is set asyncCallStackTraceId is set
(anonymous) (test.js:0:17) setTimeout (test.js:0:17)
asyncCallStackTraceId is empty asyncCallStackTraceId is empty
Running test: testPromiseThen Running test: testPromiseThen
(anonymous) (test.js:0:2) (anonymous) (test.js:0:2)
asyncCallStackTraceId is set asyncCallStackTraceId is set
(anonymous) (test.js:0:13) p.then (test.js:0:13)
asyncCallStackTraceId is empty asyncCallStackTraceId is empty
...@@ -14,7 +14,7 @@ Tests that microtasks run before the Runtime.evaluate response is sent ...@@ -14,7 +14,7 @@ Tests that microtasks run before the Runtime.evaluate response is sent
callFrames : [ callFrames : [
[0] : { [0] : {
columnNumber : 37 columnNumber : 37
functionName : functionName : Promise.resolve.then
lineNumber : 0 lineNumber : 0
scriptId : <scriptId> scriptId : <scriptId>
url : url :
......
...@@ -6,16 +6,16 @@ Check that exceptionThrown is supported by test runner. ...@@ -6,16 +6,16 @@ Check that exceptionThrown is supported by test runner.
columnNumber : 2 columnNumber : 2
exception : { exception : {
className : Error className : Error
description : Error at <anonymous>:2:9 description : Error at setTimeout (<anonymous>:2:9)
objectId : <objectId> objectId : <objectId>
preview : { preview : {
description : Error at <anonymous>:2:9 description : Error at setTimeout (<anonymous>:2:9)
overflow : false overflow : false
properties : [ properties : [
[0] : { [0] : {
name : stack name : stack
type : string type : string
value : Error at <anonymous>:2:9 value : Error at setTimeout (<anonymous>:2:9)
} }
] ]
subtype : error subtype : error
...@@ -31,7 +31,7 @@ Check that exceptionThrown is supported by test runner. ...@@ -31,7 +31,7 @@ Check that exceptionThrown is supported by test runner.
callFrames : [ callFrames : [
[0] : { [0] : {
columnNumber : 8 columnNumber : 8
functionName : functionName : setTimeout
lineNumber : 1 lineNumber : 1
scriptId : <scriptId> scriptId : <scriptId>
url : url :
...@@ -99,7 +99,7 @@ Check that exceptionThrown is supported by test runner. ...@@ -99,7 +99,7 @@ Check that exceptionThrown is supported by test runner.
callFrames : [ callFrames : [
[0] : { [0] : {
columnNumber : 2 columnNumber : 2
functionName : functionName : setTimeout
lineNumber : 1 lineNumber : 1
scriptId : <scriptId> scriptId : <scriptId>
url : url :
......
...@@ -125,7 +125,7 @@ From session 1 ...@@ -125,7 +125,7 @@ From session 1
callFrames : [ callFrames : [
[0] : { [0] : {
columnNumber : 25 columnNumber : 25
functionName : functionName : setTimeout
lineNumber : 0 lineNumber : 0
scriptId : <scriptId> scriptId : <scriptId>
url : url :
...@@ -151,7 +151,7 @@ From session 2 ...@@ -151,7 +151,7 @@ From session 2
callFrames : [ callFrames : [
[0] : { [0] : {
columnNumber : 25 columnNumber : 25
functionName : functionName : setTimeout
lineNumber : 0 lineNumber : 0
scriptId : <scriptId> scriptId : <scriptId>
url : url :
...@@ -178,7 +178,7 @@ From session 1 ...@@ -178,7 +178,7 @@ From session 1
callFrames : [ callFrames : [
[0] : { [0] : {
columnNumber : 25 columnNumber : 25
functionName : functionName : setTimeout
lineNumber : 0 lineNumber : 0
scriptId : <scriptId> scriptId : <scriptId>
url : url :
...@@ -204,7 +204,7 @@ From session 2 ...@@ -204,7 +204,7 @@ From session 2
callFrames : [ callFrames : [
[0] : { [0] : {
columnNumber : 25 columnNumber : 25
functionName : functionName : setTimeout
lineNumber : 0 lineNumber : 0
scriptId : <scriptId> scriptId : <scriptId>
url : url :
......
...@@ -19,7 +19,7 @@ From session 1 ...@@ -19,7 +19,7 @@ From session 1
callFrames : [ callFrames : [
[0] : { [0] : {
columnNumber : 19 columnNumber : 19
functionName : functionName : setTimeout
lineNumber : 0 lineNumber : 0
scriptId : <scriptId> scriptId : <scriptId>
url : url :
...@@ -48,7 +48,7 @@ From session 2 ...@@ -48,7 +48,7 @@ From session 2
callFrames : [ callFrames : [
[0] : { [0] : {
columnNumber : 19 columnNumber : 19
functionName : functionName : setTimeout
lineNumber : 0 lineNumber : 0
scriptId : <scriptId> scriptId : <scriptId>
url : url :
...@@ -78,7 +78,7 @@ From session 1 ...@@ -78,7 +78,7 @@ From session 1
callFrames : [ callFrames : [
[0] : { [0] : {
columnNumber : 19 columnNumber : 19
functionName : functionName : setTimeout
lineNumber : 0 lineNumber : 0
scriptId : <scriptId> scriptId : <scriptId>
url : url :
...@@ -107,7 +107,7 @@ From session 2 ...@@ -107,7 +107,7 @@ From session 2
callFrames : [ callFrames : [
[0] : { [0] : {
columnNumber : 19 columnNumber : 19
functionName : functionName : setTimeout
lineNumber : 0 lineNumber : 0
scriptId : <scriptId> scriptId : <scriptId>
url : url :
...@@ -137,7 +137,7 @@ From session 1 ...@@ -137,7 +137,7 @@ From session 1
callFrames : [ callFrames : [
[0] : { [0] : {
columnNumber : 40 columnNumber : 40
functionName : functionName : setTimeout
lineNumber : 0 lineNumber : 0
scriptId : <scriptId> scriptId : <scriptId>
url : url :
...@@ -166,7 +166,7 @@ From session 2 ...@@ -166,7 +166,7 @@ From session 2
callFrames : [ callFrames : [
[0] : { [0] : {
columnNumber : 40 columnNumber : 40
functionName : functionName : setTimeout
lineNumber : 0 lineNumber : 0
scriptId : <scriptId> scriptId : <scriptId>
url : url :
...@@ -215,7 +215,7 @@ From session 1 ...@@ -215,7 +215,7 @@ From session 1
callFrames : [ callFrames : [
[0] : { [0] : {
columnNumber : 40 columnNumber : 40
functionName : functionName : setTimeout
lineNumber : 0 lineNumber : 0
scriptId : <scriptId> scriptId : <scriptId>
url : url :
...@@ -244,7 +244,7 @@ From session 2 ...@@ -244,7 +244,7 @@ From session 2
callFrames : [ callFrames : [
[0] : { [0] : {
columnNumber : 40 columnNumber : 40
functionName : functionName : setTimeout
lineNumber : 0 lineNumber : 0
scriptId : <scriptId> scriptId : <scriptId>
url : url :
......
...@@ -7,4 +7,4 @@ Error ...@@ -7,4 +7,4 @@ Error
Error: Reject with callback Error: Reject with callback
at concatenateErrors (test/mjsunit/mjsunit.js:{NUMBER}:{NUMBER}) at concatenateErrors (test/mjsunit/mjsunit.js:{NUMBER}:{NUMBER})
at test/mjsunit/mjsunit.js:{NUMBER}:{NUMBER} at _ (test/mjsunit/mjsunit.js:{NUMBER}:{NUMBER})
...@@ -6,7 +6,7 @@ Error ...@@ -6,7 +6,7 @@ Error
at *%(basename)s:9:1 at *%(basename)s:9:1
Error: Error in reject handler Error: Error in reject handler
at *%(basename)s:11:17 at _ *%(basename)s:11:17)
at test/mjsunit/mjsunit.js:{NUMBER}:{NUMBER} at promise.then.result (test/mjsunit/mjsunit.js:{NUMBER}:{NUMBER})
...@@ -6,8 +6,8 @@ Error ...@@ -6,8 +6,8 @@ Error
at *%(basename)s:9:1 at *%(basename)s:9:1
Error: Error in resolve handler Error: Error in resolve handler
at *%(basename)s:10:39 at _ *%(basename)s:10:39)
at test/mjsunit/mjsunit.js:{NUMBER}:{NUMBER} at promise.then.result (test/mjsunit/mjsunit.js:{NUMBER}:{NUMBER})
RuntimeError: unreachable RuntimeError: unreachable
at main (wasm-function[0]:1) at main (wasm-function[0]:1)
at *%(basename)s:16:27 at pair (*%(basename)s:16:27)
at test/mjsunit/mjsunit.js:* at promise.then.result (test/mjsunit/mjsunit.js:*)
RuntimeError: unreachable RuntimeError: unreachable
at main (wasm-function[0]:1) at main (wasm-function[0]:1)
at test/message/wasm-function-name-async.js:16:27 at pair (test/message/wasm-function-name-async.js:16:27)
at test/mjsunit/mjsunit.js:* at promise.then.result (test/mjsunit/mjsunit.js:*)
RuntimeError: unreachable RuntimeError: unreachable
at test-module.main (wasm-function[0]:1) at test-module.main (wasm-function[0]:1)
at *%(basename)s:17:27 at pair (*%(basename)s:17:27)
at test/mjsunit/mjsunit.js:* at promise.then.result (test/mjsunit/mjsunit.js:*)
RuntimeError: unreachable RuntimeError: unreachable
at test-module.main (wasm-function[0]:1) at test-module.main (wasm-function[0]:1)
at test/message/wasm-module-and-function-name-async.js:17:27 at pair (test/message/wasm-module-and-function-name-async.js:17:27)
at test/mjsunit/mjsunit.js:* at promise.then.result (test/mjsunit/mjsunit.js:*)
RuntimeError: unreachable RuntimeError: unreachable
at test-module (wasm-function[0]:1) at test-module (wasm-function[0]:1)
at *%(basename)s:19:27 at pair (*%(basename)s:19:27)
at test/mjsunit/mjsunit.js:* at promise.then.result (test/mjsunit/mjsunit.js:*)
RuntimeError: unreachable RuntimeError: unreachable
at test-module (wasm-function[0]:1) at test-module (wasm-function[0]:1)
at test/message/wasm-module-name-async.js:19:27 at pair (test/message/wasm-module-name-async.js:19:27)
at test/mjsunit/mjsunit.js:* at promise.then.result (test/mjsunit/mjsunit.js:*)
RuntimeError: unreachable RuntimeError: unreachable
at wasm-function[0]:1 at wasm-function[0]:1
at *%(basename)s:18:27 at pair (*%(basename)s:18:27)
at test/mjsunit/mjsunit.js:* at promise.then.result (test/mjsunit/mjsunit.js:*)
RuntimeError: unreachable RuntimeError: unreachable
at wasm-function[0]:1 at wasm-function[0]:1
at test/message/wasm-no-name-async.js:18:27 at pair (test/message/wasm-no-name-async.js:18:27)
at test/mjsunit/mjsunit.js:* at promise.then.result (test/mjsunit/mjsunit.js:*)
...@@ -81,19 +81,21 @@ async function runTests() { ...@@ -81,19 +81,21 @@ async function runTests() {
try { await reject(); } catch (e) { throw new Error("FAIL"); } try { await reject(); } catch (e) { throw new Error("FAIL"); }
} }).c4, ["c4"]); } }).c4, ["c4"]);
// TODO(caitp): We should infer anonymous async functions as the empty
// string, not as the name of a function they're passed as a parameter to.
await test(async x => { throw new Error("FAIL") }, await test(async x => { throw new Error("FAIL") },
["test", "runTests"]); ["test", "test", "runTests"]);
await test(async() => { throw new Error("FAIL") }, await test(async() => { throw new Error("FAIL") },
["test", "runTests"]); ["test", "test", "runTests"]);
await test(async(a) => { throw new Error("FAIL") }, await test(async(a) => { throw new Error("FAIL") },
["test", "runTests"]); ["test", "test", "runTests"]);
await test(async(a, b) => { throw new Error("FAIL") }, await test(async(a, b) => { throw new Error("FAIL") },
["test", "runTests"]); ["test", "test", "runTests"]);
await test(async x => { await 1; throw new Error("FAIL") }, []); await test(async x => { await 1; throw new Error("FAIL") }, ["test"]);
await test(async() => { await 1; throw new Error("FAIL") }, []); await test(async() => { await 1; throw new Error("FAIL") }, ["test"]);
await test(async(a) => { await 1; throw new Error("FAIL") }, []); await test(async(a) => { await 1; throw new Error("FAIL") }, ["test"]);
await test(async(a, b) => { await 1; throw new Error("FAIL") }, []); await test(async(a, b) => { await 1; throw new Error("FAIL") }, ["test"]);
await test(async x => { await test(async x => {
await 1; await 1;
...@@ -102,7 +104,7 @@ async function runTests() { ...@@ -102,7 +104,7 @@ async function runTests() {
} catch (e) { } catch (e) {
throw new Error("FAIL"); throw new Error("FAIL");
} }
}, []); }, ["test"]);
await test(async() => { await test(async() => {
await 1; await 1;
...@@ -111,7 +113,7 @@ async function runTests() { ...@@ -111,7 +113,7 @@ async function runTests() {
} catch (e) { } catch (e) {
throw new Error("FAIL"); throw new Error("FAIL");
} }
}, []); }, ["test"]);
await test(async(a) => { await test(async(a) => {
await 1; await 1;
...@@ -120,7 +122,7 @@ async function runTests() { ...@@ -120,7 +122,7 @@ async function runTests() {
} catch (e) { } catch (e) {
throw new Error("FAIL"); throw new Error("FAIL");
} }
}, []); }, ["test"]);
await test(async(a, b) => { await test(async(a, b) => {
await 1; await 1;
...@@ -129,7 +131,7 @@ async function runTests() { ...@@ -129,7 +131,7 @@ async function runTests() {
} catch (e) { } catch (e) {
throw new Error("FAIL"); throw new Error("FAIL");
} }
}, []); }, ["test"]);
await test(async x => { await test(async x => {
await 1; await 1;
...@@ -138,7 +140,7 @@ async function runTests() { ...@@ -138,7 +140,7 @@ async function runTests() {
} catch (e) { } catch (e) {
throw new Error("FAIL"); throw new Error("FAIL");
} }
}, []); }, ["test"]);
await test(async() => { await test(async() => {
await 1; await 1;
...@@ -147,7 +149,7 @@ async function runTests() { ...@@ -147,7 +149,7 @@ async function runTests() {
} catch (e) { } catch (e) {
throw new Error("FAIL"); throw new Error("FAIL");
} }
}, []); }, ["test"]);
await test(async(a) => { await test(async(a) => {
await 1; await 1;
...@@ -156,7 +158,7 @@ async function runTests() { ...@@ -156,7 +158,7 @@ async function runTests() {
} catch (e) { } catch (e) {
throw new Error("FAIL"); throw new Error("FAIL");
} }
}, []); }, ["test"]);
await test(async(a, b) => { await test(async(a, b) => {
await 1; await 1;
...@@ -165,7 +167,7 @@ async function runTests() { ...@@ -165,7 +167,7 @@ async function runTests() {
} catch (e) { } catch (e) {
throw new Error("FAIL"); throw new Error("FAIL");
} }
}, []); }, ["test"]);
} }
runTests().catch(e => { runTests().catch(e => {
......
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