js-ast-parser
Version:
把javascript代码字符串解析为AST对象
24 lines • 863 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.UnExpectStatement = void 0;
const constants_1 = require("../../constants");
const AstNode_1 = require("../AstNode");
const Statement_1 = require("./Statement");
class UnExpectStatement extends Statement_1.Statement {
constructor(value, msg, loc) {
super();
this.value = value;
this.msg = msg;
this.type = 'UnExpectStatement';
this.code = constants_1.NodeCode.UnexpectStatement;
if (loc) {
Object.assign(this.loc, loc);
}
else if (value && value instanceof AstNode_1.AstNode) {
this.loc.start = value.loc.start;
this.loc.end = value.loc.end;
}
}
}
exports.UnExpectStatement = UnExpectStatement;
//# sourceMappingURL=UnExpectStatement.js.map