On Jul 26, 2015, at 1:17 PM, Jordan Harband wrote: > What is the function's name if the computed object literal key is a Symbol? > ie, what does the following output:
specified in step 4 of http://ecma-international.org/ecma-262/6.0/#sec-setfunctionname > > ```js > const sym = Symbol('something'); > const o = { > [sym] () {} > }; > console.log(o[sym].name); > ``` should be: "[something]" > > Currently it appears Babel outputs an empty string for this case. > > If the current spec handles symbols just fine in this way, why would "the > possibility that the property key is a symbol" be a reason for an expression > form not to set the "name" property? Yes, the ES2015 spec. does say how to handle Symbols as `name` property values. Allen
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

