@@ -9,17 +9,31 @@ const { processTopLevelAwait } = require('internal/repl/await');
9
9
// This test was created based on
10
10
// https://cs.chromium.org/chromium/src/third_party/WebKit/LayoutTests/http/tests/inspector-unit/preprocess-top-level-awaits.js?rcl=358caaba5e763e71c4abb9ada2d9cd8b1188cac9
11
11
12
+ const surrogate = (
13
+ '"\u{1F601}\u{1f468}\u200d\u{1f469}\u200d\u{1f467}\u200d\u{1f466}"'
14
+ ) ;
15
+
12
16
const testCases = [
13
17
[ '0' ,
14
18
null ] ,
15
19
[ 'await 0' ,
16
20
'(async () => { return (await 0) })()' ] ,
21
+ [ `await ${ surrogate } ` ,
22
+ `(async () => { return (await ${ surrogate } ) })()` ] ,
17
23
[ 'await 0;' ,
18
24
'(async () => { return (await 0); })()' ] ,
25
+ [ `await ${ surrogate } ;` ,
26
+ `(async () => { return (await ${ surrogate } ); })()` ] ,
27
+ [ `await ${ surrogate } ;` ,
28
+ `(async () => { return (await ${ surrogate } ); })()` ] ,
19
29
[ '(await 0)' ,
20
30
'(async () => { return ((await 0)) })()' ] ,
31
+ [ `(await ${ surrogate } )` ,
32
+ `(async () => { return ((await ${ surrogate } )) })()` ] ,
21
33
[ '(await 0);' ,
22
34
'(async () => { return ((await 0)); })()' ] ,
35
+ [ `(await ${ surrogate } );` ,
36
+ `(async () => { return ((await ${ surrogate } )); })()` ] ,
23
37
[ 'async function foo() { await 0; }' ,
24
38
null ] ,
25
39
[ 'async () => await 0' ,
@@ -28,8 +42,12 @@ const testCases = [
28
42
null ] ,
29
43
[ 'await 0; return 0;' ,
30
44
null ] ,
45
+ [ `await ${ surrogate } ; await ${ surrogate } ;` ,
46
+ `(async () => { await ${ surrogate } ; return (await ${ surrogate } ); })()` ] ,
31
47
[ 'var a = await 1' ,
32
48
'var a; (async () => { void (a = await 1) })()' ] ,
49
+ [ `var a = await ${ surrogate } ` ,
50
+ `var a; (async () => { void (a = await ${ surrogate } ) })()` ] ,
33
51
[ 'let a = await 1' ,
34
52
'let a; (async () => { void (a = await 1) })()' ] ,
35
53
[ 'const a = await 1' ,
0 commit comments