How can a lexer decide a token to be "get", "IdentifierName" or "Identifier" ?
Allen Wirfs-Brock
allen at wirfs-brock.com
Tue Feb 5 09:25:27 PST 2013
Right, I think "mixin" is winning over "define" as the name. Same semantics in either case.
Allen
On Feb 5, 2013, at 9:03 AM, Rick Waldron wrote:
>
>
>
> On Tue, Feb 5, 2013 at 11:55 AM, Brandon Benvie <brandon at brandonbenvie.com> wrote:
> Indeed, and given use of ES6, I expect things like this wouldn't be very uncommon (I think is supposed to be Object.define right?):
>
> Nothing there yet, though I suspect Object.mixin() will have more traction.
>
> https://mail.mozilla.org/pipermail/es-discuss/2012-December/027037.html
>
> Rick
>
>
> Object.define(x, {
> get a(){},
> set a(v){},
> get b(){},
> c(){}
> });
>
> Instead of most current descriptor stuff (since enumerability and configurability are rarely desired to be false).
>
>
> On Tuesday, February 5, 2013, Rick Waldron wrote:
>
>
>
> On Tue, Feb 5, 2013 at 3:19 AM, gaz Heyes <gazheyes at gmail.com> wrote:
> On 4 February 2013 23:44, Brendan Eich <brendan at mozilla.com> wrote:
> What's confusing?
>
> The fact that you can have an object property without a colon and a function without a function keyword.
>
> ES6 concise methods will make this the norm:
>
> let o = {
> meaning() {
> return 42;
> }
> };
>
> o.meaning(); // 42
>
>
> Then a property descriptor uses a completely new syntax to define the same thing. Why?
> Object.defineProperty(window,'x',{set:alert});
> x=1;
>
>
> What part is "new syntax"? Property descriptors are just object literal syntax—did you mean "different syntax"?
>
>
>
> To me this seems hacked together.
>
> ({'get'x(){return 123;}}).x
>
> That's not legal ES5.
>
> Some engines support it though and I'm pretty sure Firefox did at some point.
>
> I think Brendan was referring to the quotes, ie. 'get'. Remove those for legal syntax:
>
> ({ get x() { return 123; } }).x
>
>
> Rick
>
>
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130205/255510b2/attachment-0001.html>
More information about the es-discuss
mailing list