David Bruant wrote:
Le 28/05/2012 01:37, John J Barton a écrit :
On Thu, May 24, 2012 at 11:10 AM, Brendan Eich<[email protected]>
wrote:
David Bruant wrote:
Once we're at it, for the sake of completeness there is probably no
harm
in adding a Reflect.setPrototype at this point, is there?
There is, just as there's a cost to Object.setPrototypeOf (the
obvious place
to put it to match Object.getPrototypeOf from ES5). Mark pointed out
that
he'd have to delete that static method too, and from every frame
that might
run SES code. But when mashing up SES and non-SES code, it would be
better
not to break the non-SES code by such deletion.
Having only the SES environment's Object.prototype.__proto__ to
delete is
better.
How is this this line of reasoning -- which I read as 'support for
SES-environments and non-SES-environments' -- not violating 1JS?
My answer would be "it is" in the sense that SES is a subset of
JavaScript.
Sorry, no. Version opt-in != subset. There is a very large number of
subsets of any single version of JS. 1JS is about not requiring you to say
<script type="application/ecmascript;version=6">...</script>
or
use version 6;
or any such thing in order to use new syntax.
Very much like Joe-E for Java (I recommand to read the related paper
[1]). But the subset is something really usable.
Usability is not relevant to the question of whether subsets violate
1JS. Subsets do not violate 1JS. Even a subset that the spec and harmony
goals explicitly identity (informally) as to be supported does not
create version opt-in.
John then went on to ask about Object.freeze but that affects object and
property attributes, which are heap not code as Allen points out. They
do not create version opt-in mandates either.
Yes, people writing libraries have to take care what they produce and
consume. No, this isn't version opt-in.
/be
It's also more about programmer discipline than a new programming
language itself.
David
[1] http://www.cs.berkeley.edu/~daw/papers/joe-e-ndss10.pdf
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss