forked from jasder/antlr
Merge pull request #993 from ericvergnaud/minor-javacript-bug-fixes
was failing when ran in NodeJS
This commit is contained in:
commit
7b602e6054
|
@ -34,7 +34,7 @@
|
|||
// when you construct the object.
|
||||
//
|
||||
var InputStream = require('./InputStream').InputStream;
|
||||
var isNodeJs = typeof window === 'undefined' && importScripts === 'undefined';
|
||||
var isNodeJs = typeof window === 'undefined' && typeof importScripts === 'undefined';
|
||||
var fs = isNodeJs ? require("fs") : null;
|
||||
|
||||
function FileStream(fileName) {
|
||||
|
|
|
@ -214,7 +214,7 @@ ParserRuleContext.prototype.getSourceInterval = function() {
|
|||
if( this.start === null || this.stop === null) {
|
||||
return INVALID_INTERVAL;
|
||||
} else {
|
||||
return Interval(this.start.tokenIndex, this.stop.tokenIndex);
|
||||
return new Interval(this.start.tokenIndex, this.stop.tokenIndex);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue