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