/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
async function get_command_function(cmd, commands) { /* Converts a string such as `measure.start` into the actual function that is found in the `commands` module.
XXX: Find a way to share this function between perftest_record.js and browsertime_interactive.js
*/ if (cmd == "") { thrownew Error("A blank command was given.");
} elseif (cmd.endsWith(".")) { thrownew Error( "An extra `.` was found at the end of this command: " + cmd
);
}
// `func` will hold the actual method that needs to be called, // and the `parent_mod` is the context required to run the `func` // method. Without that context, `this` becomes undefined in the browsertime // classes.
let func = null;
let parent_mod = null; for (let func_part of cmd.split(".")) { if (func_part == "") { thrownew Error( "An empty function part was found in the command: " + cmd
);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.