Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
test: avoid using Object.prototype methods directly on objects
This prepares us to enable the no-prototype-builtins ESLint rule.

Refs: https://eslint.org/docs/rules/no-prototype-builtins
  • Loading branch information
Trott committed Jan 31, 2022
commit 6b81361e0d572c33d5454808950700f842eb0634
2 changes: 1 addition & 1 deletion test/parallel/test-console-group.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ function teardown() {
// Check that the kGroupIndent symbol property is not enumerable
{
const keys = Reflect.ownKeys(console)
.filter((val) => console.propertyIsEnumerable(val))
.filter((val) => Object.prototype.propertyIsEnumerable.call(console, val))
.map((val) => val.toString());
assert(!keys.includes('Symbol(groupIndent)'),
'groupIndent should not be enumerable');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ const { internalBinding } = require('internal/test/binding');
const TTY = internalBinding('tty_wrap').TTY;

{
assert.strictEqual(TTY.prototype.propertyIsEnumerable('bytesRead'), false);
assert.strictEqual(TTY.prototype.propertyIsEnumerable('fd'), false);
assert.strictEqual(
TTY.prototype.propertyIsEnumerable('_externalStream'), false);
const ttyIsEnumerable = Object.prototype.propertyIsEnumerable.bind(TTY);
assert.strictEqual(ttyIsEnumerable('bytesRead'), false);
assert.strictEqual(ttyIsEnumerable('fd'), false);
assert.strictEqual(ttyIsEnumerable('_externalStream'), false);
}