google / traceur-compiler

Traceur is a JavaScript.next-to-JavaScript-of-today compiler
Apache License 2.0
8.18k stars 578 forks source link

Conditionally override functions for Symbols #2019

Closed arv closed 8 years ago

arv commented 8 years ago

Only conditionally override Object.keys and Object.getOwnPropertyNames if there is no native support for Symbol.

Private names are now done using a symbol. This symbol gets added to an object as map so that we can filter these out when someone does Object.getOwnPropertySymbols.

We always override Object.getOwnPropertySymbols since we now use symbols for private state.

Fixes #1993

arv commented 8 years ago

The first two commits are from #2014 and #2018. Only the last commit is relevant for this PR.

I tried this with deleting all Symbol related functions from the global.

johnjbarton commented 8 years ago

LGTM

johnjbarton commented 8 years ago

Sorry, that was due to changes on my branch. I needed to include runtime/runtime.js as ES5, which used to work. I'll look into it.