mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
tools: fix bug in prefer-primordials lint rule
PR-URL: https://github.com/nodejs/node/pull/46659 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This commit is contained in:
@@ -57,7 +57,9 @@ new RuleTester({
|
||||
{
|
||||
code: `
|
||||
const { ObjectDefineProperty, Symbol } = primordials;
|
||||
ObjectDefineProperty(o, Symbol.toStringTag, { value: "o" })
|
||||
ObjectDefineProperty(o, Symbol.toStringTag, { value: "o" });
|
||||
const val = Symbol.toStringTag;
|
||||
const { toStringTag } = Symbol;
|
||||
`,
|
||||
options: [{ name: 'Symbol', ignore: ['toStringTag'] }]
|
||||
},
|
||||
|
||||
@@ -114,7 +114,7 @@ module.exports = {
|
||||
node,
|
||||
);
|
||||
const parentName = parent?.name;
|
||||
if (!isTarget(nameMap, name) && !isTarget(nameMap, parentName)) {
|
||||
if (!isTarget(nameMap, name) && (!isTarget(nameMap, parentName) || isIgnored(nameMap, parentName, name))) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user