Bug 1196089 - Treat script sources introduced by DOM timers as anonymous. r=davidwalsh

Differential Revision: https://phabricator.services.mozilla.com/D83410
This commit is contained in:
Logan Smyth 2020-07-14 15:03:53 +00:00
Родитель d1c3302aa9
Коммит 283fb0d42d
4 изменённых файлов: 4 добавлений и 5 удалений

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

@ -26,8 +26,7 @@ function getDebuggerSourceURL(source) {
introType === "debugger eval" ||
introType === "Function" ||
introType === "eventHandler" ||
introType === "setTimeout" ||
introType === "setInterval"
introType === "domTimer"
) {
return null;
}

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

@ -5744,6 +5744,7 @@ bool WindowScriptTimeoutHandler::Call(const char* aExecutionReason) {
JS::CompileOptions options(aes.cx());
options.setFileAndLine(mFileName.get(), mLineNo);
options.setNoScriptRval(true);
options.setIntroductionType("domTimer");
JS::Rooted<JSObject*> global(aes.cx(), mGlobal->GetGlobalJSObject());
{
nsJSUtils::ExecutionContext exec(aes.cx(), global);

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

@ -95,6 +95,7 @@ bool WorkerScriptTimeoutHandler::Call(const char* aExecutionReason) {
JSContext* cx = aes.cx();
JS::CompileOptions options(cx);
options.setFileAndLine(mFileName.get(), mLineNo).setNoScriptRval(true);
options.setIntroductionType("domTimer");
JS::Rooted<JS::Value> unused(cx);
JS::SourceText<char16_t> srcBuf;

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

@ -205,9 +205,7 @@ one of the following values:
* `"javascriptURL"`, for code presented in `javascript:` URLs.
* `"setTimeout"`, for code passed to `setTimeout` as a string.
* `"setInterval"`, for code passed to `setInterval` as a string.
* `"domTimer"`, for code passed to `setTimeout`/`setInterval` as a string.
* `undefined`, if the implementation doesn't know how the code was
introduced.