mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-10-05 03:21:16 +08:00
Also update the PRESUBMIT linter configuration to make sure it actually runs the linter when updating ESLint. Otherwise, it would not properly do the full linter check. R=jacktfranklin@chromium.org DISABLE_THIRD_PARTY_CHECK=Update ESLint Bug: 1068145 Change-Id: Ibf2de156366dc64c90ee1aced5537d2038e7a268 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2137384 Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org> Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
43 lines
1.1 KiB
JavaScript
43 lines
1.1 KiB
JavaScript
/**
|
|
* @fileoverview Define the cursor which ignores the first few tokens.
|
|
* @author Toru Nagashima
|
|
*/
|
|
"use strict";
|
|
|
|
//------------------------------------------------------------------------------
|
|
// Requirements
|
|
//------------------------------------------------------------------------------
|
|
|
|
const DecorativeCursor = require("./decorative-cursor");
|
|
|
|
//------------------------------------------------------------------------------
|
|
// Exports
|
|
//------------------------------------------------------------------------------
|
|
|
|
/**
|
|
* The decorative cursor which ignores the first few tokens.
|
|
*/
|
|
module.exports = class SkipCursor extends DecorativeCursor {
|
|
|
|
/**
|
|
* Initializes this cursor.
|
|
* @param {Cursor} cursor The cursor to be decorated.
|
|
* @param {number} count The count of tokens this cursor skips.
|
|
*/
|
|
constructor(cursor, count) {
|
|
super(cursor);
|
|
this.count = count;
|
|
}
|
|
|
|
/** @inheritdoc */
|
|
moveNext() {
|
|
while (this.count > 0) {
|
|
this.count -= 1;
|
|
if (!super.moveNext()) {
|
|
return false;
|
|
}
|
|
}
|
|
return super.moveNext();
|
|
}
|
|
};
|