зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1613845 - Remove print helper. r=jdescottes.
Differential Revision: https://phabricator.services.mozilla.com/D61989 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
508f06dae3
Коммит
bf5973a454
|
@ -656,11 +656,8 @@ function bindCommands(isCmd, dbgWindow, bindSelf, frame, helpers) {
|
|||
}
|
||||
// Check if the Debugger.Frame or Debugger.Object for the global include any of the
|
||||
// helper function we set. We will not overwrite these functions with the Web Console
|
||||
// commands. The exception being "print" which should exist everywhere as
|
||||
// `window.print`, and that we don't want to trigger from the console.
|
||||
const availableHelpers = [
|
||||
...WebConsoleCommands._originalCommands.keys(),
|
||||
].filter(h => h !== "print");
|
||||
// commands.
|
||||
const availableHelpers = [...WebConsoleCommands._originalCommands.keys()];
|
||||
|
||||
let helpersToDisable = [];
|
||||
const helperCache = {};
|
||||
|
|
|
@ -599,25 +599,6 @@ WebConsoleCommands._registerOriginal("inspect", function(
|
|||
};
|
||||
});
|
||||
|
||||
/**
|
||||
* Print the String representation of a value to the output, as-is.
|
||||
*
|
||||
* @param any value
|
||||
* A value you want to output as a string.
|
||||
* @return void
|
||||
*/
|
||||
WebConsoleCommands._registerOriginal("print", function(owner, value) {
|
||||
owner.helperResult = { rawOutput: true };
|
||||
if (typeof value === "symbol") {
|
||||
return Symbol.prototype.toString.call(value);
|
||||
}
|
||||
// Waiving Xrays here allows us to see a closer representation of the
|
||||
// underlying object. This may execute arbitrary content code, but that
|
||||
// code will run with content privileges, and the result will be rendered
|
||||
// inert by coercing it to a String.
|
||||
return String(Cu.waiveXrays(value));
|
||||
});
|
||||
|
||||
/**
|
||||
* Copy the String representation of a value to the clipboard.
|
||||
*
|
||||
|
|
Загрузка…
Ссылка в новой задаче