On Sun, May 27, 2012 at 10:09 PM, Allen Wirfs-Brock
<[email protected]> wrote:
...
>>> First rule of strict mode:  "use strict" only affects code that is lexically
>>> within the scope of the directive.  It has no global effect.
>>
>> My example contradicts this claim.
>
> No, read the spec.  You seem to be perceiving something different than what 
> is actually occurring.

Yes perception is exactly what I am talking about: the perception of 1JS.

Step back from the spec for a second and look at what is actually occurring.

A library writer creates an object in one scope and all of their tests
succeed. I use it another scope and my code fails.  We are both using
legal statements. How can this not be a global effect?

Now I grant you that this effect is not an operation of the compiler
or runtime. Rather the effect here is that the library writer is
operating under one perception of 1JS and I am operating under another
perception of 1JS. Both of our perceptions are 100% valid. Ergo we do
not have 1JS.

>>
>>>
>>>
>>> If 'mashing up' is similar to 'using objects from a library', then
>>> isn't JS-mashed-with-SES (whatever that means) a different version of
>>> JS?
>>>
>>>
>>> Yes...no...when passing object into any library you need to be aware of the
>>> library's expectations for those objects.  It should be part of the
>>> documented interface contract for the library. strict/non-strict, SES or
>>> plain old JS, garbage in usually results in garbage out
>>
>> In this case the library provides the objects. Of course your truism
>> applies, but to me, objects with silent new behavior should not be a
>> matter of documentation.
>
> that would be an alternative design (for the non-extensible case of trying to 
> add a new property) but it's not the design that was chosen for ES5.  Whether 
> you like or dislike the that choice, it's water under the bridge.

Exactly why I brought up this subject when I saw SES+non-SES: I don't
want more water under this bridge.  I dislike object.freeze()
altogether, not because it's a bad idea but because it's not a
JavaScript idea. But I didn't realize how truly horrible it was until
I discovered that it is silent and that silence is modal.

Perhaps that mistake is done. Let's not have another. Let's have 1JS.
Not 1JS with modes or 1JS with environments, just 1JS.

jjb
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to