refactor: replace Object.prototype.hasOwnProperty() with Object.hasOwn() (#38929)
This commit is contained in:
parent
09669f9d21
commit
607e71d563
11 changed files with 13 additions and 17 deletions
|
@ -55,7 +55,7 @@ class RemoteControlApp {
|
|||
res.on('data', chunk => { chunks.push(chunk); });
|
||||
res.on('end', () => {
|
||||
const ret = v8.deserialize(Buffer.concat(chunks));
|
||||
if (Object.prototype.hasOwnProperty.call(ret, 'error')) {
|
||||
if (Object.hasOwn(ret, 'error')) {
|
||||
reject(new Error(`remote error: ${ret.error}\n\nTriggered at:`));
|
||||
} else {
|
||||
resolve(ret.result);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue