We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
acorn-loose
1 parent db41c3d commit da56225Copy full SHA for da56225
lib/node_modules/@stdlib/repl/lib/tokenizer.js
@@ -67,11 +67,15 @@ function tokenizer( line, context ) {
67
var i;
68
69
// Parse the given line into tokens & comments...
70
- ast = parse( line, {
71
- 'ecmaVersion': 'latest',
72
- 'onToken': onToken,
73
- 'onComment': onComment
74
- });
+ try {
+ ast = parse( line, {
+ 'ecmaVersion': 'latest',
+ 'onToken': onToken,
+ 'onComment': onComment
75
+ });
76
+ } catch ( error ) { // eslint-disable-line no-unused-vars
77
+ return tokens;
78
+ }
79
80
// Resolve variable declarations from the given line as tokens...
81
declarations = resolveLocalScopes( ast );
0 commit comments