The name of a method whose key is a symbol

2015-09-10 Thread Axel Rauschmayer
This is the behavior defined in the spec: ```js const key1 = Symbol('description'); const key2 = Symbol(); let obj = { [key1]() {}, [key2]() {}, }; console.log(obj[key1].name); // '[description]' console.log(obj[key2].name); // '' ``` I’m wondering: if a symbol has no description,

Re: The name of a method whose key is a symbol

2015-09-10 Thread Andrea Giammarchi
being a function name I rather wonder if it wouldn't be better to have `'description'` without square brackets ... to be consistent with the fact the Symbol has no name. If that's instead a way specified as such in order to understand that is a Symbol then I agree, for consistency, it should have