Last change
on this file 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 |
|
---|
3 | const ErrorReportingMixinBase = require('./mixin-base');
|
---|
4 | const PositionTrackingPreprocessorMixin = require('../position-tracking/preprocessor-mixin');
|
---|
5 | const Mixin = require('../../utils/mixin');
|
---|
6 |
|
---|
7 | class 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 |
|
---|
24 | module.exports = ErrorReportingPreprocessorMixin;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.