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

The !(skipConstructor && name === 'constructor') should be moved into the hasDontEnumBug block. #5

Closed
jdalton opened this issue May 17, 2013 · 0 comments

Comments

@jdalton
Copy link

jdalton commented May 17, 2013

The !(skipConstructor && name === 'constructor') should be moved into the hasDontEnumBug block. And constructor should be added to the dontEnums array.

You can test this by having an object of properties, smth like I do in my own tests:

var shadowedProps = [
    'constructor',
    'hasOwnProperty',
    'isPrototypeOf',
    'propertyIsEnumerable',
    'toLocaleString',
    'toString',
    'valueOf'
  ];

  /** Used to check problem JScript properties too */
  var shadowedObject = _.invert(shadowedProps);

In older IE Object.keys(shadowedObject) should produce an array of keys that is equiv to shadowedProps. The constructor check which should be moved to the hasDontEnumBug is to ensure that the constructor property is skipped on prototype objects but not plain object literals.

ljharb added a commit that referenced this issue May 17, 2013
@ljharb ljharb closed this as completed in 3c00b6f May 18, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant