Re: LR(1) grammar/parser and lookahead-restrictions

2017-01-23 Thread Waldemar Horwat
On 01/11/2017 10:28, Michael Dyck wrote: In the past, it has been said (usually by Brendan Eich) that TC39 intends that the ECMAScript grammar be LR(1). Is that still the case? (I'm not so much asking about the "1", but more about the "LR".) If so, I'm wondering how lookahead-restrictions

Re: Determining if an object can be constructed

2017-01-23 Thread MichaƂ Wadas
Actually it's possible to create pretty good heuristics to decide if it's possible to call function as constructor, but there is no way to be sure it's really safe. On Mon, Jan 23, 2017 at 7:49 PM, Jordan Harband wrote: > Unfortunately, the only practical way to know that

Re: Determining if an object can be constructed

2017-01-23 Thread Jordan Harband
Unfortunately, the only practical way to know that without risking side effects is to read the human-produced documentation on the function, or to have a human read the code. On Mon, Jan 23, 2017 at 8:19 AM, Isiah Meadows wrote: > I'll point out that all I need is some

Re: Determining if an object can be constructed

2017-01-23 Thread Isiah Meadows
I'll point out that all I need is some way to detect anything that is callable except for classes. Basically, anything that has a `[[Call]]` that doesn't throw unconditionally without entering a different scope (like classes, but not %ThrowTypeError%). And to clarify, these would both be included