Fixing the associativity / precedence of the instanceof operator

Barronville, Jonathan jonathan at belairlabs.com
Tue Aug 26 02:54:16 PDT 2014


I’m on the same page as Charles. I feel like it should be okay to fix something like this … at least in strict mode. Or introduce a tiny bit of new grammar supporting something like `foo ! instanceof Foo` (or `foo not instanceof Foo`) maybe?


- Jonathan

—

Sent from Mailbox

On Tue, Aug 26, 2014 at 5:48 AM, Charles Pick <charles at codemix.com> wrote:

> Ok, what if `!foo instanceof Foo` became a strict mode error instead?
> On Mon, Aug 25, 2014 at 12:08 PM, Till Schneidereit <
> till at tillschneidereit.net> wrote:
>> On Mon, Aug 25, 2014 at 1:01 PM, Charles Pick <charles at codemix.com> wrote:
>>
>>> I agree that this could cause some problems, however, that code has never
>>> been correct in the first place. It's the equivalent of writing `if (false)
>>> {...}`. Seems like it's reasonable to fix something if it only has an
>>> impact on code which is already broken.
>>>
>>
>> The logic might be broken, yes, but the application's observable behavior
>> might not. At least not so much as to make the application unusable. E.g.,
>> an application might turn from always showing some info where the developer
>> intended it to not be shown under exceptional circumstances to never
>> showing it. A form might go from always marking a field as valid to never
>> doing so, making it impossible to commit and the application unusable in
>> its entirety.
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20140826/3f56a8c1/attachment.html>


More information about the es-discuss mailing list