mirror of
https://github.com/nodejs/node.git
synced 2025-08-15 21:58:48 +02:00
lib: remove startsWith/endsWith primordials for char checks
PR-URL: https://github.com/nodejs/node/pull/55407 Reviewed-By: Jacob Smith <jacob@frende.me> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Mattias Buelens <mattias@buelens.com> Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
This commit is contained in:
parent
6e3e99c81e
commit
753cbede2a
11 changed files with 17 additions and 22 deletions
|
@ -202,7 +202,7 @@ function addBuiltinLibsToObject(object, dummyModuleName) {
|
|||
ArrayPrototypeForEach(builtinModules, (name) => {
|
||||
// Neither add underscored modules, nor ones that contain slashes (e.g.,
|
||||
// 'fs/promises') or ones that are already defined.
|
||||
if (StringPrototypeStartsWith(name, '_') ||
|
||||
if (name[0] === '_' ||
|
||||
StringPrototypeIncludes(name, '/') ||
|
||||
ObjectPrototypeHasOwnProperty(object, name)) {
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue