Skip to content

Commit 7f67462

Browse files
committed
Properly throw an error, not a raw string
Issue #1408
1 parent 356ed94 commit 7f67462

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

acorn-walk/src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,10 +180,10 @@ export function make(funcs, baseVisitor) {
180180
}
181181

182182
function skipThrough(node, st, c) { c(node, st) }
183-
function ignore(_node, _st, _c) { }
183+
function ignore(_node, _st, _c) {}
184184

185185
function visitNode(baseVisitor, type, node, st, c) {
186-
if (baseVisitor[type] == null) throw `No walker function defined for node type ${type}`
186+
if (baseVisitor[type] == null) throw new Error(`No walker function defined for node type ${type}`)
187187
baseVisitor[type](node, st, c)
188188
}
189189

0 commit comments

Comments
 (0)