@dcloudio/uni-debugger
Version:
uni-app debugger
26 lines (24 loc) • 675 B
JavaScript
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
/**
* @unrestricted
*/
FormatterWorker.IdentityFormatter = class {
/**
* @param {!FormatterWorker.FormattedContentBuilder} builder
*/
constructor(builder) {
this._builder = builder;
}
/**
* @param {string} text
* @param {!Array<number>} lineEndings
* @param {number} fromOffset
* @param {number} toOffset
*/
format(text, lineEndings, fromOffset, toOffset) {
const content = text.substring(fromOffset, toOffset);
this._builder.addToken(content, fromOffset);
}
};