mirror of
https://github.com/Azure/k8s-deploy.git
synced 2026-06-24 05:29:26 +08:00
Add node modules and new code for release (#168)
Co-authored-by: OliverMKing <OliverMKing@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
ca8d2604ac
commit
a0f00e5017
+43
@@ -0,0 +1,43 @@
|
||||
'use strict';
|
||||
|
||||
const Mixin = require('../../utils/mixin');
|
||||
|
||||
class ErrorReportingMixinBase extends Mixin {
|
||||
constructor(host, opts) {
|
||||
super(host);
|
||||
|
||||
this.posTracker = null;
|
||||
this.onParseError = opts.onParseError;
|
||||
}
|
||||
|
||||
_setErrorLocation(err) {
|
||||
err.startLine = err.endLine = this.posTracker.line;
|
||||
err.startCol = err.endCol = this.posTracker.col;
|
||||
err.startOffset = err.endOffset = this.posTracker.offset;
|
||||
}
|
||||
|
||||
_reportError(code) {
|
||||
const err = {
|
||||
code: code,
|
||||
startLine: -1,
|
||||
startCol: -1,
|
||||
startOffset: -1,
|
||||
endLine: -1,
|
||||
endCol: -1,
|
||||
endOffset: -1
|
||||
};
|
||||
|
||||
this._setErrorLocation(err);
|
||||
this.onParseError(err);
|
||||
}
|
||||
|
||||
_getOverriddenMethods(mxn) {
|
||||
return {
|
||||
_err(code) {
|
||||
mxn._reportError(code);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = ErrorReportingMixinBase;
|
||||
Reference in New Issue
Block a user