Demo/bin/Debug/front_end/common/OutputStream.js

(完整代码) 1009B

// Copyright 2015 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.

/**
 * @interface
 */
WebInspector.OutputStream = function()
{
}

WebInspector.OutputStream.prototype = {
    /**
     * @param {string} data
     * @param {function(!WebInspector.OutputStream)=} callback
     */
    write: function(data, callback) { },

    close: function() { }
}

/**
 * @constructor
 * @implements {WebInspector.OutputStream}
 */
WebInspector.StringOutputStream = function()
{
    this._data = "";
}

WebInspector.StringOutputStream.prototype = {
    /**
     * @override
     * @param {string} chunk
     * @param {function(!WebInspector.OutputStream)=} callback
     */
    write: function(chunk, callback)
    {
        this._data += chunk;
    },

    /**
     * @override
     */
    close: function()
    {
    },

    /**
     * @return {string}
     */
    data: function()
    {
        return this._data;
    }
}

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。