add startLine option (#346)
This commit is contained in:
committed by
Daniel Tschinder
parent
407c97c9c2
commit
f25a2fbc78
@@ -4,6 +4,7 @@
|
||||
export const defaultOptions: {
|
||||
sourceType: string,
|
||||
sourceFilename: any,
|
||||
startLine: number,
|
||||
allowReturnOutsideFunction: boolean,
|
||||
allowImportExportEverywhere: boolean,
|
||||
allowSuperOutsideMethod: boolean,
|
||||
@@ -14,6 +15,9 @@ export const defaultOptions: {
|
||||
sourceType: "script",
|
||||
// Source filename.
|
||||
sourceFilename: undefined,
|
||||
// Line from which to start counting source. Useful for
|
||||
// integration with other tools.
|
||||
startLine: 1,
|
||||
// When enabled, a return at the top level is not considered an
|
||||
// error.
|
||||
allowReturnOutsideFunction: false,
|
||||
|
||||
@@ -34,7 +34,7 @@ export default class State {
|
||||
this.commentStack = [];
|
||||
|
||||
this.pos = this.lineStart = 0;
|
||||
this.curLine = 1;
|
||||
this.curLine = options.startLine;
|
||||
|
||||
this.type = tt.eof;
|
||||
this.value = null;
|
||||
|
||||
Reference in New Issue
Block a user