Sha256: 001371805a0d719e728d4b46a43401c33547016c23ccbf005248ad6e0976c94b

Contents?: true

Size: 970 Bytes

Versions: 22

Compression:

Stored size: 970 Bytes

Contents

'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;

Version data entries

22 entries across 22 versions & 2 rubygems

Version Path
appmap-0.72.2 ./node_modules/parse5/lib/extensions/error-reporting/mixin-base.js
appmap-0.72.1 ./node_modules/parse5/lib/extensions/error-reporting/mixin-base.js
appmap-0.72.0 ./node_modules/parse5/lib/extensions/error-reporting/mixin-base.js
appmap-0.71.0 ./node_modules/parse5/lib/extensions/error-reporting/mixin-base.js
appmap-0.70.2 ./node_modules/parse5/lib/extensions/error-reporting/mixin-base.js
appmap-0.70.1 ./node_modules/parse5/lib/extensions/error-reporting/mixin-base.js
appmap-0.70.0 ./node_modules/parse5/lib/extensions/error-reporting/mixin-base.js
appmap-0.69.0 ./node_modules/parse5/lib/extensions/error-reporting/mixin-base.js
appmap-0.68.2 ./node_modules/parse5/lib/extensions/error-reporting/mixin-base.js
appmap-0.68.1 ./node_modules/parse5/lib/extensions/error-reporting/mixin-base.js
appmap-0.68.0 ./node_modules/parse5/lib/extensions/error-reporting/mixin-base.js
appmap-0.67.1 ./node_modules/parse5/lib/extensions/error-reporting/mixin-base.js
appmap-0.67.0 ./node_modules/parse5/lib/extensions/error-reporting/mixin-base.js
appmap-0.66.2 ./node_modules/parse5/lib/extensions/error-reporting/mixin-base.js
appmap-0.66.1 ./node_modules/parse5/lib/extensions/error-reporting/mixin-base.js
appmap-0.66.0 ./node_modules/parse5/lib/extensions/error-reporting/mixin-base.js
appmap-0.65.1 ./node_modules/parse5/lib/extensions/error-reporting/mixin-base.js
appmap-0.65.0 ./node_modules/parse5/lib/extensions/error-reporting/mixin-base.js
appmap-0.64.0 ./node_modules/parse5/lib/extensions/error-reporting/mixin-base.js
appmap-0.63.0 ./node_modules/parse5/lib/extensions/error-reporting/mixin-base.js