Skip to content

Use hasOwnProperty throughout the code #1792

Closed
@DHainzl

Description

@DHainzl

Hi there,

I just upgraded less from 1.4.1 to 1.6.0 and it did not work immediately. In my environment, the Array.prototype was extended with a "unique" function, which resulted in a lot of error messages, for example in those two lines (in the compiled less-1.6.0.js):

:1956 name[k].charAt is not a function -> name["unique"] did not exists
:4424 "mixin" is not defined -> source was loop in :4417 and then access to candidates["unique"]

Adding

if (Object.prototype.hasOwnProperty.call(name, k)) { /* ... */ }

to all for ... in loops made it work for me.

Yours, David

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions