1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-10-02 23:57:10 +02:00

Do not use bind as a way to access native calls

This commit is contained in:
Raymond Hill 2023-10-29 10:22:54 -04:00
parent 3c4932e1a6
commit 5244ad5baf
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2

View File

@ -60,8 +60,11 @@ function safeSelf() {
'addEventListener': self.EventTarget.prototype.addEventListener,
'removeEventListener': self.EventTarget.prototype.removeEventListener,
'fetch': self.fetch,
'JSON_parse': self.JSON.parse.bind(self.JSON),
'JSON_stringify': self.JSON.stringify.bind(self.JSON),
'JSON': self.JSON,
'JSON_parseFn': self.JSON.parse,
'JSON_stringifyFn': self.JSON.stringify,
'JSON_parse': (...args) => safe.JSON_parseFn.call(safe.JSON, ...args),
'JSON_stringify': (...args) => safe.JSON_stringifyFn.call(safe.JSON, ...args),
'log': console.log.bind(console),
uboLog(...args) {
if ( scriptletGlobals.has('canDebug') === false ) { return; }