Skip to content

Commit f9d0f54

Browse files
committed
Fix no-prototype-builtins issue in Ruleset variables()
1 parent 53f84f0 commit f9d0f54

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/less/src/less/tree/ruleset.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -295,8 +295,7 @@ Ruleset.prototype = Object.assign(new Node(), {
295295
if (r.type === 'Import' && r.root && r.root.variables) {
296296
const vars = r.root.variables();
297297
for (const name in vars) {
298-
// eslint-disable-next-line no-prototype-builtins
299-
if (vars.hasOwnProperty(name)) {
298+
if (Object.prototype.hasOwnProperty.call(vars, name)) {
300299
hash[name] = r.root.variable(name);
301300
}
302301
}

packages/test-data/less/_main/rulesets.less

+1
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,5 @@
2727
}
2828
}
2929
font-size: 2em;
30+
hasOwnProperty: blue;
3031
}

0 commit comments

Comments
 (0)