Commit 6f69e3ce authored by Alexey Kozyatinskiy's avatar Alexey Kozyatinskiy Committed by Commit Bot

[inspector] removed break location right before suspension in async function

In current implementation in expressions like await foo() we have break location right after foo call and before actual await.
And we additionally have a lot of other statement locations because of do scope.

Let's move async debugging closer to sync debugging and introduce only one break location for await - before awaited function call.

Bug: v8:6425,v8:6162
Change-Id: I7568767856022c49101e7f3b7e39a2e401d21644
Reviewed-on: https://chromium-review.googlesource.com/514046Reviewed-by: 's avatarMarja Hölttä <marja@chromium.org>
Reviewed-by: 's avatarDmitry Gozman <dgozman@chromium.org>
Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#45625}
parent 73cf88d6
......@@ -3872,15 +3872,13 @@ void Parser::RewriteAsyncFunctionBody(ZoneList<Statement*>* body, Block* block,
Expression* Parser::RewriteAwaitExpression(Expression* value, int await_pos) {
// In an Async Function:
// yield do {
// tmp = <operand>;
// %AsyncFunctionAwait(.generator_object, tmp, .promise);
// %AsyncFunctionAwait(.generator_object, <operand>, .promise);
// .promise
// }
//
// In an Async Generator:
// yield do {
// tmp = <operand>;
// %AsyncGeneratorAwait(.generator_object, tmp)
// %AsyncGeneratorAwait(.generator_object, <operand>)
// .await_result_var
// }
//
......@@ -3894,10 +3892,6 @@ Expression* Parser::RewriteAwaitExpression(Expression* value, int await_pos) {
// ignored. If we yielded the value of the throwawayPromise that
// AsyncFunctionAwait creates as an intermediate, it would create a memory
// leak; we must return .promise instead;
// The operand needs to be evaluated on a separate statement in order to get
// a break location, and the .promise needs to be read earlier so that it
// doesn't insert a false location.
// TODO(littledan): investigate why this ordering is needed in more detail.
//
// In the case of Async Generators, `.await_result_var` is not actually used
// for anything, but exists because of the current requirement that
......@@ -3909,15 +3903,6 @@ Expression* Parser::RewriteAwaitExpression(Expression* value, int await_pos) {
const int nopos = kNoSourcePosition;
Block* do_block = factory()->NewBlock(nullptr, 2, false, nopos);
// Wrap value evaluation to provide a break location.
Variable* temp_var = NewTemporary(ast_value_factory()->empty_string());
Expression* value_assignment = factory()->NewAssignment(
Token::ASSIGN, factory()->NewVariableProxy(temp_var), value, nopos);
do_block->statements()->Add(
factory()->NewExpressionStatement(value_assignment, value->position()),
zone());
Expression* generator_object =
factory()->NewVariableProxy(generator_object_variable);
......@@ -3928,18 +3913,16 @@ Expression* Parser::RewriteAwaitExpression(Expression* value, int await_pos) {
// ParseAndRewriteGeneratorFunctionBody)
ZoneList<Expression*>* args = new (zone()) ZoneList<Expression*>(2, zone());
args->Add(generator_object, zone());
args->Add(factory()->NewVariableProxy(temp_var), zone());
args->Add(value, zone());
Expression* await = factory()->NewCallRuntime(
Context::ASYNC_GENERATOR_AWAIT_CAUGHT, args, nopos);
do_block->statements()->Add(
factory()->NewExpressionStatement(await, await_pos), zone());
do_block->statements()->Add(factory()->NewExpressionStatement(await, nopos),
zone());
// Wrap await to provide a break location between value evaluation and
// yield.
Expression* do_expr = factory()->NewDoExpression(
do_block, AsyncGeneratorAwaitVariable(), nopos);
return BuildSuspend(generator_object, do_expr, nopos,
return BuildSuspend(generator_object, do_expr, await_pos,
Suspend::kOnExceptionRethrow, SuspendFlags::kAwait);
}
......@@ -3948,19 +3931,18 @@ Expression* Parser::RewriteAwaitExpression(Expression* value, int await_pos) {
// there is no local enclosing try/catch block.
ZoneList<Expression*>* args = new (zone()) ZoneList<Expression*>(3, zone());
args->Add(generator_object, zone());
args->Add(factory()->NewVariableProxy(temp_var), zone());
args->Add(value, zone());
args->Add(factory()->NewVariableProxy(PromiseVariable()), zone());
Expression* await = factory()->NewCallRuntime(
Context::ASYNC_FUNCTION_AWAIT_CAUGHT_INDEX, args, nopos);
do_block->statements()->Add(
factory()->NewExpressionStatement(await, await_pos), zone());
do_block->statements()->Add(factory()->NewExpressionStatement(await, nopos),
zone());
// Wrap await to provide a break location between value evaluation and yield.
Expression* do_expr =
factory()->NewDoExpression(do_block, PromiseVariable(), nopos);
return factory()->NewSuspend(generator_object, do_expr, nopos,
return factory()->NewSuspend(generator_object, do_expr, await_pos,
Suspend::kOnExceptionRethrow,
SuspendFlags::kAwait);
}
......
......@@ -24,7 +24,7 @@ Debug.setListener(listener);
var late_resolve;
function g() {
return new Promise( // B3 StepOut
return new Promise( // B2 StepOut
function(res, rej) {
late_resolve = res;
}
......@@ -34,8 +34,8 @@ function g() {
async function f() {
var a = 1;
debugger; // B0 StepNext
a += // B1 StepNext
await // B4 StepNext
a += // B1 StepIn
await
g(); // B2 StepIn
return a;
}
......@@ -44,10 +44,10 @@ f();
// Starting a new step action at an intermediate break point
// means that we will abort the current async step.
debugger; // B5 StepNext
debugger; // B3 StepNext
late_resolve(3); // B6 Continue
late_resolve(3); // B4 Continue
%RunMicrotasks();
assertEquals(7, step_count);
assertEquals(5, step_count);
......@@ -24,7 +24,7 @@ Debug.setListener(listener);
var late_resolve;
function g() {
return new Promise( // B3 StepOut
return new Promise( // B2 StepOut
function(res, rej) {
late_resolve = res;
}
......@@ -34,20 +34,20 @@ function g() {
async function f() {
var a = 1;
debugger; // B0 StepNext
a += // B1 StepNext
a += // B1 StepIn
await // B4 StepNext
g(); // B2 StepIn
return a; // B6 StepNext
} // B7 Continue
return a; // B4 StepNext
} // B5 Continue
f();
// Continuing at an intermediate break point means that we will
// carry on with the current async step.
debugger; // B5 Continue
debugger; // B3 Continue
late_resolve(3);
%RunMicrotasks();
assertEquals(8, step_count);
assertEquals(6, step_count);
......@@ -24,7 +24,7 @@ Debug.setListener(listener);
var late_resolve;
function g() {
return new Promise( // B3 StepOut
return new Promise( // B2 StepOut
function(res, rej) {
late_resolve = res;
}
......@@ -34,11 +34,11 @@ function g() {
async function f() {
var a = 1;
debugger; // B0 StepNext
a += // B1 StepNext
await // B4 StepNext
g(); // B2 StepIn
return a; // B5 StepNext
} // B6 Continue
a += // B1 StepIn
await
g();
return a; // B3 StepNext
} // B4 Continue
f();
......@@ -46,4 +46,4 @@ late_resolve(3);
%RunMicrotasks();
assertEquals(7, step_count);
assertEquals(5, step_count);
......@@ -24,7 +24,7 @@ Debug.setListener(listener);
var late_resolve;
function g() {
return new Promise( // B3 StepOut
return new Promise( // B2 StepOut
function(res, rej) {
late_resolve = res;
}
......@@ -34,16 +34,16 @@ function g() {
async function f() {
var a = 1;
debugger; // B0 StepNext
a += // B1 StepNext
await // B4 StepOut
g(); // B2 StepIn
return a;
a += // B1 StepIn
await
g();
return a; // B3 Continue
}
f();
late_resolve(3); // B5 Continue
late_resolve(3);
%RunMicrotasks();
assertEquals(6, step_count);
assertEquals(4, step_count);
......@@ -24,21 +24,21 @@ Debug.setListener(listener);
var late_resolve;
function g() {
return new Promise( // B3 StepIn
return new Promise( // B2 StepIn
function(res, rej) {
late_resolve = res; // B4 StepIn
} // B5 StepIn
late_resolve = res; // B3 StepIn
} // B4 StepIn
);
} // B6 StepIn
} // B5 StepIn
async function f() {
var a = 1;
debugger; // B0 StepNext
a += // B1 StepIn
await // B7 StepIn
g(); // B2 StepIn
return a; // B8 StepIn
} // B9 Continue
await
g();
return a; // B6 StepIn
} // B7 Continue
f().then(value => assertEquals(4, value));
......@@ -46,4 +46,4 @@ late_resolve(3);
%RunMicrotasks();
assertEquals(10, step_count);
assertEquals(8, step_count);
......@@ -24,7 +24,7 @@ Debug.setListener(listener);
var late_resolve;
function g() {
return new Promise( // B5 StepOut
return new Promise( // B3 StepOut
function(res, rej) {
late_resolve = res;
}
......@@ -34,17 +34,17 @@ function g() {
async function f1() {
var a = 1;
debugger; // B0 StepNext
a += // B1 StepNext
a += // B1 StepIn
await // B7 StepNext
f2(); // B2 StepIn
return a; // B8 StepNext
} // B9 Continue
return a; // B5 StepNext
} // B6 Continue
async function f2() {
var b = 0 + // B3 StepIn
await // B6 StepOut
g(); // B4 StepIn
return b;
var b = 0 + // B2 StepIn
await
g();
return b; // B4 StepOut
}
f1();
......@@ -53,4 +53,4 @@ late_resolve(3);
%RunMicrotasks();
assertEquals(10, step_count);
assertEquals(7, step_count);
......@@ -25,13 +25,13 @@ async function f() {
var a = 1;
debugger; // B0 StepNext
a += // B1 StepNext
await // B3 StepNext
5; // B2 StepNext
return a; // B4 StepNext
} // B5 Continue
await
5;
return a; // B2 StepNext
} // B3 Continue
f();
%RunMicrotasks();
assertEquals(6, step_count);
assertEquals(4, step_count);
......@@ -35,10 +35,10 @@ async function f() {
var a = 1;
debugger; // B0 StepNext
a += // B1 StepNext
await // B3 StepNext
g(); // B2 StepNext
return a; // B4 StepNext
} // B5 Continue
await
g();
return a; // B2 StepNext
} // B3 Continue
f();
......@@ -46,4 +46,4 @@ late_resolve(3);
%RunMicrotasks();
assertEquals(6, step_count);
assertEquals(4, step_count);
Tests breakable locations in await expression.
Running test: testBreakLocations
function testFunction() {
async function f1() {
for (let x = |_|0; x |_|< 1; ++|_|x) |_|await |C|x;
|_|return await Promise.|C|resolve(2);
|R|}
async function f2() {
let r = |_|await |C|f1() + await |C|f1();
|_|await |C|f1();
|_|await |C|f1().|C|then(x => x |_|* 2|R|);
|_|await [1].|C|map(x => Promise.|C|resolve(x)|R|)[0];
|_|await Promise.|C|resolve().|C|then(x => x |_|* 2|R|);
let p = |_|Promise.|C|resolve(42);
|_|await |C|p;
|_|return r;
|R|}
|_|return |C|f2();
|R|}
Running test: testStepInto
(anonymous) (expr.js:0:0)
testFunction (test.js:18:2)
(anonymous) (expr.js:0:0)
#return f2();
}
f2 (test.js:8:12)
testFunction (test.js:18:9)
(anonymous) (expr.js:0:0)
async function f2() {
let r = #await f1() + await f1();
await f1();
f1 (test.js:3:17)
f2 (test.js:8:18)
testFunction (test.js:18:9)
(anonymous) (expr.js:0:0)
async function f1() {
for (let x = #0; x < 1; ++x) await x;
return await Promise.resolve(2);
f1 (test.js:3:22)
f2 (test.js:8:18)
testFunction (test.js:18:9)
(anonymous) (expr.js:0:0)
async function f1() {
for (let x = 0; x #< 1; ++x) await x;
return await Promise.resolve(2);
f1 (test.js:3:32)
f2 (test.js:8:18)
testFunction (test.js:18:9)
(anonymous) (expr.js:0:0)
async function f1() {
for (let x = 0; x < 1; ++x) #await x;
return await Promise.resolve(2);
f1 (test.js:3:29)
async function f1() {
for (let x = 0; x < 1; ++#x) await x;
return await Promise.resolve(2);
f1 (test.js:3:22)
async function f1() {
for (let x = 0; x #< 1; ++x) await x;
return await Promise.resolve(2);
f1 (test.js:4:4)
for (let x = 0; x < 1; ++x) await x;
#return await Promise.resolve(2);
}
f1 (test.js:5:2)
return await Promise.resolve(2);
#}
f2 (test.js:8:31)
async function f2() {
let r = await f1() + await #f1();
await f1();
f1 (test.js:3:17)
f2 (test.js:8:31)
async function f1() {
for (let x = #0; x < 1; ++x) await x;
return await Promise.resolve(2);
f1 (test.js:3:22)
f2 (test.js:8:31)
async function f1() {
for (let x = 0; x #< 1; ++x) await x;
return await Promise.resolve(2);
f1 (test.js:3:32)
f2 (test.js:8:31)
async function f1() {
for (let x = 0; x < 1; ++x) #await x;
return await Promise.resolve(2);
f1 (test.js:3:29)
async function f1() {
for (let x = 0; x < 1; ++#x) await x;
return await Promise.resolve(2);
f1 (test.js:3:22)
async function f1() {
for (let x = 0; x #< 1; ++x) await x;
return await Promise.resolve(2);
f1 (test.js:4:4)
for (let x = 0; x < 1; ++x) await x;
#return await Promise.resolve(2);
}
f1 (test.js:5:2)
return await Promise.resolve(2);
#}
f2 (test.js:9:4)
let r = await f1() + await f1();
#await f1();
await f1().then(x => x * 2);
f1 (test.js:3:17)
f2 (test.js:9:10)
async function f1() {
for (let x = #0; x < 1; ++x) await x;
return await Promise.resolve(2);
f1 (test.js:3:22)
f2 (test.js:9:10)
async function f1() {
for (let x = 0; x #< 1; ++x) await x;
return await Promise.resolve(2);
f1 (test.js:3:32)
f2 (test.js:9:10)
async function f1() {
for (let x = 0; x < 1; ++x) #await x;
return await Promise.resolve(2);
f1 (test.js:3:29)
async function f1() {
for (let x = 0; x < 1; ++#x) await x;
return await Promise.resolve(2);
f1 (test.js:3:22)
async function f1() {
for (let x = 0; x #< 1; ++x) await x;
return await Promise.resolve(2);
f1 (test.js:4:4)
for (let x = 0; x < 1; ++x) await x;
#return await Promise.resolve(2);
}
f1 (test.js:5:2)
return await Promise.resolve(2);
#}
f2 (test.js:10:4)
await f1();
#await f1().then(x => x * 2);
await [1].map(x => Promise.resolve(x))[0];
f1 (test.js:3:17)
f2 (test.js:10:10)
async function f1() {
for (let x = #0; x < 1; ++x) await x;
return await Promise.resolve(2);
f1 (test.js:3:22)
f2 (test.js:10:10)
async function f1() {
for (let x = 0; x #< 1; ++x) await x;
return await Promise.resolve(2);
f1 (test.js:3:32)
f2 (test.js:10:10)
async function f1() {
for (let x = 0; x < 1; ++x) #await x;
return await Promise.resolve(2);
f1 (test.js:3:29)
async function f1() {
for (let x = 0; x < 1; ++#x) await x;
return await Promise.resolve(2);
f1 (test.js:3:22)
async function f1() {
for (let x = 0; x #< 1; ++x) await x;
return await Promise.resolve(2);
f1 (test.js:4:4)
for (let x = 0; x < 1; ++x) await x;
#return await Promise.resolve(2);
}
f1 (test.js:5:2)
return await Promise.resolve(2);
#}
f1.then.x (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)
await f1();
await f1().then(x => x * 2#);
await [1].map(x => Promise.resolve(x))[0];
f2 (test.js:11:4)
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: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)
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);
f2 (test.js:12:4)
await [1].map(x => Promise.resolve(x))[0];
#await Promise.resolve().then(x => x * 2);
let p = Promise.resolve(42);
f2 (test.js:13:12)
await Promise.resolve().then(x => x * 2);
let p = #Promise.resolve(42);
await p;
f2 (test.js:14:4)
let p = Promise.resolve(42);
#await p;
return r;
f2 (test.js:15:4)
await p;
#return r;
}
f2 (test.js:16:2)
return r;
#}
Running test: testStepOver
f2 (test.js:8:12)
testFunction (test.js:18:9)
(anonymous) (expr.js:0:0)
async function f2() {
let r = #await f1() + await f1();
await f1();
f2 (test.js:8:31)
async function f2() {
let r = await f1() + await #f1();
await f1();
f2 (test.js:9:4)
let r = await f1() + await f1();
#await f1();
await f1().then(x => x * 2);
f2 (test.js:10:4)
await f1();
#await f1().then(x => x * 2);
await [1].map(x => Promise.resolve(x))[0];
f2 (test.js:11:4)
await f1().then(x => x * 2);
#await [1].map(x => Promise.resolve(x))[0];
await Promise.resolve().then(x => x * 2);
f2 (test.js:12:4)
await [1].map(x => Promise.resolve(x))[0];
#await Promise.resolve().then(x => x * 2);
let p = Promise.resolve(42);
f2 (test.js:13:12)
await Promise.resolve().then(x => x * 2);
let p = #Promise.resolve(42);
await p;
f2 (test.js:14:4)
let p = Promise.resolve(42);
#await p;
return r;
f2 (test.js:15:4)
await p;
#return r;
}
f2 (test.js:16:2)
return r;
#}
Running test: testStepIntoAfterBreakpoint
f2 (test.js:9:4)
let r = await f1() + await f1();
#await f1();
await f1().then(x => x * 2);
f1 (test.js:3:17)
f2 (test.js:9:10)
async function f1() {
for (let x = #0; x < 1; ++x) await x;
return await Promise.resolve(2);
f1 (test.js:3:22)
f2 (test.js:9:10)
async function f1() {
for (let x = 0; x #< 1; ++x) await x;
return await Promise.resolve(2);
f1 (test.js:3:32)
f2 (test.js:9:10)
async function f1() {
for (let x = 0; x < 1; ++x) #await x;
return await Promise.resolve(2);
f1 (test.js:3:29)
async function f1() {
for (let x = 0; x < 1; ++#x) await x;
return await Promise.resolve(2);
f1 (test.js:3:22)
async function f1() {
for (let x = 0; x #< 1; ++x) await x;
return await Promise.resolve(2);
f1 (test.js:4:4)
for (let x = 0; x < 1; ++x) await x;
#return await Promise.resolve(2);
}
// Copyright 2017 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
let {session, contextGroup, Protocol} =
InspectorTest.start('Tests breakable locations in await expression.');
let source = `
function testFunction() {
async function f1() {
for (let x = 0; x < 1; ++x) await x;
return await Promise.resolve(2);
}
async function f2() {
let r = await f1() + await f1();
await f1();
await f1().then(x => x * 2);
await [1].map(x => Promise.resolve(x))[0];
await Promise.resolve().then(x => x * 2);
let p = Promise.resolve(42);
await p;
return r;
}
return f2();
}
//# sourceURL=test.js`;
contextGroup.addScript(source);
session.setupScriptMap();
InspectorTest.runAsyncTestSuite([
async function testBreakLocations() {
Protocol.Debugger.enable();
let {params:{scriptId}} = await Protocol.Debugger.onceScriptParsed();
let {result:{locations}} = await Protocol.Debugger.getPossibleBreakpoints({
start: {lineNumber: 0, columnNumber : 0, scriptId}});
dumpAllLocations(locations);
},
async function testStepInto() {
Protocol.Debugger.pause();
let fin = Protocol.Runtime.evaluate({
expression: 'testFunction()//# sourceURL=expr.js', awaitPromise: true}).then(() => false);
let result;
while (result = await Promise.race([fin, Protocol.Debugger.oncePaused()])) {
let {params:{callFrames}} = result;
session.logCallFrames(callFrames);
session.logSourceLocation(callFrames[0].location);
Protocol.Debugger.stepInto();
}
Protocol.Runtime.evaluate({expression: '42'});
await Protocol.Debugger.oncePaused();
await Protocol.Debugger.resume();
},
async function testStepOver() {
Protocol.Debugger.pause();
let fin = Protocol.Runtime.evaluate({
expression: 'testFunction()//# sourceURL=expr.js', awaitPromise: true}).then(() => false);
Protocol.Debugger.stepInto();
await Protocol.Debugger.oncePaused();
Protocol.Debugger.stepInto();
await Protocol.Debugger.oncePaused();
let result;
while (result = await Promise.race([fin, Protocol.Debugger.oncePaused()])) {
let {params:{callFrames}} = result;
session.logCallFrames(callFrames);
session.logSourceLocation(callFrames[0].location);
Protocol.Debugger.stepOver();
}
Protocol.Runtime.evaluate({expression: '42'});
await Protocol.Debugger.oncePaused();
await Protocol.Debugger.resume();
},
async function testStepIntoAfterBreakpoint() {
Protocol.Debugger.setBreakpointByUrl({lineNumber: 9, url: 'test.js'});
Protocol.Runtime.evaluate({
expression: 'testFunction()//# sourceURL=expr.js'});
await awaitPausedAndDump();
Protocol.Debugger.stepInto();
await awaitPausedAndDump();
Protocol.Debugger.stepInto();
await awaitPausedAndDump();
Protocol.Debugger.stepInto();
await awaitPausedAndDump();
Protocol.Debugger.stepInto();
await awaitPausedAndDump();
Protocol.Debugger.stepInto();
await awaitPausedAndDump();
Protocol.Debugger.stepInto();
await awaitPausedAndDump();
await Protocol.Debugger.resume();
async function awaitPausedAndDump() {
let {params:{callFrames}} = await Protocol.Debugger.oncePaused();
session.logCallFrames(callFrames);
session.logSourceLocation(callFrames[0].location);
}
}
]);
function dumpAllLocations(locations) {
var lines = source.split('\n');
var locations = locations.sort((loc1, loc2) => {
if (loc2.lineNumber !== loc1.lineNumber) return loc2.lineNumber - loc1.lineNumber;
return loc2.columnNumber - loc1.columnNumber;
});
for (var location of locations) {
var line = lines[location.lineNumber];
line = line.slice(0, location.columnNumber) + locationMark(location.type) + line.slice(location.columnNumber);
lines[location.lineNumber] = line;
}
lines = lines.filter(line => line.indexOf('//# sourceURL=') === -1);
InspectorTest.log(lines.join('\n') + '\n');
}
function locationMark(type) {
if (type === 'return') return '|R|';
if (type === 'call') return '|C|';
if (type === 'debuggerStatement') return '|D|';
return '|_|';
}
......@@ -143,20 +143,6 @@ testFunction (test.js:18:4)
let r = #await Promise.resolve(42);
return r;
asyncF (test.js:16:26)
testFunction (test.js:18:4)
(anonymous) (expr.js:0:0)
(async function asyncF() {
let r = await Promise.#resolve(42);
return r;
asyncF (test.js:16:12)
testFunction (test.js:18:4)
(anonymous) (expr.js:0:0)
(async function asyncF() {
let r = #await Promise.resolve(42);
return r;
asyncF (test.js:17:4)
let r = await Promise.resolve(42);
#return r;
......
......@@ -227,7 +227,7 @@ async function testPromiseAsyncWithCode() {
var resolveNested;
var p = |C|new Promise(resolve => resolveNested |_|= resolve|R|);
|C|setTimeout(resolveNested, 0);
|_|await |_|p;
|_|await |C|p;
|R|}
|C|setTimeout(returnCall, 0);
|_|await |C|foo();
......@@ -252,7 +252,7 @@ async function testPromiseComplex() {
|R|}
var x = |_|1;
var y = |_|2;
|C|returnFunction(|C|emptyFunction(), x++, --y, x => 2 |_|* x|R|, |C|returnCall())|C|().a = |_|await |C|foo((a => 2 |_|*a|R|)|C|(5));
|C|returnFunction(|C|emptyFunction(), x++, --y, x => 2 |_|* x|R|, |C|returnCall())|C|().a = await |C|foo((a => 2 |_|*a|R|)|C|(5));
|C|nextTest();
|R|}
|C|main();
......
......@@ -803,31 +803,6 @@ async function testAsyncAwait() {
#await asyncFoo();
await awaitBoo();
break at:
async function testAsyncAwait() {
await #asyncFoo();
await awaitBoo();
break at:
async function asyncFoo() {
#await Promise.resolve().then(v => v * 2);
return42();
break at:
async function asyncFoo() {
await Promise.resolve().#then(v => v * 2);
return42();
break at:
async function asyncFoo() {
await Promise.#resolve().then(v => v * 2);
return42();
break at:
async function asyncFoo() {
await Promise.resolve().#then(v => v * 2);
return42();
break at:
async function asyncFoo() {
#await Promise.resolve().then(v => v * 2);
......@@ -843,16 +818,6 @@ break at:
#}
break at:
async function asyncBoo() {
#await Promise.resolve();
}
break at:
async function asyncBoo() {
await Promise.#resolve();
}
break at:
async function asyncBoo() {
#await Promise.resolve();
......@@ -890,11 +855,6 @@ break at:
#await foo();
await foo();
break at:
setTimeout(returnCall, 0);
await #foo();
await foo();
break at:
var resolveNested;
var p = #new Promise(resolve => resolveNested = resolve);
......@@ -920,16 +880,6 @@ break at:
#await p;
}
break at:
setTimeout(resolveNested, 0);
await #p;
}
break at:
setTimeout(resolveNested, 0);
#await p;
}
break at:
var resolveNested;
var p = #new Promise(resolve => resolveNested = resolve);
......@@ -955,16 +905,6 @@ break at:
#await p;
}
break at:
setTimeout(resolveNested, 0);
await #p;
}
break at:
setTimeout(resolveNested, 0);
#await p;
}
Running test: testPromiseComplex
break at:
......@@ -1064,7 +1004,7 @@ break at:
break at:
var y = 2;
returnFunction(emptyFunction(), x++, --y, x => 2 * x, returnCall())().a = await #foo((a => 2 *a)(5));
returnFunction(emptyFunction(), x++, --y, x => 2 * x, returnCall())().a = await foo((a => 2 *a)#(5));
nextTest();
break at:
......@@ -1087,13 +1027,3 @@ break at:
#await Promise.resolve();
return 42;
break at:
async function foo() {
await Promise.#resolve();
return 42;
break at:
async function foo() {
#await Promise.resolve();
return 42;
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