When calling console set `this` value

Summary:
When calling the original console methods we should set this to the value of the original console. Otherwise this can lead to different behaviour between when the debugger is enabled or not.

Changelog: [Internal]

Reviewed By: mhorowitz

Differential Revision: D25367929

fbshipit-source-id: 0a7b65e501d4460d5e09a7ccd3c38ef61fbd2ef0
This commit is contained in:
Martin Sherburn 2020-12-08 09:53:13 -08:00 коммит произвёл Facebook GitHub Bot
Родитель f96478778c
Коммит b26a9549ce
1 изменённых файлов: 1 добавлений и 1 удалений

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

@ -185,7 +185,7 @@ void Inspector::installConsoleFunction(
auto obj = val.getObject(runtime);
if (obj.isFunction(runtime)) {
auto func = obj.getFunction(runtime);
func.call(runtime, args, count);
func.callWithThis(runtime, *originalConsole, args, count);
}
}
}