Skip to content

Re-export issue with hasOwnProperty. #3197

Closed
@vilicvane

Description

@vilicvane

It would be an issue if there is a method exported from the current module named hasOwnProperty:

function __export(m) {
    for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}

Personally I would write it as:

function __export(m) {
    var hasOwnProperty = Object.prototype.hasOwnProperty;
    for (var p in m) if (!hasOwnProperty.call(exports, p)) exports[p] = m[p];
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Won't FixThe severity and priority of this issue do not warrant the time or complexity needed to fix it

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions