File tree Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Original file line number Diff line number Diff line change @@ -43,3 +43,45 @@ test('allows top level return by default', function (t) {
43
43
} )
44
44
t . end ( )
45
45
} )
46
+
47
+ test ( 'supports async generators' , function ( t ) {
48
+ t . doesNotThrow ( function ( ) {
49
+ acorn . parse ( 'async function* a () { await x; yield 1 }' )
50
+ } )
51
+ t . end ( )
52
+ } )
53
+
54
+ test ( 'supports async iteration' , function ( t ) {
55
+ t . doesNotThrow ( function ( ) {
56
+ acorn . parse ( 'async function l (y) { for await (const x of y) {} }' )
57
+ } )
58
+ t . end ( )
59
+ } )
60
+
61
+ test ( 'supports optional catch' , function ( t ) {
62
+ t . doesNotThrow ( function ( ) {
63
+ acorn . parse ( 'try { throw null } catch {}' )
64
+ } )
65
+ t . end ( )
66
+ } )
67
+
68
+ test ( 'supports bigint' , function ( t ) {
69
+ t . doesNotThrow ( function ( ) {
70
+ acorn . parse ( '50n ** 50n' )
71
+ } )
72
+ t . end ( )
73
+ } )
74
+
75
+ test ( 'supports import.meta with sourceType: module' , function ( t ) {
76
+ t . doesNotThrow ( function ( ) {
77
+ acorn . parse ( 'console.log(import.meta.url)' , { sourceType : 'module' } )
78
+ } )
79
+ t . end ( )
80
+ } )
81
+
82
+ test ( 'supports dynamic import() with sourceType: module' , function ( t ) {
83
+ t . doesNotThrow ( function ( ) {
84
+ acorn . parse ( 'import("./whatever.mjs")' , { sourceType : 'module' } )
85
+ } )
86
+ t . end ( )
87
+ } )
You can’t perform that action at this time.
0 commit comments