Skip to content

Commit 676b088

Browse files
committed
Remove esprima-specific tolerant error collection (which espree does not support)
1 parent a744d10 commit 676b088

1 file changed

Lines changed: 2 additions & 10 deletions

File tree

src/js/_enqueues/vendor/codemirror/fakejshint.js

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Based on https://github.com/jquery/esprima/blob/gh-pages/demo/validate.js which is MIT licensed
33

44
var fakeJSHINT = new function() {
5-
var syntax, errors;
5+
var syntax;
66
var that = this;
77
this.data = [];
88
this.convertError = function( error ){
@@ -20,15 +20,7 @@ var fakeJSHINT = new function() {
2020
loc: true,
2121
sourceType: 'module'
2222
});
23-
errors = syntax.errors;
24-
if ( errors && errors.length > 0 ) {
25-
for ( var i = 0; i < errors.length; i++) {
26-
var error = errors[i];
27-
that.data.push( that.convertError( error ) );
28-
}
29-
} else {
30-
that.data = [];
31-
}
23+
that.data = [];
3224
} catch (e) {
3325
that.data.push( that.convertError( e ) );
3426
}

0 commit comments

Comments
 (0)