Re: Re: Inline ES Modules

2018-06-18 Thread Peter van der Zee
I actually quite like the idea. - Extend the import syntax to allow an identifier instead of a string. Such identifier must be match the name of a module declaration the same file (they are hoisted and a syntax error if not present/something else). - Module declaration names are abstracts since

Re: try/catch/else

2018-02-08 Thread Peter van der Zee
>> On Thu, Feb 8, 2018 at 10:13 AM, Claude Pache >> wrote: >>> >>> What about the following pattern (labelled block + break)? >>> >>> ```js >>> processSuggestions: { >>> let suggestions; >>> try { >>> suggestions = await fetchSuggestions(); >>> } catch

Re: Mixing grammars

2017-09-01 Thread Peter van der Zee
> Sorry, but your message looks very opinionated and I can't seem to find any objective reasoning in there. Nah, you might be thrown off by the different grammar ;) Ok. Thing is, `|>` would introduce a new way of calling a function in a way that is not at all in line with how functions are

Mixing grammars

2017-09-01 Thread Peter van der Zee
I want quickly a point to make. I have a while ago of the, well, I know actually not how that thing is called, but the "|> operator" heard. I ignored it as "funny but a very different paradigm than JS". Now see I today a tweet pass by that somebody a draft of a propasal has created [1] to this

Re: Arrow function followed by divide or syntax error?

2017-05-24 Thread Peter van der Zee
terminating semicolon. There is none in this example, nor a line > break that would allow one to be inserted implicitly. So when reaching the > first `/` a syntax error is apparent, since there is no way the input can > still form a well-formed statement at that point. > > On 24 May 2017

Re: Arrow function followed by divide or syntax error?

2017-05-24 Thread Peter van der Zee
> Unlike an ordinary function expression, which is a PrimaryExpression, an > arrow function is merely an AssigmentExpression, so has much lower precedence > than any arithmetic operator. I'm curious how this should be parsed so let's break this down. Given the following "Script" (I don't think

Re: Function constants for Identity and No-op

2016-08-10 Thread Peter van der Zee
>> What's the issue with document.createElement('object')? > It's a callable exotic object. >> Function.isFunction? :D > typeof is what you are looking for. There is precedent (at least in IE [1]) for exotic functions where `typeof` returned "unknown". Could happen for any exotic value unless

Re: ES7 - the standard

2016-06-17 Thread Peter van der Zee
On Thu, Jun 16, 2016 at 11:54 PM, Raul-Sebastian Mihăilă wrote: > I see that es7 is now a standard. > http://www.ecma-international.org/ecma-262/7.0/index.html Nice, thanks for the heads up. Could the spec next time have a non-normative section with the main changes

Pseudo headless arrows

2016-04-21 Thread Peter van der Zee
There are two ways of writing argument-less arrows; () => x; _ => x; (Where `_` can be any identifier, of course.) I understand why we can't drop the head entirely so if we're forced to type anything at all, anyways, why not at least make it simpler by pressing two different keys instead of

Re: Swift style syntax

2015-10-12 Thread Peter van der Zee
On Mon, Oct 12, 2015 at 10:12 AM, Mohsen Azimi wrote: >> Your syntax is ambiguous: Should your code be interpreted as: >> >>let passed = objs.filter($0 => $0.passed) >> >> or: >> >>let passed = $0 => objs.filter($0.passed) > > I don't understand why you parsed it in the

Re: please add orEqual operator

2015-08-10 Thread Peter van der Zee
On Mon, Aug 10, 2015 at 3:50 AM, myemailu...@gmail.com wrote: Isn't prop ||= 0; better than prop = prop || 0; and it can be even defined like this. prop ||= var1 ||= var2 ||= 0; but then i dont know how we can use it ike this if (num == 3 ||=4 ||=6) Sounds like you want two operators;

Re: Named Paramters

2015-07-12 Thread Peter van der Zee
(A minifier that breaks your code is a broken minifier and should never be a valid argument for these cases) On Sun, Jul 12, 2015 at 10:29 AM, Denis Pushkarev zloir...@zloirock.ru wrote: 1. It would break backwards compatibility: ```js var bar = 1; if(baz(bar))foo(bar = 5);

Re: Reflect.hasOwn() ?

2014-07-27 Thread Peter van der Zee
On Sat, Jul 26, 2014 at 5:14 PM, Mark S. Miller erig...@google.com wrote: Hi Peter, what is the security issue you are concerned about? Unless `Reflect` is completely sealed out of the box, you can never know whether properties on it are the actual built-ins. That's all. - peter

Re: Reflect.hasOwn() ?

2014-07-27 Thread Peter van der Zee
On Sun, Jul 27, 2014 at 1:57 PM, David Bruant bruan...@gmail.com wrote: You can deeply freeze it yourself before any other script accesses it. That's already assuming you are first. You may not be without your knowledge (ISP injection, virus hijack, garden gnomes, etc). At this point you'll be

Re: Reflect.hasOwn() ?

2014-07-27 Thread Peter van der Zee
On Sun, Jul 27, 2014 at 6:14 PM, Mark S. Miller erig...@google.com wrote: Although there is some interesting work in trying to obtain security relevant guarantees from a script that isn't first, where a malicious script may instead have been first (link please if anyone has it), this work did

Re: Reflect.hasOwn() ?

2014-07-25 Thread Peter van der Zee
On Sat, Jul 26, 2014 at 5:43 AM, Axel Rauschmayer a...@rauschma.de wrote: The only exception that comes to my mind is `{}.hasOwnProperty.call(obj, key)` (which is the only safe way to invoke this method). Would it make sense to provide that as a tool function, e.g. as `Reflect.hasOwn()`? That

Re: Trailing comma for function arguments and call parameters

2014-07-08 Thread Peter van der Zee
On Fri, Jul 4, 2014 at 12:52 AM, Dmitry Soshnikov dmitry.soshni...@gmail.com wrote: Will it makes sense to standardize a trailing comma for function arguments, and call parameters? Fwiw, it also makes sense in AMD, where the set of dependencies can grow and the desire to put every module on its

Re: BNF grammar in specification license

2014-07-02 Thread Peter van der Zee
Dear Kalinni Gorzkis, I'm curious to what you're hoping to achieve here. This is not your first email to this thread, and by searching on the web, I see you're sending a lot of related messages to various other language groups and what not. This makes me doubt you're actually interested in using

Re: Multiline Strings

2014-03-07 Thread Peter van der Zee
On Fri, Mar 7, 2014 at 8:56 AM, Florian Bösch pya...@gmail.com wrote: There's two complications with that. A string doesn't carry the line number it comes from. Also, myfile.js might get concated with other files. And lastly strings might get pasted together from smaller snippets. I think you

Re: Array detection (was Re: Final iterator spec)

2014-03-02 Thread Peter van der Zee
Depends upon what you mean by Array detection. If you mean is obj an exotic array object (ie, an object that automatically updates the length property value as integer indexed properties are added or deleted) then Array.isArray(obj) detects exactly that. Okay cool. Is there merit in

Re: what kind of problem is this fat arrow feature trying to solve ?

2013-10-02 Thread Peter van der Zee
(In all fairness, Andrea was merely, and quite explicitly so, asking for the rationale behind the fat arrow, not a scrutiny of his examples. Tab's sarcastic response was unnecessary on a whole different level, too.) On Wed, Oct 2, 2013 at 1:14 PM, Benjamin (Inglor) Gruenbaum ing...@gmail.com

Re: f() = x de facto standard

2013-08-07 Thread Peter van der Zee
On Wed, Aug 7, 2013 at 6:21 PM, Allen Wirfs-Brock al...@wirfs-brock.comwrote: I'm not sure where that analysis came from? As far as I know there were no such changes in ES5.1 and the ES5.1 grammar clearly allows a function call to appear on the LHS of an assignment. I got it from

Re: Identifying ECMAScript identifiers

2013-03-09 Thread Peter van der Zee
Norbert, for the sake of completeness; ZeParser (http://github.com/qfox/zeparser) does support complete unicode identifiers ZeParser2 (http://github.com/qfox/zeparser2) doesn't (I simply didn't bother) - peter ___ es-discuss mailing list

Array method ranges

2013-01-24 Thread Peter van der Zee
What about adding specific range arguments to the es5 array methods (forEach, map, etc)? Currently the start (inclusive) and stop (exclusive) is always 0 ... length, but what if you only want to map over a sub range of the array? Or maybe I want to traverse the array in reverse? I'd either have to

Re: Reduce context parameter

2013-01-08 Thread Peter van der Zee
On Mon, Jan 7, 2013 at 11:59 PM, Rick Waldron waldron.r...@gmail.com wrote: The initialVal argument is _optional_ and undefined is valid — how would you decide if what was passed should be initial value or thisArg? I see. Well, ship has sailed. Thanks. - peter ...(Could have specced the

Reduce context parameter

2013-01-06 Thread Peter van der Zee
Mostly out of curiosity; why do Array#reduce and reduceRight have no context parameter? - peter ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Arrow functions and return values

2012-11-29 Thread Peter van der Zee
On Thu, Nov 29, 2012 at 10:32 AM, Brendan Eich bren...@mozilla.com wrote: You would need a second ; after b * c; to spell the empty statement. Interesting fact actually, it would mean the empty statement is no longer a NOOP. It can actually alter a program. I can't think of a situation where

Re: Subclassing basic types in DOM - best method?

2012-11-20 Thread Peter van der Zee
On Tue, Nov 20, 2012 at 10:31 PM, Rick Waldron waldron.r...@gmail.com wrote: On Tue, Nov 20, 2012 at 2:45 PM, Tab Atkins Jr. jackalm...@gmail.com wrote: On Mon, Nov 19, 2012 at 9:46 PM, Brendan Eich bren...@mozilla.com wrote: Tab Atkins Jr. wrote: If we did this, the only reason to

Re: let and strict mode

2012-11-15 Thread Peter van der Zee
On Fri, Nov 16, 2012 at 1:35 AM, Allen Wirfs-Brock al...@wirfs-brock.com wrote: On Nov 15, 2012, at 4:17 PM, Brendan Eich wrote: Of course, 'let' short for 'letter' :-|. Contextual keyword with [no LineTerminator here] after sounds like the plan. I'm curious whether you have already

Re: Why are non-method properties in a prototype an anti-pattern?

2012-11-07 Thread Peter van der Zee
On Wed, Nov 7, 2012 at 6:27 PM, Kevin Smith khs4...@gmail.com wrote: This footgun: function MyClass() { this.value = 1; // OK this.list.push(0); // Modifying the list for every instance - probably not intended. } MyClass.prototype.value = 0;

Re: Sandboxing and parsing jQuery in 100ms

2012-11-07 Thread Peter van der Zee
On Wed, Nov 7, 2012 at 5:53 PM, gaz Heyes gazhe...@gmail.com wrote: Hi all Check this out: http://www.thespanner.co.uk/2012/11/07/sandboxing-and-parsing-jquery-in-100ms/ How would you deal with cases like `foo(/)/);` and `foo(5//)/g);` ? So how would you deal with combinations of regular

Re: Sandboxing and parsing jQuery in 100ms

2012-11-07 Thread Peter van der Zee
On Thu, Nov 8, 2012 at 12:05 AM, gaz Heyes gazhe...@gmail.com wrote: Both your cases are invalid javascript in the browser. So they will never D'oh. I meant escaped parensthesis, didn't think about capturing groups. For the second example, there was supposed to be a space to prevent the line

Re: thoughts the (re)organization of the specification?

2012-11-04 Thread Peter van der Zee
+1 stuff ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Convergence options for Ecmascript/Actionscript?

2012-09-02 Thread Peter van der Zee
On Wed, Aug 29, 2012 at 2:30 AM, Brendan Eich bren...@mozilla.org wrote: You really should read back in es-discuss if you have time (understand if you don't!). We covered what made ES4 fail. The main problem was namespaces, upon which packages were built. Unfortunately, AS3 uses namespaces

Re: Consistency in The Negative Result Values Through Expansion of null's Role

2012-08-16 Thread Peter van der Zee
On Thu, Aug 16, 2012 at 12:02 AM, Erik Reppen erik.rep...@gmail.com wrote: So for the sake of consistency/sanity in future methods, at least, how about establishing the following guidelines somewhere on the usage of these values? * More specific negative-result values are reserved for simple

The Error type

2012-08-16 Thread Peter van der Zee
I was jesting a bit in the other thread (https://mail.mozilla.org/pipermail/es-discuss/2012-August/024602.html) but the more I think about it, the more it makes sense. JS should have an Error primitive type. It would make the failed return type for most actions more consistent. The word consistent

Spec feedback on rev 6

2012-07-31 Thread Peter van der Zee
Hi, I've read pretty thoroughly through rev 6 of the spec (offline, with a pen and a printed spec) and seem to have written down at least something on pretty much every page. It'll take me some time to put it all together digitally, but here are some high level comments (in no particular order):

Re: Spec feedback on rev 6

2012-07-31 Thread Peter van der Zee
On Tue, Jul 31, 2012 at 10:19 PM, Peter van der Zee e...@qfox.nl wrote: Hi, I've read pretty thoroughly through rev 6 of the spec (offline, with a Sorry, I may have been confused. I read the July 8th revision of the draft. Fwiw. ___ es-discuss

Re: Default operator strawman - ||| rather than ??

2012-06-12 Thread Peter van der Zee
On Tue, Jun 12, 2012 at 5:29 PM, T.J. Crowder t...@crowdersoftware.com wrote: In the current default operator strawman[1], the operator is ??, e.g.: a = b ?? 5; is shorthand for a = b !== undefined ? b : 5; I missed this discussion. What validates the introduction of this syntax over the

Re: Default operator strawman - ||| rather than ??

2012-06-12 Thread Peter van der Zee
If the above is this, absolutely and such a feature, I favor this as Wow, something messed up big time. If the above answer is this, absolute and such a feature is seriously considered ... ___ es-discuss mailing list es-discuss@mozilla.org

Re: Default operator strawman - ||| rather than ??

2012-06-12 Thread Peter van der Zee
On Tue, Jun 12, 2012 at 10:56 PM, Tab Atkins Jr. jackalm...@gmail.com wrote: undefined is special-cased here because it's an extremely common value to check against.  It's used when an argument isn't supplied, or when you try to pull a non-existent property off of an object. I believe the most

Re: catch vs function scope; var declaration vs initialization

2012-05-14 Thread Peter van der Zee
On Mon, May 14, 2012 at 11:57 AM, Claus Reinke claus.rei...@talk21.com wrote: What should be the output of the following code? (function(){ try {  throw hi; } catch (e) {  var e = ho;  var o = hu;  var u;  console.log(e); } console.log(e,u,o); }()); It seems clear that the first

Even simpler lambdas

2012-04-17 Thread Peter van der Zee
Why can't lambda's be a simple case of a lexically scoped `return` keyword with any arguments implicitly defined and accessible through a predefined identifier/keyword (much like `arguments` works now)? arr.map(return ''+arguments[0]+' class='+this.getClassName(arguments[1])+'/'); arr.map(return

Re: Even simpler lambdas

2012-04-17 Thread Peter van der Zee
On Tue, Apr 17, 2012 at 10:11 PM, Brendan Eich bren...@mozilla.org wrote: François REMY wrote: I kinda like it. I don't, but what's more, Tab's point has come up already in TC39 in similar settings. I doubt this will fly. It's hard to see 'return' in an expression as different from

Re: Even simpler lambdas

2012-04-17 Thread Peter van der Zee
On Tue, Apr 17, 2012 at 10:11 PM, Brendan Eich bren...@mozilla.org wrote: ... That's a readability problem that I suspect would sink this if it were to get to TC39. On the subject of readability; I believe that a worded keyword; map(return $1+$2) gives a much stronger emphasis to HEY, I'M DOING

Re: undefined being treated as a missing optional argument

2012-04-13 Thread Peter van der Zee
Fwiw, arguments.length is currently the _only_ way of properly detecting the correct number of explicit variables of _any_ type. I would hate for that behavior to change in the case of explicitly passing on undefined. Default values of course do need to be set in the arguments array so it's

Re: Fun impossible Firefox JS challenge

2012-04-12 Thread Peter van der Zee
On Thu, Apr 12, 2012 at 4:12 PM, Andreas Rossberg rossb...@google.com wrote: Haha nice try even with unicode escapes it still refers to true the boolean not the function. That's another FF deviation from the standard, though. Identifiers with unicode escapes have the meaning of their

Re: Fun impossible Firefox JS challenge

2012-04-12 Thread Peter van der Zee
On Thu, Apr 12, 2012 at 6:13 PM, Allen Wirfs-Brock al...@wirfs-brock.com wrote: At this point I think we need to do two things: Add a third to that, because I don't think Gaz was talking about unicode escapes (Haha nice try). I'm still curious to the answer :) - peter

Re: Terminology: “non-method function”

2012-04-11 Thread Peter van der Zee
On Wed, Apr 11, 2012 at 1:01 AM, Axel Rauschmayer a...@rauschma.de wrote: What is a good term for functions that don’t have/use dynamic `this`? A bound function? ___ es-discuss mailing list es-discuss@mozilla.org

Re: Should ... be suffix rather than prefix?

2012-04-03 Thread Peter van der Zee
Second... On Tue, Apr 3, 2012 at 10:16 PM, Mark S. Miller erig...@google.com wrote:     foo(a, b, ...rest) vs     foo(a, b, rest...) Which is clearer? ES6 has currently agreed on the first. English and Scheme agree on the second. This question applies to both

Array#sort(prop)

2012-04-01 Thread Peter van der Zee
No idea whether this has been discussed before, but I find myself continuously doing this when sorting arrays with objects: arr.sort(function(a,b){ if (a.prop b.prop) return -1; if (a.prop b.prop) return 1; return 0; }); Couldn't we add an optional string argument to Array#sort that does this

Re: simpler, sweeter syntax for modules

2012-03-22 Thread Peter van der Zee
On Wed, Mar 21, 2012 at 11:28 PM, David Herman dher...@mozilla.com wrote: * importing with renaming:    import { draw: drawGun }    from cowboy.js,           { draw: drawWidget } from widgets.js; The brackets don't seem necessary (at least not from a parsing perspective). Maybe drop them?

Re: YAWSI: an identity unary operator

2012-03-19 Thread Peter van der Zee
As long as we're bikeshedding; none of your examples look as clean to me as the original. If you're dead set on fixing this, try changing the this keyword... var a; var obj = { get a() {return a}, set a(v) {a=v} }; var obj = { a: null, get a() {return this.a}, set a(v) {this.a=v} };

Re: Math.clz()

2012-03-04 Thread Peter van der Zee
Maybe make it generic? Although that might not be very important for the case of counting leading zeroes or ones. I'd love a function for getting n consecutive bits (to left or right..) from number x starting from the nth bith (from the left or right) as a single number as if the lsb was 1. You

Re: New full Unicode for ES6 idea

2012-02-19 Thread Peter van der Zee
Do we know how many scripts actually rely on \u15 to produce a stringth length of 3? Might it make more sense to put the new unicode escape under a different escape? Something like \e for extended unicode for example. Or is this acceptable migration tax... On a side note, if we're going to do

Fallback

2012-02-10 Thread Peter van der Zee
There's currently no way of introducing anything new into the language that breaks syntax. I think that point has been made very clearly with harmony/es6. Can we introduce a way to make these transitions easier in the future? CSS has a very simple way of gracefully ignore rules it doesn't know.

Re: Fallback

2012-02-10 Thread Peter van der Zee
. - peter -Message d'origine- From: Peter van der Zee Sent: Friday, February 10, 2012 11:27 AM To: es-discuss Subject: Fallback There's currently no way of introducing anything new into the language that breaks syntax. I think that point has been made very clearly with harmony/es6

Re: Deep cloning objects defined by JSON.

2012-01-29 Thread Peter van der Zee
Why can't we define a JSON.clone() or .deepClone() which would only clone properties that are primitives, object or array. If they are (instanceof) array, copy index properties and length value and create new array with that information. If object, create new object and copy all properties with

Re: Deep cloning objects defined by JSON.

2012-01-29 Thread Peter van der Zee
On Sun, Jan 29, 2012 at 7:23 PM, David Bruant bruan...@gmail.com wrote: Based on your description, it seems that the definition would be: JSON.clone = function(o){  return JSON.parse(JSON.stringify(o)); } Yes. You can debate whether it should remove properties it can't serialize completely,

Re: Deep cloning objects defined by JSON.

2012-01-29 Thread Peter van der Zee
On Sun, Jan 29, 2012 at 7:50 PM, Xavier MONTILLET xavierm02@gmail.com wrote: With your last two implementations, you don't keep cyclic references. I did not intend to. In fact, my intention was to have a clean object with just structure (objects and arrays) and primitives. Nothing else,

Versioning?

2011-12-19 Thread Peter van der Zee
https://lists.webkit.org/pipermail/webkit-dev/2011-December/018924.html ``use version 6;`` In which thread on esdiscuss should I have read about that? - peter ___ es-discuss mailing list es-discuss@mozilla.org

Re: with

2011-11-17 Thread Peter van der Zee
On Thu, Nov 17, 2011 at 12:53 PM, Dmitry Soshnikov dmitry.soshni...@gmail.com wrote: My first answer was glib, sorry. I'm proposing `with' as a replacement syntax for |. So the above expression evaluates to the same as Once again, it's absolutely the same approach which I showed

Re: making |this| an error (was Re: for own(...) loop)

2011-11-09 Thread Peter van der Zee
The forEach method might not do what you expect it to. This can not be statically determined. - peter On 9 Nov 2011 16:10, John J Barton johnjbar...@johnjbarton.com wrote: On Wed, Nov 9, 2011 at 3:41 AM, David Bruant bruan...@gmail.com wrote: Le 09/11/2011 02:26, Andrew Paprocki a écrit :

Re: Loyal Opposition to Const, Private, Freeze, Non-Configurable, Non-Writable...

2011-11-02 Thread Peter van der Zee
On Wed, Nov 2, 2011 at 5:44 PM, David Bruant bruan...@gmail.com wrote: I agree that the second argument is a design mistake. But ES6 will fix this with the proto operator. fix It has the same kind of baggage and goes into the minor features category, at least in terms of syntax, in my opinion.

Re: Another paren-free gotcha

2011-09-29 Thread Peter van der Zee
On Thu, Sep 29, 2011 at 3:43 AM, Quildreen Motta quildr...@gmail.com wrote: I'm not sure how this is much different from the rules you have now with ASI, though if this were such a problem, a block statement could be required I'm trying to make sure we don't add another feature that we'll later

Re: Another paren-free gotcha

2011-09-28 Thread Peter van der Zee
On Thu, Sep 29, 2011 at 12:38 AM, Douglas Crockford doug...@crockford.com wrote: On 11:59 AM, Waldemar Horwat wrote: Thinking about the implications of paren-free, I see additional potential trouble spots in addition to the one I mentioned in the meeting yesterday: These kind of potential

Re: IDE support?

2011-09-13 Thread Peter van der Zee
I'm assuming that conclusion already because the current tools for JS development are so incredibly lame that wasting time on static analysis -- which we know does not work without changing the language Ok, your assumed conclusion rests on a prior assumption: static analysis ... we know

Re: IDE support?

2011-09-12 Thread Peter van der Zee
On Mon, Sep 12, 2011 at 1:04 AM, Brendan Eich bren...@mozilla.com wrote: Type Inference can do a lot. See http://doctorjs.org/. We do not want people adding guards all over their code, IMHO. Anyway, we don't know have guards ES6. While true, I've found that you can't really overcome the

Re: IDE support?

2011-09-12 Thread Peter van der Zee
There are some half dozen or more papers on Javascript type inference or static analysis (hmm, is there a central wiki or bibliography where we could record and collect such JS-related references? should I post here what I've found so far?). For as far as you haven't already, I'd love to see

Re: __doc__ for functions, classes, objects etc.

2011-08-21 Thread Peter van der Zee
On Sun, Aug 7, 2011 at 6:56 PM, Dmitry A. Soshnikov dmitry.soshni...@gmail.com wrote: Hi, What about to standardize (Python's) __doc__-umentation comments for JS? What's the difference between that and the /** ... */ way of JSDoc? /** * This function does stuff * @constructor * @param

Re: \u0085 whitespace or a random unicode character by ES5?

2011-07-06 Thread Peter van der Zee
On Wed, Jul 6, 2011 at 7:38 PM, Dave Fugate dfug...@microsoft.com wrote: Several test262 test cases operate on the assumption ‘\u0085’, aka Next Line, is considered a whitespace character and I’d like to get some clarification on whether it really is or not as-per ES5.1. Table 3 of ES5, Line

Regex on substrings

2011-06-02 Thread Peter van der Zee
A problem I faced recently is the inability to apply regular expressions to a substring of a string without explicitly taking the substring first. So I'm wondering how much trouble it would be to extend the RegExp api to this... RegExp.prototype.test = function(string[, start=0[,

Re: Regex on substrings

2011-06-02 Thread Peter van der Zee
On Thu, Jun 2, 2011 at 7:17 PM, Mike Samuel mikesam...@gmail.com wrote: 2011/6/2 Peter van der Zee e...@qfox.nl: A problem I faced recently is the inability to apply regular expressions to a substring of a string without explicitly taking the substring first. So I'm wondering how much trouble

Re: Automatic Semicolon Insertion: value vs cost; predictability andcontrol; alternatives

2011-04-18 Thread Peter van der Zee
On Mon, Apr 18, 2011 at 3:12 AM, Oliver Hunt oli...@apple.com wrote: An implementation _could_ add a mode (*shudder*) along the same lines as strict mode: die in hell ASI, i hate you with the fiery passion of a thousand burning suns.; And then make it a syntax error whenever ASI would

Re: Automatic Semicolon Insertion: value vs cost; predictability andcontrol; alternatives

2011-04-18 Thread Peter van der Zee
On Mon, Apr 18, 2011 at 12:34 PM, Jorge jo...@jorgechamorro.com wrote: What am I missing ? As far as the directive goes, they are opt-in. Old code won't be opting in. Other than that they have the same issues as use strict might have. - peter ___

Removing labels

2011-04-09 Thread Peter van der Zee
Can we remove labels from the next version of the spec? Labels are only used for continue and break. I don't think I've ever had or seen a need for them (which does not mean they're unused, btw). They can be sugar insofar as to breaking a double loop at once. But at the same time they promote

Re: String.prototype.repeat

2011-03-22 Thread Peter van der Zee
On Tue, Mar 22, 2011 at 2:39 AM, Dmitry A. Soshnikov dmitry.soshni...@gmail.com wrote: On 22.03.2011 23:42, David Bruant wrote: Hi, About the string_repeat strawman ( http://wiki.ecmascript.org/doku.php?id=strawman:string_repeat), one alternative solution could be a two argument

Re: Date vs Daylight Savings

2011-03-21 Thread Peter van der Zee
On Mon, Mar 21, 2011 at 6:54 PM, Peter van der Zee e...@qfox.nl wrote: On Fri, Mar 11, 2011 at 12:12 AM, Luke Smith lsm...@lucassmith.namewrote: The consistent behavior across all browsers of Date when passed a time made invalid by a DST jump is to roll the time *back* by an hour

Re: Bringing setTimeout to ECMAScript

2011-03-19 Thread Peter van der Zee
On Sat, Mar 19, 2011 at 1:13 AM, Brendan Eich bren...@mozilla.com wrote: On Mar 18, 2011, at 5:54 AM, Peter van der Zee wrote: +1 to standardizing the timer family. I always thought this wasn't in because the specification didn't have any asynchronism and specifying timers would open

Re: Bringing setTimeout to ECMAScript

2011-03-19 Thread Peter van der Zee
On 19 Mar 2011 14:43, Breton Slivka z...@zenpsycho.com wrote: I can't think of a single way to simulate setTimeout in ES5. Correct me if I'm wrong, but I don't think ES5 exposes a single way of defining a mechanism like: -- var x = 4; function f(){ x = 5; print(x); } timer(f, 1);

Re: Bringing setTimeout to ECMAScript

2011-03-19 Thread Peter van der Zee
On Sat, Mar 19, 2011 at 2:49 PM, Breton Slivka z...@zenpsycho.com wrote: never write code on no sleep. that code sample should be : timers= (function () { var timers = []; var id=0; timer=function (f,t) { timers.push({func:f, interval:t, id:id++}); return

Re: Bringing setTimeout to ECMAScript

2011-03-18 Thread Peter van der Zee
+1 to standardizing the timer family. I always thought this wasn't in because the specification didn't have any asynchronism and specifying timers would open Pandora's box. - peter On Fri, Mar 18, 2011 at 1:51 PM, David Bruant bru...@enseirb-matmeca.frwrote: Hi, _Foreword_ Each time I

Re: do-while grammar

2011-02-09 Thread Peter van der Zee
Fwiw I don't recall any specific cases of input accepted by browsers which shouldn't parse according to the spec, other than functions in statements. Even callable regular expressions are fine as far as the grammar goes. I don't have an extensive test suite for regular expressions or strict mode

Re: New private names proposal

2010-12-22 Thread Peter van der Zee
On Dec 22, 2010, at 7:10 AM, Peter van der Zee wrote: What about adding an attribute to properties that somehow identify which classes (in the prototype chain for protected) have access to the object? I'll leave the somehow up in the air, but you could introduce a [[Private]] attribute which

Re: es5 bug, operator == and valueOf

2010-12-01 Thread Peter van der Zee
Has an operator like == ever been proposed? So the strict relational operator that returns NaN if typeof left and right don't match. If so, why was it shot down? Bloat? Relatively useless? - peter On Wed, Dec 1, 2010 at 1:45 AM, Brendan Eich bren...@mozilla.com wrote: On Nov 30, 2010, at 3:25

Re: Nov 18 notes

2010-11-22 Thread Peter van der Zee
On Mon, Nov 22, 2010 at 8:37 AM, David Herman dher...@mozilla.com wrote: for (var i : x) ... // must be new iteration for (var i : T : x) ... // iteration again, but parsed how? for (var i : T in x) ... // for-in with annotated var Bummer! I'm beginning to feel more strongly again

Re: Guards are now ready for discussion (was: Nov 18 notes)

2010-11-22 Thread Peter van der Zee
On Mon, Nov 22, 2010 at 9:43 AM, Brendan Eich bren...@mozilla.com wrote: On Nov 22, 2010, at 12:37 AM, Peter van der Zee wrote: On Mon, Nov 22, 2010 at 6:54 AM, Brendan Eich bren...@mozilla.com wrote: The ML-ish solution, which is forward compatible, is to parenthesize: let typedObj

RE: Negative indices for arrays

2010-11-11 Thread Peter van der Zee
If harmony would introduce this syntax guarded under a new script type, there would at least be no danger of breaking the web (existing scripts). However, negative array indexes might cause confusion when doing so implicitly. If you asume array indexes are just properties it'll be hard to

Re: hoisting past catch

2010-11-04 Thread Peter van der Zee
Shouldn't any var declared in the catch block be locally scoped as well? It seems that all browsers ignore that. try {x} catch(){ var y; } alert(y); The above should throw an error, yet it's undefined. In fact, even if the catch is not thrown y still exists (but if the catch block is not

Usage for weak-maps

2010-10-29 Thread Peter van der Zee
What's the use case for weak maps? What would you do with it that currently impossible and why is the workaround (if any) problematic enough to warrant a weak map implementation? There's been quite a bit of discussion because of it. Especially in the area of covert channels and garbage

Harmony and globals

2010-10-20 Thread Peter van der Zee
In the other thread it was mentioned that Harmony would not have global at the top of the scope chain. Was that pulled out of context or is that something planned for any code as long as you're in Harmony? Because if it is, I'm wondering about the semantics of built-in globals like undefined,

Re: Const functions with joining is ready for discussion

2010-09-07 Thread Peter van der Zee
I really dislike the hash notation for this purpose. I have no problem with either const(){} or const function(){}. The verbosity of using const is well worth the legibility. - peter On Tue, Sep 7, 2010 at 10:23 AM, Kevin Curtis kevinc1...@gmail.com wrote: If const functions and 'standard'

Re: Const functions with joining is ready for discussion

2010-09-07 Thread Peter van der Zee
Or rather, the legibility is well worth the verbosity of using const... On Tue, Sep 7, 2010 at 2:12 PM, Peter van der Zee e...@qfox.nl wrote: I really dislike the hash notation for this purpose. I have no problem with either const(){} or const function(){}. The verbosity of using const is well

Re: Reserved word property access and line breaks

2010-08-28 Thread Peter van der Zee
The impact seems minimal (how often would this occur in the wild). I don't like adding restrictions to the language for the sake of protecting a possible defect, but I don't really see this as a problem since it's not exactly a best practice to use reserved keywords as property names anyways ;)

Leap seconds for Date.parse

2010-07-19 Thread Peter van der Zee
While 15.9.1.1 explicitly says leap seconds are ignored by ECMAscript, the ISO 8601 timestamp format allows them. 15.9.1.15 (used by Date.parse) does dictate ranges for months and dates (days of month), but they don't specify the range for hours, minutes and (milli)seconds (although a note

Re: revisiting shift

2010-04-29 Thread Peter van der Zee
On Thu, Apr 29, 2010 at 2:21 AM, David Herman dher...@mozilla.com wrote: Hm. Maybe you meant to return the function to allow access to the local variable k through a closure? And not a fingerprint mixed shift(function) as I read it at first? I don't know what you're saying, but I have

Re: revisiting shift

2010-04-28 Thread Peter van der Zee
On Tue, Apr 27, 2010 at 4:57 PM, David Herman dher...@mozilla.com wrote: Example: function f() { try { for (let i = 0; i K; i++) { farble(i); // suspend and return the activation let received = shift (function(k) { return

Re: revisiting shift

2010-04-28 Thread Peter van der Zee
I don't understand this question-- do you mean whatever value the handler function (in the example, function(k) { return k }) returns? Then no, there's no augmentation or mutation here. The continuation is represented as an object with three methods: Ah, I didn't know that. It'd be cleaner

Re: Property attributes, clarification please.

2010-04-22 Thread Peter van der Zee
On Thu, Apr 22, 2010 at 9:38 AM, Asen Bozhilov asen.bozhi...@gmail.comwrote: If I understand correctly specification 8.6 The Object Type describe semantic of native objects and does some restriction on host objects. For example: | Every object (including host objects) must implement | all

Re: Property attributes, clarification please.

2010-04-22 Thread Peter van der Zee
On Thu, Apr 22, 2010 at 10:42 AM, Peter van der Zee e...@qfox.nl wrote: The attributes must be implemented, and they might all be, but they can all throw a TypeError regardless of what is being done with them. In this case, either the attributes can be seen as getters and setters which always

  1   2   >