ERR_INVALID_THIS


使用不兼容的 this 值调用了 Node.js API 函数

const urlSearchParams = new URLSearchParams('foo=bar&baz=new');

const buf = Buffer.alloc(1);
urlSearchParams.has.call(buf, 'foo');
// 抛出使用代码 'ERR_INVALID_THIS' 的 TypeError

A Node.js API function was called with an incompatible this value.

const urlSearchParams = new URLSearchParams('foo=bar&baz=new');

const buf = Buffer.alloc(1);
urlSearchParams.has.call(buf, 'foo');
// Throws a TypeError with code 'ERR_INVALID_THIS'