On 3 October 2012 05:38, Brendan Eich bren...@mozilla.com wrote:
Which is more important, iterating over holes (preserved if possible), or
skipping them and therefore spreading array-likes but not iterables?
I, for one, couldn't care less about holes. We shouldn't compromise
any useful feature
Hello,
now that we have symbols (and use some of them language-wise, like
@iterator or proposed @toStringTag), I'd say we can probably dissect
[[Call]] and [[Construct]] semantics fairly easily. Assuming there are
global constant symbols @construct and @call, for min-max classes the
issue is
On Wed, Oct 3, 2012 at 3:47 AM, Jussi Kalliokoski
jussi.kallioko...@gmail.com wrote:
On Wed, Oct 3, 2012 at 10:24 AM, Andreas Rossberg rossb...@google.comwrote:
On 3 October 2012 05:38, Brendan Eich bren...@mozilla.com wrote:
Which is more important, iterating over holes (preserved if
Dean Landolt wrote:
On Wed, Oct 3, 2012 at 3:47 AM, Jussi Kalliokoski
jussi.kallioko...@gmail.com mailto:jussi.kallioko...@gmail.com wrote:
On Wed, Oct 3, 2012 at 10:24 AM, Andreas Rossberg
rossb...@google.com mailto:rossb...@google.com wrote:
On 3 October 2012 05:38,
On Wed, Oct 3, 2012 at 3:24 AM, Andreas Rossberg rossb...@google.com wrote:
On 3 October 2012 05:38, Brendan Eich bren...@mozilla.com wrote:
Which is more important, iterating over holes (preserved if possible), or
skipping them and therefore spreading array-likes but not iterables?
I, for
On Wed, Oct 3, 2012 at 10:47 AM, Erik Arvidsson erik.arvids...@gmail.comwrote:
On Wed, Oct 3, 2012 at 3:24 AM, Andreas Rossberg rossb...@google.com
wrote:
On 3 October 2012 05:38, Brendan Eich bren...@mozilla.com wrote:
Which is more important, iterating over holes (preserved if possible),
Rick Waldron wrote:
On Wed, Oct 3, 2012 at 10:47 AM, Erik Arvidsson
erik.arvids...@gmail.com mailto:erik.arvids...@gmail.com wrote:
On Wed, Oct 3, 2012 at 3:24 AM, Andreas Rossberg
rossb...@google.com mailto:rossb...@google.com wrote:
On 3 October 2012 05:38, Brendan Eich
Dean Landolt wrote:
On Wed, Oct 3, 2012 at 3:47 AM, Jussi Kalliokoski
jussi.kallioko...@gmail.com mailto:jussi.kallioko...@gmail.com wrote:
On Wed, Oct 3, 2012 at 10:24 AM, Andreas Rossberg
rossb...@google.com mailto:rossb...@google.com wrote:
On 3 October 2012 05:38, Brendan
On Wed, Oct 3, 2012 at 9:47 AM, Erik Arvidsson erik.arvids...@gmail.com wrote:
On Wed, Oct 3, 2012 at 3:24 AM, Andreas Rossberg rossb...@google.com wrote:
On 3 October 2012 05:38, Brendan Eich bren...@mozilla.com wrote:
Which is more important, iterating over holes (preserved if possible), or
A couple observations:
1) this whole issue is only relevant if you actually have array objects
containing holes. Special treat for sparse arrays doesn't hurt anybody (other
than implementors) who doesn't use them.
2) If we (and the broader developer community) don't like sparse behavior
On Oct 3, 2012, at 7:47 AM, Erik Arvidsson wrote:
On Wed, Oct 3, 2012 at 3:24 AM, Andreas Rossberg rossb...@google.com wrote:
On 3 October 2012 05:38, Brendan Eich bren...@mozilla.com wrote:
Which is more important, iterating over holes (preserved if possible), or
skipping them and therefore
Allen Wirfs-Brock wrote:
On Oct 3, 2012, at 7:47 AM, Erik Arvidsson wrote:
On Wed, Oct 3, 2012 at 3:24 AM, Andreas Rossbergrossb...@google.com wrote:
On 3 October 2012 05:38, Brendan Eichbren...@mozilla.com wrote:
Which is more important, iterating over holes (preserved if possible), or
Jason Orendorff wrote:
On Wed, Oct 3, 2012 at 9:47 AM, Erik Arvidssonerik.arvids...@gmail.com wrote:
On Wed, Oct 3, 2012 at 3:24 AM, Andreas Rossbergrossb...@google.com wrote:
On 3 October 2012 05:38, Brendan Eichbren...@mozilla.com wrote:
Which is more important, iterating over holes
After a little more experimenting with sets (still a really big fan!!),
I've come across an interesting problem. Basically, I found myself using
a set and then wanting to convert that into JSON for storage.
JSON.stringify() run on a set returns {}, because it's an object
without any enumerable
In the talk Changes to JavaScript, Part 1: EcmaScript 5, Mark Miller
states that ES5 Default contains four static scope violations (direct link:
http://www.youtube.com/watch?v=Kq4FpMe6cRst=42m53s). He also states that
ES5 Strict corrects these violations, making ES5 Strict is a statically
scoped
On Wed, Oct 3, 2012 at 12:37 PM, Nicholas C. Zakas
standa...@nczconsulting.com wrote:
After a little more experimenting with sets (still a really big fan!!),
I've come across an interesting problem. Basically, I found myself using a
set and then wanting to convert that into JSON for storage.
Nicholas C. Zakas wrote:
After a little more experimenting with sets (still a really big fan!!),
I've come across an interesting problem. Basically, I found myself using
a set and then wanting to convert that into JSON for storage.
JSON.stringify() run on a set returns {}, because it's an
On Wed, Oct 3, 2012 at 9:37 AM, Nicholas C. Zakas
standa...@nczconsulting.com wrote:
After a little more experimenting with sets (still a really big fan!!), I've
come across an interesting problem. Basically, I found myself using a set
and then wanting to convert that into JSON for storage.
I think that what he meant is that we know for sure in which scope we can find
the property/variable. That the propery exists or not in the that scope is
another issue.
So, in the code “function getOoops(t) { t(); return function() { return ooops;
} }” we know statically that the scope where
On Wed, Oct 3, 2012 at 12:56 PM, Herby Vojčík he...@mailbox.sk wrote:
Nicholas C. Zakas wrote:
After a little more experimenting with sets (still a really big fan!!),
I've come across an interesting problem. Basically, I found myself using
a set and then wanting to convert that into JSON
This also made me wonder about Maps, if the same use case were applied -
toJSON simply wouldn't work when you have an object as a key.
The default should probably be to convert to an object who’s keys are the
results of applying String() to the map’s keys. Additionally, one could
introduce
One of the main use cases for symbols is for defining object protocols
that don't suffer from property name conflicts. The recently discussed
`iterator` and `toStringTag` method names fall into this category. The
idea is that we can implement the protocol by defining methods using
symbols, and
Another options for Maps is to represent them as an array of [key, value].
___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss
Rick Waldron wrote:
On Wed, Oct 3, 2012 at 12:56 PM, Herby Vojčík he...@mailbox.sk
mailto:he...@mailbox.sk wrote:
Nicholas C. Zakas wrote:
After a little more experimenting with sets (still a really big
fan!!),
I've come across an interesting problem.
On Wed, Oct 3, 2012 at 1:35 PM, Axel Rauschmayer a...@rauschma.de wrote:
This also made me wonder about Maps, if the same use case were applied -
toJSON simply wouldn't work when you have an object as a key.
The default should probably be to convert to an object who’s keys are the
results
On Wed, Oct 3, 2012 at 1:57 PM, Herby Vojčík he...@mailbox.sk wrote:
Rick Waldron wrote:
On Wed, Oct 3, 2012 at 12:56 PM, Herby Vojčík he...@mailbox.sk
mailto:he...@mailbox.sk wrote:
Nicholas C. Zakas wrote:
After a little more experimenting with sets (still a really big
one might consider a script provide with parse-on-use semantics
Sounds like yet another use strict to me. Experience tells that this is
not working very well. Either an optimization is worth and is enforced by
default, or it isn't used in most cases. Asking the developer to mark his
code
Rick Waldron wrote:
On Wed, Oct 3, 2012 at 1:57 PM, Herby Vojčík he...@mailbox.sk
mailto:he...@mailbox.sk wrote:
Rick Waldron wrote:
On Wed, Oct 3, 2012 at 12:56 PM, Herby Vojčík he...@mailbox.sk
mailto:he...@mailbox.sk
mailto:he...@mailbox.sk
On Wed, Oct 3, 2012 at 1:43 PM, Brandon Benvie bran...@brandonbenvie.comwrote:
Another options for Maps is to represent them as an array of [key, value].
Which is a rough approximation of what a Map looks like internally.
Again, I was more concerned with how to revive a Map and restore the
I always find it next to impossible to guess use cases for non-trivial
features. So having those would help. Often YAGNI applies. Two possibilities:
- Subtype Map and override toJSON
- Use JSON.stringify() with a replacer
As Brandon Benvie mention, we could standardize on an array of pairs, but
On Wed, Oct 3, 2012 at 2:07 PM, Herby Vojčík he...@mailbox.sk wrote:
Rick Waldron wrote:
On Wed, Oct 3, 2012 at 1:57 PM, Herby Vojčík he...@mailbox.sk
mailto:he...@mailbox.sk wrote:
Rick Waldron wrote:
On Wed, Oct 3, 2012 at 12:56 PM, Herby Vojčík he...@mailbox.sk
On Wed, Oct 3, 2012 at 2:04 PM, Rick Waldron waldron.r...@gmail.com wrote:
On Wed, Oct 3, 2012 at 1:43 PM, Brandon Benvie
bran...@brandonbenvie.comwrote:
Another options for Maps is to represent them as an array of [key, value].
Which is a rough approximation of what a Map looks like
Ah, now I get it. But isn’t that a much more general problem (dates, etc.)? You
can either come up with a general encoding or do some schema-aware
post-processing (including a JSON.parse reviver).
On Oct 3, 2012, at 20:04 , Rick Waldron waldron.r...@gmail.com wrote:
On Wed, Oct 3, 2012 at
Rick Waldron wrote:
On Wed, Oct 3, 2012 at 2:07 PM, Herby Vojčík he...@mailbox.sk
mailto:he...@mailbox.sk wrote:
Rick Waldron wrote:
On Wed, Oct 3, 2012 at 1:57 PM, Herby Vojčík he...@mailbox.sk
mailto:he...@mailbox.sk
mailto:he...@mailbox.sk
Le 03/10/2012 18:37, Nicholas C. Zakas a écrit :
(...)
Set.prototype.toJSON = function() {
return Array.from(this);
};
That way, JSON.stringify() would do something rational by default when
used with sets.
Thoughts?
Useful defaults. I love it!
David
On Wed, Oct 3, 2012 at 2:21 PM, Herby Vojčík he...@mailbox.sk wrote:
Of course, but again, I'm not sure how either of those would help
identify which:
'{ foo: [1,2,3,4,5], bar: [1,2,3,4,5] }'
...Is the Array and which is the Set
Maybe I'm still misunderstanding? If I am, I apologize
On Wed, Oct 3, 2012 at 11:34 AM, Brendan Eich bren...@mozilla.com wrote:
* the spread syntax just uses the iteration protocol;
This differs from Array.from -- any reason not to fall back on the
array-like protocol (which for missing 'length' iterates no values)?
I think ES6 should have a
On Wed, Oct 3, 2012 at 2:19 PM, Rick Waldron waldron.r...@gmail.com wrote:
On Wed, Oct 3, 2012 at 2:04 PM, Rick Waldron waldron.r...@gmail.comwrote:
On Wed, Oct 3, 2012 at 1:43 PM, Brandon Benvie bran...@brandonbenvie.com
wrote:
Another options for Maps is to represent them as an array
So here's a crazy idea (how's that for a lead-in?): What if it were
possible to specify that you want all non-array JSON objects to be
revived as maps instead of objects? Perhaps as an option passed to
JSON.parse()? JSON objects really have no use for prototypes and could
just as easily be
Taking a cue from plist, which is easily transformed to and from JSON, you
would end up with something like
[{ key: {...key..}, value: {...value...} }]
which is less space efficient but pretty easy to automatically convert back
to a map (aside from correctly handling duplicate values).
On Oct 3, 2012, at 10:05 AM, François REMY wrote:
In non-strict ES, the “t” function may be eval, and eval could add a “oops”
variable in the parent function getOoops.
I don't believe this is true. This does not constitute a direct call to eval
(15.1.2.1.1), and as such the eval will take
Jason Orendorff wrote:
On Wed, Oct 3, 2012 at 11:34 AM, Brendan Eichbren...@mozilla.com wrote:
* the spread syntax just uses the iteration protocol;
This differs from Array.from -- any reason not to fall back on the
array-like protocol (which for missing 'length' iterates no values)?
I
Thanks for pointing this out. Python's dunder-prefixing or anything like
it in JS has that advantage: you can spell the magic property name with
a string that works in any frame or global object. Of course strings can
collide.
Symbols are useful in spite of this, but it is telling that we
Le 03/10/2012 21:01, Brendan Eich a écrit :
Thanks for pointing this out. Python's dunder-prefixing or anything
like it in JS has that advantage: you can spell the magic property
name with a string that works in any frame or global object. Of course
strings can collide.
Symbols are useful in
Another reviver-friendly possibility: type tags for objects (arrays remain as
they are).
[
{ __type__: Date, time: 1349291353269 },
{ __type__: Object, first: Jane, last: Doe },
{ __type__: Map, entries: [ [first, Jane], [last, Doe] ] }
]
This assumes that the keys of objects are
Would it suffice to allow cross-frame sharing of symbols via postMessage and
its structured clone algorithm? They're immutable, right?
On Oct 3, 2012, at 15:01, Brendan Eich bren...@mozilla.org wrote:
Thanks for pointing this out. Python's dunder-prefixing or anything like it
in JS has that
Indirect eval is something introduced for ES5 Strict only, I believe. Try
the following code in your browser’s console, and you may be surprised:
((function(t) { t(var body=true); return function() { return
body; }; })(eval))())
___
es-discuss
A generic solution for cross-frame sharing would most elegant (instanceof...).
But how?
On Oct 3, 2012, at 21:01 , Brendan Eich bren...@mozilla.org wrote:
Thanks for pointing this out. Python's dunder-prefixing or anything like it
in JS has that advantage: you can spell the magic property
Not necessarily: you could have an environment that is global to all frames.
But that seems like a security risk.
On Oct 3, 2012, at 21:40 , Kevin Smith khs4...@gmail.com wrote:
So should there be a way in the language to create singleton symbols? If so,
how?
new
On Wed, Oct 3, 2012 at 1:57 PM, Brendan Eich bren...@mozilla.com wrote:
On that point, does NodeList have an iterator in Firefox now? That's an
obvious Array.from argument type.
Yep!
document.body.querySelectorAll(p).iterator()
[object Iterator]
On Wed, Oct 3, 2012 at 2:57 PM, Brendan Eich bren...@mozilla.com wrote:
Jason Orendorff wrote:
On Wed, Oct 3, 2012 at 11:34 AM, Brendan Eichbren...@mozilla.com
wrote:
* the spread syntax just uses the iteration protocol;
This differs from Array.from -- any reason not to fall back on the
On Wed, Oct 3, 2012 at 3:47 PM, Jason Orendorff
jason.orendo...@gmail.comwrote:
On Wed, Oct 3, 2012 at 1:57 PM, Brendan Eich bren...@mozilla.com wrote:
On that point, does NodeList have an iterator in Firefox now? That's an
obvious Array.from argument type.
Yep!
On Oct 3, 2012, at 12:40 PM, François REMY wrote:
Indirect eval is something introduced for ES5 Strict only, I believe.
Nope. See 15.1.2.1.1, no reference to strict.
Here's a better example:
(function(t){ var x = 'foo'; t(x = 'bar'); alert(x); })(eval)
The indirect eval does not
| That just puts 'body' on the window.
Indee, I'm false on that one. But if you use a direct eval, you can get the
same behavior in ES5, which is want I wanted to demonstrate:
window.a = true;
(function x(t) { eval(t); return a==window.a; })(var a=false)
So in plain ES5, the scope of
On Wed, Oct 3, 2012 at 2:44 PM, Dean Landolt d...@deanlandolt.com wrote:
On Wed, Oct 3, 2012 at 2:19 PM, Rick Waldron waldron.r...@gmail.comwrote:
On Wed, Oct 3, 2012 at 2:04 PM, Rick Waldron waldron.r...@gmail.comwrote:
On Wed, Oct 3, 2012 at 1:43 PM, Brandon Benvie
On Wed, Oct 3, 2012 at 3:36 PM, Brendan Eich bren...@mozilla.org wrote:
Rick Waldron wrote:
On Wed, Oct 3, 2012 at 2:04 PM, Rick Waldron waldron.r...@gmail.commailto:
waldron.r...@gmail.com** wrote:
On Wed, Oct 3, 2012 at 1:43 PM, Brandon Benvie
bran...@brandonbenvie.com
On Wed, Oct 3, 2012 at 3:53 PM, Rick Waldron waldron.r...@gmail.com wrote:
var d = document.createElement(div); d.className = foo bar baz;
[...d.classList]
[foo, bar, baz]
targetElement.classList.add(...sourceElement.classList);
:D
But then again that would work even if we didn't use the
I can't imagine actually getting consensus on making the current default
change from sparse to dense. We've rejected many breaking changes that were
less breaking than this would be.
The subclass notion is interesting though. Reads dominate writes, and
frozen arrays can only be read anyway.
On Tue, Oct 2, 2012 at 9:05 PM, Norbert Lindenberg
ecmascr...@norbertlindenberg.com wrote:
TC 39, I need decisions so that I can finish the Internationalization spec
and send it to the Ecma GA:
1) Instances of Intl.Collator, Intl.NumberFormat, and Intl.DateTimeFormat
currently have
On Wed, Oct 3, 2012 at 4:07 PM, Mark S. Miller erig...@google.com wrote:
I can't imagine actually getting consensus on making the current default
change from sparse to dense. We've rejected many breaking changes that were
less breaking than this would be.
The subclass notion is interesting
On Tue, Oct 2, 2012 at 10:13 AM, Brendan Eich bren...@mozilla.com wrote:
Allen Wirfs-Brock wrote:
On Oct 1, 2012, at 9:56 PM, Brendan Eich wrote:
Allen Wirfs-Brock wrote:
We can try to tell ES implementors that they must do certain things in
order to be in conformance but that really
On Oct 3, 2012 12:39 PM, Domenic Denicola dome...@domenicdenicola.com
wrote:
Would it suffice to allow cross-frame sharing of symbols via postMessage
and its structured clone algorithm? They're immutable, right?
I'm trying to follow this thread, but I'm having trouble understanding the
Domenic Denicola wrote:
Would it suffice to allow cross-frame sharing of symbols via postMessage and
its structured clone algorithm? They're immutable, right?
They are immutable but you'd still have to pass your @iterator to
another same-origin frame, and then have to use it carefully when
On Wed, Oct 3, 2012 at 10:05 AM, François REMY fremycompany_...@yahoo.frwrote:
I think that what he meant is that we know for sure in which scope we
can find the property/variable. That the propery exists or not in the that
scope is another issue.
So, in the code “function getOoops(t) {
On Wed, Oct 3, 2012 at 7:05 PM, François REMY fremycompany_...@yahoo.frwrote:
I think that what he meant is that we know for sure in which scope we
can find the property/variable. That the propery exists or not in the that
scope is another issue.
So, it doesn't matter that the global
On Wed, Oct 3, 2012 at 3:16 PM, Šime Vidas sime.vi...@gmail.com wrote:
On Wed, Oct 3, 2012 at 7:05 PM, François REMY
fremycompany_...@yahoo.frwrote:
I think that what he meant is that we know for sure in which scope we
can find the property/variable. That the propery exists or not in the
Le 03/10/2012 23:09, Brendan Eich a écrit :
Domenic Denicola wrote:
Would it suffice to allow cross-frame sharing of symbols via
postMessage and its structured clone algorithm? They're immutable,
right?
They are immutable but you'd still have to pass your @iterator to
another same-origin
(oops, forgot to reply-all)
Begin forwarded message:
From: Allen Wirfs-Brock al...@wirfs-brock.com
Date: October 3, 2012 10:15:57 AM PDT
To: Herby Vojčík he...@mailbox.sk
Subject: Re: Sets plus JSON
On Oct 3, 2012, at 9:56 AM, Herby Vojčík wrote:
Nicholas C. Zakas wrote:
After a
On Thu, Oct 4, 2012 at 12:31 AM, Mark S. Miller erig...@google.com wrote:
On Wed, Oct 3, 2012 at 3:16 PM, Šime Vidas sime.vi...@gmail.com wrote:
On Wed, Oct 3, 2012 at 7:05 PM, François REMY
fremycompany_...@yahoo.frwrote:
I think that what he meant is that we know for sure in which
David Bruant wrote:
Unforgeability can be given up, but you end up with global namespaces.
new Symbol(21fef4ae-1439-4b6a-b412-3585906b35f1); or
org.ecmascript.system.iterator
This is no better than dunder-iterator (I mean '__iterator__', I just
like typing dunder- ;-), or just 'iterator'
You should eval an initialized var declaration of foo inside the with,
and check foo's value after the with body, for real head-exploding. ;-)
/be
Šime Vidas wrote:
Well, thank you for your excellent video. The dynamic scopes in the
default language are a disaster... I've just written a short
On Wed, Oct 3, 2012 at 5:09 PM, Brendan Eich bren...@mozilla.org wrote:
Domenic Denicola wrote:
Would it suffice to allow cross-frame sharing of symbols via postMessage
and its structured clone algorithm? They're immutable, right?
They are immutable but you'd still have to pass your
Pardon my ignorance, but some sort of analogue to Java's ResourceBundle never
makes it onto these lists. Is this out of scope, and if so, is there some sort
of standard, recommended way to get that effect in ECMAScript? If not, I'd say
that's more important than most of the things on this
Please add all the features you are interested in to the document -
https://docs.google.com/spreadsheet/ccc?key=0AhsGcaqNtRMpdC1FVEZOZ2tqdWRHdWdtRkMyaFM3VGc#gid=0
2012/10/3 Gillam, Richard gil...@lab126.com
Pardon my ignorance, but some sort of analogue to Java's ResourceBundle
never makes it
On Oct 3, 2012, at 2:09 PM, Brendan Eich wrote:
Domenic Denicola wrote:
Would it suffice to allow cross-frame sharing of symbols via postMessage and
its structured clone algorithm? They're immutable, right?
They are immutable but you'd still have to pass your @iterator to another
Dean Landolt wrote:
On Wed, Oct 3, 2012 at 5:09 PM, Brendan Eich bren...@mozilla.org
mailto:bren...@mozilla.org wrote:
Domenic Denicola wrote:
Would it suffice to allow cross-frame sharing of symbols via
postMessage and its structured clone algorithm? They're
Allen Wirfs-Brock wrote:
Presumably a similar technique could be used for user defined symbols
that need to be shared across frame but the needs to be a way to
communicate the actual shared symbol values to the module instance
associated with each realm. In the above referenced message I
What was the story wrt subject?
The Note in ES5.1, 12, Semantics (FunctionDeclarations as Statements)
used to be unproblematic as this non-portable feature could simply be
avoided.
It also was unproblematic when ES.next still required opt-in, as old
implementations would then balk before
Claus Reinke wrote:
But with 1JS, I'm no longer sure what happens when new code that
relies on local FunDecls (and no other ES6 features) encounters an
old implementation. It looks as if there will be no warning or error,
just irreconcilable differences in behaviour?
That's the case already,
Oliver Hunt wrote:
I still don't understand this desire to delay semantic analysis, where are the
examples of sema being a performance bottleneck? Just basic parsing already
requires us to do a reasonable amount of analysis anyway, and while parsing
shows up as being a problem, the bulk of
The 3 October 2012 draft of the ECMAScript Internationalization API
Specification is available at
http://wiki.ecmascript.org/doku.php?id=globalization:specification_drafts
This draft has the content that TC 39 approved on 18 September for submission
to the Ecma CC and GA.
Best regards,
Norbert
Mark S. Miller wrote:
Allen and I also discussed the plan I intend to try in
SpiderMonkey: making Date.prototype, Number.prototype, etc. test
as Object according to the O_p_toString_call tag test. We think
this should not affect SES or any real code (as Oliver postulated).
I
82 matches
Mail list logo