Skip to content

Instantly share code, notes, and snippets.

@ljharb
Created February 4, 2016 06:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ljharb/8956b254bd8b7d3f4c07 to your computer and use it in GitHub Desktop.
Save ljharb/8956b254bd8b7d3f4c07 to your computer and use it in GitHub Desktop.
node 0.6-0.12 has a broken `Object.getOwnPropertyNames`
> Object.defineProperty(Object.prototype, 'a', { set: function (v) { throw new Error(v); } });
{}
> Object.getOwnPropertyNames({})
[]
> Object.getOwnPropertyNames({a: 1})
Error: true
at Object.defineProperty.set (repl:1:74)
at Function.getOwnPropertyNames (native)
at repl:1:9
at REPLServer.self.eval (repl.js:110:21)
at Interface.<anonymous> (repl.js:239:12)
at Interface.emit (events.js:95:17)
at Interface._onLine (readline.js:203:10)
at Interface._line (readline.js:532:8)
at Interface._ttyWrite (readline.js:761:14)
at ReadStream.onkeypress (readline.js:100:10)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment