Skip to content

Commit 9811ba2

Browse files
committed
Add test for hashbangs and top level returns
1 parent 70ea753 commit 9811ba2

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

test/index.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,17 @@ test('tokenizes object spread syntax', function (t) {
2929
})
3030
t.end()
3131
})
32+
33+
test('allows hashbangs by default', function (t) {
34+
t.doesNotThrow(function () {
35+
acorn.parse('#!/usr/bin/env node\nconsole.log("ok")')
36+
})
37+
t.end()
38+
})
39+
40+
test('allows top level return by default', function (t) {
41+
t.doesNotThrow(function () {
42+
acorn.parse('console.log("ok"); return; console.log("not ok")')
43+
})
44+
t.end()
45+
})

0 commit comments

Comments
 (0)