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

v6 version of V8 has bad for-in implementation #8133

Closed
deian opened this issue Aug 17, 2016 · 3 comments
Closed

v6 version of V8 has bad for-in implementation #8133

deian opened this issue Aug 17, 2016 · 3 comments
Labels
v8 engine Issues and PRs related to the V8 dependency.

Comments

@deian
Copy link
Member

deian commented Aug 17, 2016

  • Version: 6.3.1 and 6.4
  • Platform: Arch Linux x86_64
  • Subsystem:

Seems like the version of V8 that node v6 is using has a somewhat nasty for-in bug (that didn't exist in v4). Specifically, for ... in on proxy objects does not enumerate properties that are on the prototype:

'use strict';
function Obj() {
  this.a = 1337;
}
Obj.prototype.func = function () {
  return 'w00t';
};

const obj = new Obj();

const obj_props = [];
for (let i in obj) {
  obj_props.push(i);
}

const pobj = new Proxy(obj, {});
const pobj_props = [];
for (let i in pobj) {
  pobj_props.push(i);
}

console.log(obj_props.sort()); // [ 'a', 'func' ]
console.log(pobj_props.sort()); // [ 'a' ]

This was fixed in V8 here: https://codereview.chromium.org/1516843002
A related problem also fixed in a more V8 version: https://bugs.chromium.org/p/v8/issues/detail?id=5174

There were not really an issue in node v4 because of the old proxy implementation. My apologies if this is something you've already looked into or not the right way to report this.

@Fishrock123 Fishrock123 added the v8 engine Issues and PRs related to the V8 dependency. label Aug 17, 2016
@Fishrock123
Copy link
Contributor

cc @nodejs/v8

@matthewloring
Copy link

I just gave this a run with V8 5.1 and it appears to be fixed. Once #8054 lands the fix should make it into v6.

@targos
Copy link
Member

targos commented Sep 12, 2016

The bug is fixed in v6.5.0. Closing.

@targos targos closed this as completed Sep 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v8 engine Issues and PRs related to the V8 dependency.
Projects
None yet
Development

No branches or pull requests

4 participants