source: trip-planner-front/node_modules/parse5/lib/extensions/error-reporting/preprocessor-mixin.js@ ceaed42

Last change on this file since ceaed42 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 800 bytes
Line 
1'use strict';
2
3const ErrorReportingMixinBase = require('./mixin-base');
4const PositionTrackingPreprocessorMixin = require('../position-tracking/preprocessor-mixin');
5const Mixin = require('../../utils/mixin');
6
7class ErrorReportingPreprocessorMixin extends ErrorReportingMixinBase {
8 constructor(preprocessor, opts) {
9 super(preprocessor, opts);
10
11 this.posTracker = Mixin.install(preprocessor, PositionTrackingPreprocessorMixin);
12 this.lastErrOffset = -1;
13 }
14
15 _reportError(code) {
16 //NOTE: avoid reporting error twice on advance/retreat
17 if (this.lastErrOffset !== this.posTracker.offset) {
18 this.lastErrOffset = this.posTracker.offset;
19 super._reportError(code);
20 }
21 }
22}
23
24module.exports = ErrorReportingPreprocessorMixin;
Note: See TracBrowser for help on using the repository browser.