Skip to content

Instantly share code, notes, and snippets.

@bterlson
Created January 29, 2016 19:46
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 bterlson/893619d0766008e93885 to your computer and use it in GitHub Desktop.
Save bterlson/893619d0766008e93885 to your computer and use it in GitHub Desktop.
for-in reconfigure

Test file

let obj = {};
Object.defineProperty(obj, 'a', { enumerable: true, configurable: true });
Object.defineProperty(obj, 'b', { enumerable: true, configurable: true });
Object.defineProperty(obj, 'c', { enumerable: true, configurable: true });

let visited = []
for(prop in obj) {
  Object.defineProperty(obj, 'c', { enumerable: false });
  visited.push(prop);
}

print(visited.join(", "));

sm

a, b, c

d8

a, b, c

chakra

a, b

@bterlson
Copy link
Author

Can someone get me JSC results for this test? :)

@erights
Copy link

erights commented Jan 29, 2016

JSC on WebKit Nightly 9.0.3 (11601.4.4, r195810) gives

a, b, c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment