Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-export issue with hasOwnProperty. #3197

Closed
vilicvane opened this issue May 18, 2015 · 1 comment · Fixed by #39537
Closed

Re-export issue with hasOwnProperty. #3197

vilicvane opened this issue May 18, 2015 · 1 comment · Fixed by #39537
Labels
Won't Fix The severity and priority of this issue do not warrant the time or complexity needed to fix it

Comments

@vilicvane
Copy link
Contributor

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];
}
@RyanCavanaugh RyanCavanaugh added the Won't Fix The severity and priority of this issue do not warrant the time or complexity needed to fix it label May 18, 2015
@RyanCavanaugh
Copy link
Member

If anyone actually creates a property called hasOwnProperty, I have to assume they understand the implications and have implemented it in some reasonable way.

@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Won't Fix The severity and priority of this issue do not warrant the time or complexity needed to fix it
Projects
None yet
2 participants