Bug 1582512 - Disable script filename validation in Browser Toolbox console debugging r=jimb

Differential Revision: https://phabricator.services.mozilla.com/D53234

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Tom Ritter 2019-12-02 15:45:57 +00:00
Родитель c9a9ab9d20
Коммит 3002020702
1 изменённых файлов: 6 добавлений и 1 удалений

Просмотреть файл

@ -861,7 +861,12 @@ static bool EvaluateInEnv(JSContext* cx, Handle<Env*> env,
options.setIsRunOnce(true)
.setNoScriptRval(false)
.setFileAndLine(filename, lineno)
.setIntroductionType("debugger eval");
.setIntroductionType("debugger eval")
/* Do not perform the Javascript filename validation security check for
* javascript executions sent through the debugger. Besides making up
* a filename for these codepaths, we must allow arbitrary JS execution
* for the Browser toolbox to function. */
.setSkipFilenameValidation(true);
if (frame && frame.hasScript() && frame.script()->strict()) {
options.setForceStrictMode();