Commit 3411e7c3 authored by Toon Verwaest's avatar Toon Verwaest Committed by Commit Bot

[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/1386147Reviewed-by: 's avatarIgor Sheludko <ishell@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58405}
parent 66451a6e
......@@ -888,11 +888,15 @@ 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_.GetPayload()) {
if (outer_scope_and_calls_eval_->scope_calls_eval_) {
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,24 +147,6 @@ 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,8 +271,6 @@ 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; }
......@@ -1386,7 +1384,6 @@ 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
......@@ -1395,19 +1392,15 @@ class ParserBase {
Scanner::Location strict_parameter_error_location =
Scanner::Location::invalid();
MessageTemplate strict_parameter_error_message = MessageTemplate::kNone;
FunctionKind kind = FunctionKind::kArrowFunction;
bool has_simple_parameter_list = true;
DeclarationScope* scope = nullptr;
bool HasInitialState() const {
return rewritable_length == -1 && scope_snapshot.IsCleared() &&
kind == FunctionKind::kArrowFunction && has_simple_parameter_list;
return rewritable_length == -1 && scope == nullptr;
}
void Reset() {
rewritable_length = -1;
scope_snapshot.Clear();
kind = FunctionKind::kArrowFunction;
has_simple_parameter_list = true;
scope = nullptr;
ClearStrictParameterError();
DCHECK(HasInitialState());
}
......@@ -1663,8 +1656,7 @@ ParserBase<Impl>::ParsePrimaryExpression() {
if (Token::IsAnyIdentifier(token)) {
Consume(token);
IdentifierT name;
InferName infer = InferName::kYes;
FunctionKind kind = FunctionKind::kArrowFunction;
if (V8_UNLIKELY(token == Token::ASYNC &&
!scanner()->HasLineTerminatorBeforeNext())) {
......@@ -1675,28 +1667,28 @@ ParserBase<Impl>::ParsePrimaryExpression() {
if (peek_any_identifier() && PeekAhead() == Token::ARROW) {
token = Next();
beg_pos = position();
next_arrow_function_info_.kind = FunctionKind::kAsyncArrowFunction;
infer = InferName::kNo;
kind = FunctionKind::kAsyncArrowFunction;
}
}
if (V8_UNLIKELY(peek() == Token::ARROW)) {
next_arrow_function_info_.scope = NewFunctionScope(kind);
ArrowHeadParsingScope parsing_scope(
impl(), next_arrow_function_info_.kind == FunctionKind::kArrowFunction
impl(), 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());
name = ParseAndClassifyIdentifier(token);
IdentifierT name = ParseAndClassifyIdentifier(token);
ClassifyParameter(name, beg_pos, end_position());
parsing_scope.ValidateDeclaration();
} else {
name = ParseAndClassifyIdentifier(token);
FunctionState function_state(&function_state_, &scope_,
next_arrow_function_info_.scope);
return impl()->ExpressionFromIdentifier(name, beg_pos, InferName::kNo);
}
return impl()->ExpressionFromIdentifier(name, beg_pos, infer);
IdentifierT name = ParseAndClassifyIdentifier(token);
return impl()->ExpressionFromIdentifier(name, beg_pos);
}
if (Token::IsLiteral(token)) {
......@@ -1721,17 +1713,18 @@ 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_snapshot = std::move(scope_snapshot);
next_arrow_function_info_.scope =
NewFunctionScope(FunctionKind::kArrowFunction);
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
......@@ -1746,9 +1739,12 @@ ParserBase<Impl>::ParsePrimaryExpression() {
Expect(Token::RPAREN);
if (peek() == Token::ARROW) {
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_.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_.rewritable_length = rewritable_length;
maybe_arrow.ValidateDeclaration();
} else {
......@@ -2619,7 +2615,6 @@ 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(
......@@ -2628,26 +2623,19 @@ ParserBase<Impl>::ParseAssignmentExpressionCoverGrammar() {
return impl()->FailureExpression();
}
// 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);
DeclarationScope* scope = next_arrow_function_info_.scope;
scope->set_start_position(lhs_beg_pos);
FormalParametersT parameters(scope);
parameters.set_strict_parameter_error(
next_arrow_function_info_.strict_parameter_error_location,
next_arrow_function_info_.strict_parameter_error_message);
if (!next_arrow_function_info_.has_simple_parameter_list) {
scope->SetHasNonSimpleParameters();
parameters.is_simple = false;
}
parameters.is_simple = scope->has_simple_parameters();
scope->set_start_position(lhs_beg_pos);
impl()->DeclareArrowFunctionFormalParameters(&parameters, expression, loc);
expression = ParseArrowFunctionLiteral(parameters);
fni_.Infer();
return expression;
}
......@@ -2924,12 +2912,13 @@ ParserBase<Impl>::ParseUnaryOrPrefixExpression() {
DCHECK(Token::IsCountOp(op));
if (V8_UNLIKELY(!IsValidReferenceExpression(expression))) {
if (V8_LIKELY(IsValidReferenceExpression(expression))) {
if (peek() != Token::ARROW) impl()->MarkExpressionAsAssigned(expression);
} else {
expression = RewriteInvalidReferenceExpression(
expression, expression_position, end_position(),
MessageTemplate::kInvalidLhsInPrefixOp);
}
impl()->MarkExpressionAsAssigned(expression);
return factory()->NewCountOperation(op, true /* prefix */, expression,
position());
......@@ -3038,15 +3027,17 @@ ParserBase<Impl>::ParseLeftHandSideContinuation(ExpressionT result) {
if (V8_LIKELY(peek() == Token::ARROW)) {
maybe_arrow.ValidateDeclaration();
fni_.RemoveAsyncKeywordFromEnd();
next_arrow_function_info_.kind = FunctionKind::kAsyncArrowFunction;
next_arrow_function_info_.scope_snapshot = std::move(scope_snapshot);
next_arrow_function_info_.scope =
NewFunctionScope(FunctionKind::kAsyncArrowFunction);
scope_snapshot.Reparent(next_arrow_function_info_.scope);
next_arrow_function_info_.rewritable_length = rewritable_length;
// async () => ...
if (!args.length()) return factory()->NewEmptyParentheses(pos);
// async ( Arguments ) => ...
ExpressionT result = impl()->ExpressionListToExpression(args);
next_arrow_function_info_.has_simple_parameter_list =
maybe_arrow.has_simple_parameter_list();
if (!maybe_arrow.has_simple_parameter_list()) {
next_arrow_function_info_.scope->SetHasNonSimpleParameters();
}
result->mark_parenthesized();
return result;
}
......@@ -4081,10 +4072,13 @@ 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();
Scanner::Location loc(scope()->start_position(), end_position());
FormalParametersT parameters(formal_parameters.scope);
parameters.is_simple =
next_arrow_function_info_.has_simple_parameter_list;
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();
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)
runWithRegular (utils.js:21:4)
(anonymous) (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)
runWithRegular (utils.js:21:4)
(anonymous) (utils.js:21:4)
<external stack>
EmptyStack
......@@ -147,6 +147,6 @@ userFunction (test.js:1:36)
External
userFunction (test.js:1:36)
runWithRegular (utils.js:21:4)
(anonymous) (utils.js:21:4)
<external stack>
......@@ -80,11 +80,11 @@ thenableJob2 (test.js:64:57)
Running test: testSetTimeouts
foo1 (test.js:10:2)
setTimeout (test.js:72:25)
(anonymous) (test.js:72:25)
-- setTimeout --
setTimeout (test.js:72:6)
(anonymous) (test.js:72:6)
-- setTimeout --
setTimeout (test.js:71:4)
(anonymous) (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)
p.then (test.js:207:8)
(anonymous) (test.js:207:8)
-- Promise.then --
p.then (test.js:206:8)
(anonymous) (test.js:206:8)
-- Promise.then --
setTimeout (test.js:205:6)
(anonymous) (test.js:205:6)
-- setTimeout --
complex (test.js:204:2)
(anonymous) (testComplex.js:0:0)
......
Tests super long async stacks.
callWithAsyncStack (expr.js:0:26)
(anonymous) (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);#
}
f1.then.x (test.js:10:27)
(anonymous) (test.js:10:27)
await f1();
await f1().then(x => x #* 2);
await [1].map(x => Promise.resolve(x))[0];
f1.then.x (test.js:10:30)
(anonymous) (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);
map.x (test.js:11:31)
(anonymous) (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);
map.x (test.js:11:41)
(anonymous) (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;#
})();
Promise.resolve.then.then.x (test.js:4:64)
(anonymous) (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);
Promise.resolve.then.then.x (test.js:4:67)
(anonymous) (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);
Promise.resolve.then.then.x (test.js:5:50)
(anonymous) (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);
Promise.resolve.then.then.x (test.js:5:53)
(anonymous) (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);
Promise.resolve.then.then.x (test.js:6:60)
(anonymous) (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;
Promise.resolve.then.then.x (test.js:6:63)
(anonymous) (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 Promise.resolve.then
paused in
function foo1() { Promise.resolve().then(() => ^42) }
function foo2() { Promise.resolve().then(() => 42) }
paused in Promise.resolve.then
paused in
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 Promise.resolve.then
paused in
debugger; function foo3() { Promise.resolve().then(() => ^42) }
function foo4() { Promise.resolve().then(() => 42) };
foo3();
foo4();
paused in Promise.resolve.then
paused in
debugger; function foo3() { Promise.resolve().then(() => 42^) }
function foo4() { Promise.resolve().then(() => 42) };
foo3();
foo4();
paused in Promise.resolve.then
paused in
debugger; function foo3() { Promise.resolve().then(() => 42) }
function foo4() { Promise.resolve().then(() => ^42) };
foo3();
foo4();
paused in Promise.resolve.then
paused in
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 Promise.resolve.then
paused in
function foo5() { Promise.resolve().then(() => ^42) }
function foo6() { Promise.resolve().then(() => 42) }
paused in Promise.resolve.then
paused in
function foo5() { Promise.resolve().then(() => 42^) }
function foo6() { Promise.resolve().then(() => 42) }
paused in Promise.resolve.then
paused in
function foo5() { Promise.resolve().then(() => 42) }
function foo6() { Promise.resolve().then(() => ^42) }
paused in Promise.resolve.then
paused in
function foo5() { Promise.resolve().then(() => 42) }
function foo6() { Promise.resolve().then(() => 42^) }
......
......@@ -46,7 +46,7 @@ Running test: testConsoleTraceWithEmptySync
callFrames : [
[0] : {
columnNumber : 66
functionName : Promise.then
functionName :
lineNumber : 0
scriptId : <scriptId>
url :
......
......@@ -23,7 +23,7 @@ Run expression 'console.trace()' with async chain len: 3
}
[1] : {
columnNumber : 33
functionName : Promise.resolve.then
functionName :
lineNumber : 5
scriptId : <scriptId>
url :
......@@ -40,7 +40,7 @@ Run expression 'console.trace()' with async chain len: 3
}
[1] : {
columnNumber : 33
functionName : Promise.resolve.then
functionName :
lineNumber : 5
scriptId : <scriptId>
url :
......@@ -58,7 +58,7 @@ Run expression 'console.trace()' with async chain len: 3
}
[1] : {
columnNumber : 33
functionName : Promise.resolve.then
functionName :
lineNumber : 5
scriptId : <scriptId>
url :
......@@ -114,7 +114,7 @@ Run expression 'console.trace()' with async chain len: 3
}
[1] : {
columnNumber : 33
functionName : Promise.resolve.then
functionName :
lineNumber : 5
scriptId : <scriptId>
url :
......@@ -131,7 +131,7 @@ Run expression 'console.trace()' with async chain len: 3
}
[1] : {
columnNumber : 33
functionName : Promise.resolve.then
functionName :
lineNumber : 5
scriptId : <scriptId>
url :
......@@ -149,7 +149,7 @@ Run expression 'console.trace()' with async chain len: 3
}
[1] : {
columnNumber : 33
functionName : Promise.resolve.then
functionName :
lineNumber : 5
scriptId : <scriptId>
url :
......@@ -205,7 +205,7 @@ Run expression 'console.trace()' with async chain len: 3
}
[1] : {
columnNumber : 33
functionName : Promise.resolve.then
functionName :
lineNumber : 5
scriptId : <scriptId>
url :
......@@ -222,7 +222,7 @@ Run expression 'console.trace()' with async chain len: 3
}
[1] : {
columnNumber : 33
functionName : Promise.resolve.then
functionName :
lineNumber : 5
scriptId : <scriptId>
url :
......@@ -240,7 +240,7 @@ Run expression 'console.trace()' with async chain len: 3
}
[1] : {
columnNumber : 33
functionName : Promise.resolve.then
functionName :
lineNumber : 5
scriptId : <scriptId>
url :
......@@ -296,7 +296,7 @@ Run expression 'console.trace()' with async chain len: 3
}
[1] : {
columnNumber : 33
functionName : Promise.resolve.then
functionName :
lineNumber : 5
scriptId : <scriptId>
url :
......@@ -313,7 +313,7 @@ Run expression 'console.trace()' with async chain len: 3
}
[1] : {
columnNumber : 33
functionName : Promise.resolve.then
functionName :
lineNumber : 5
scriptId : <scriptId>
url :
......@@ -331,7 +331,7 @@ Run expression 'console.trace()' with async chain len: 3
}
[1] : {
columnNumber : 33
functionName : Promise.resolve.then
functionName :
lineNumber : 5
scriptId : <scriptId>
url :
......@@ -387,7 +387,7 @@ Run expression 'console.trace()' with async chain len: 3
}
[1] : {
columnNumber : 33
functionName : Promise.resolve.then
functionName :
lineNumber : 5
scriptId : <scriptId>
url :
......@@ -404,7 +404,7 @@ Run expression 'console.trace()' with async chain len: 3
}
[1] : {
columnNumber : 33
functionName : Promise.resolve.then
functionName :
lineNumber : 5
scriptId : <scriptId>
url :
......@@ -422,7 +422,7 @@ Run expression 'console.trace()' with async chain len: 3
}
[1] : {
columnNumber : 33
functionName : Promise.resolve.then
functionName :
lineNumber : 5
scriptId : <scriptId>
url :
......@@ -478,7 +478,7 @@ Run expression 'console.trace()' with async chain len: 3
}
[1] : {
columnNumber : 33
functionName : Promise.resolve.then
functionName :
lineNumber : 5
scriptId : <scriptId>
url :
......@@ -495,7 +495,7 @@ Run expression 'console.trace()' with async chain len: 3
}
[1] : {
columnNumber : 33
functionName : Promise.resolve.then
functionName :
lineNumber : 5
scriptId : <scriptId>
url :
......@@ -513,7 +513,7 @@ Run expression 'console.trace()' with async chain len: 3
}
[1] : {
columnNumber : 33
functionName : Promise.resolve.then
functionName :
lineNumber : 5
scriptId : <scriptId>
url :
......
......@@ -16,7 +16,7 @@ Debugger.scriptParsed.stackTrace should contain only one frame
callFrames : [
[0] : {
columnNumber : 17
functionName : setTimeout
functionName :
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
setTimeout (test.js:0:17)
(anonymous) (test.js:0:17)
asyncCallStackTraceId is empty
Running test: testPromiseThen
(anonymous) (test.js:0:2)
asyncCallStackTraceId is set
p.then (test.js:0:13)
(anonymous) (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 : Promise.resolve.then
functionName :
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 setTimeout (<anonymous>:2:9)
description : Error at <anonymous>:2:9
objectId : <objectId>
preview : {
description : Error at setTimeout (<anonymous>:2:9)
description : Error at <anonymous>:2:9
overflow : false
properties : [
[0] : {
name : stack
type : string
value : Error at setTimeout (<anonymous>:2:9)
value : Error at <anonymous>:2:9
}
]
subtype : error
......@@ -31,7 +31,7 @@ Check that exceptionThrown is supported by test runner.
callFrames : [
[0] : {
columnNumber : 8
functionName : setTimeout
functionName :
lineNumber : 1
scriptId : <scriptId>
url :
......@@ -99,7 +99,7 @@ Check that exceptionThrown is supported by test runner.
callFrames : [
[0] : {
columnNumber : 2
functionName : setTimeout
functionName :
lineNumber : 1
scriptId : <scriptId>
url :
......
......@@ -125,7 +125,7 @@ From session 1
callFrames : [
[0] : {
columnNumber : 25
functionName : setTimeout
functionName :
lineNumber : 0
scriptId : <scriptId>
url :
......@@ -151,7 +151,7 @@ From session 2
callFrames : [
[0] : {
columnNumber : 25
functionName : setTimeout
functionName :
lineNumber : 0
scriptId : <scriptId>
url :
......@@ -178,7 +178,7 @@ From session 1
callFrames : [
[0] : {
columnNumber : 25
functionName : setTimeout
functionName :
lineNumber : 0
scriptId : <scriptId>
url :
......@@ -204,7 +204,7 @@ From session 2
callFrames : [
[0] : {
columnNumber : 25
functionName : setTimeout
functionName :
lineNumber : 0
scriptId : <scriptId>
url :
......
......@@ -19,7 +19,7 @@ From session 1
callFrames : [
[0] : {
columnNumber : 19
functionName : setTimeout
functionName :
lineNumber : 0
scriptId : <scriptId>
url :
......@@ -48,7 +48,7 @@ From session 2
callFrames : [
[0] : {
columnNumber : 19
functionName : setTimeout
functionName :
lineNumber : 0
scriptId : <scriptId>
url :
......@@ -78,7 +78,7 @@ From session 1
callFrames : [
[0] : {
columnNumber : 19
functionName : setTimeout
functionName :
lineNumber : 0
scriptId : <scriptId>
url :
......@@ -107,7 +107,7 @@ From session 2
callFrames : [
[0] : {
columnNumber : 19
functionName : setTimeout
functionName :
lineNumber : 0
scriptId : <scriptId>
url :
......@@ -137,7 +137,7 @@ From session 1
callFrames : [
[0] : {
columnNumber : 40
functionName : setTimeout
functionName :
lineNumber : 0
scriptId : <scriptId>
url :
......@@ -166,7 +166,7 @@ From session 2
callFrames : [
[0] : {
columnNumber : 40
functionName : setTimeout
functionName :
lineNumber : 0
scriptId : <scriptId>
url :
......@@ -215,7 +215,7 @@ From session 1
callFrames : [
[0] : {
columnNumber : 40
functionName : setTimeout
functionName :
lineNumber : 0
scriptId : <scriptId>
url :
......@@ -244,7 +244,7 @@ From session 2
callFrames : [
[0] : {
columnNumber : 40
functionName : setTimeout
functionName :
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 promise.then.result (test/mjsunit/mjsunit.js:{NUMBER}:{NUMBER})
at *%(basename)s:11:17
at 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 promise.then.result (test/mjsunit/mjsunit.js:{NUMBER}:{NUMBER})
at *%(basename)s:10:39
at test/mjsunit/mjsunit.js:{NUMBER}:{NUMBER}
RuntimeError: unreachable
at main (wasm-function[0]:1)
at pair (*%(basename)s:16:27)
at promise.then.result (test/mjsunit/mjsunit.js:*)
at *%(basename)s:16:27
at test/mjsunit/mjsunit.js:*
RuntimeError: unreachable
at main (wasm-function[0]:1)
at pair (test/message/wasm-function-name-async.js:16:27)
at promise.then.result (test/mjsunit/mjsunit.js:*)
at test/message/wasm-function-name-async.js:16:27
at test/mjsunit/mjsunit.js:*
RuntimeError: unreachable
at test-module.main (wasm-function[0]:1)
at pair (*%(basename)s:17:27)
at promise.then.result (test/mjsunit/mjsunit.js:*)
at *%(basename)s:17:27
at test/mjsunit/mjsunit.js:*
RuntimeError: unreachable
at test-module.main (wasm-function[0]:1)
at pair (test/message/wasm-module-and-function-name-async.js:17:27)
at promise.then.result (test/mjsunit/mjsunit.js:*)
at test/message/wasm-module-and-function-name-async.js:17:27
at test/mjsunit/mjsunit.js:*
RuntimeError: unreachable
at test-module (wasm-function[0]:1)
at pair (*%(basename)s:19:27)
at promise.then.result (test/mjsunit/mjsunit.js:*)
at *%(basename)s:19:27
at test/mjsunit/mjsunit.js:*
RuntimeError: unreachable
at test-module (wasm-function[0]:1)
at pair (test/message/wasm-module-name-async.js:19:27)
at promise.then.result (test/mjsunit/mjsunit.js:*)
at test/message/wasm-module-name-async.js:19:27
at test/mjsunit/mjsunit.js:*
RuntimeError: unreachable
at wasm-function[0]:1
at pair (*%(basename)s:18:27)
at promise.then.result (test/mjsunit/mjsunit.js:*)
at *%(basename)s:18:27
at test/mjsunit/mjsunit.js:*
RuntimeError: unreachable
at wasm-function[0]:1
at pair (test/message/wasm-no-name-async.js:18:27)
at promise.then.result (test/mjsunit/mjsunit.js:*)
at test/message/wasm-no-name-async.js:18:27
at test/mjsunit/mjsunit.js:*
......@@ -81,21 +81,19 @@ 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", "test", "runTests"]);
["test", "runTests"]);
await test(async() => { throw new Error("FAIL") },
["test", "test", "runTests"]);
["test", "runTests"]);
await test(async(a) => { throw new Error("FAIL") },
["test", "test", "runTests"]);
["test", "runTests"]);
await test(async(a, b) => { throw new Error("FAIL") },
["test", "test", "runTests"]);
["test", "runTests"]);
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; 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;
......@@ -104,7 +102,7 @@ async function runTests() {
} catch (e) {
throw new Error("FAIL");
}
}, ["test"]);
}, []);
await test(async() => {
await 1;
......@@ -113,7 +111,7 @@ async function runTests() {
} catch (e) {
throw new Error("FAIL");
}
}, ["test"]);
}, []);
await test(async(a) => {
await 1;
......@@ -122,7 +120,7 @@ async function runTests() {
} catch (e) {
throw new Error("FAIL");
}
}, ["test"]);
}, []);
await test(async(a, b) => {
await 1;
......@@ -131,7 +129,7 @@ async function runTests() {
} catch (e) {
throw new Error("FAIL");
}
}, ["test"]);
}, []);
await test(async x => {
await 1;
......@@ -140,7 +138,7 @@ async function runTests() {
} catch (e) {
throw new Error("FAIL");
}
}, ["test"]);
}, []);
await test(async() => {
await 1;
......@@ -149,7 +147,7 @@ async function runTests() {
} catch (e) {
throw new Error("FAIL");
}
}, ["test"]);
}, []);
await test(async(a) => {
await 1;
......@@ -158,7 +156,7 @@ async function runTests() {
} catch (e) {
throw new Error("FAIL");
}
}, ["test"]);
}, []);
await test(async(a, b) => {
await 1;
......@@ -167,7 +165,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