Re: Proposal: Boolean.parseBoolean

2017-03-16 Thread Garrett Smith
The user's code… Trying to parse "" will also throw with JSON; !!"false " is true; host objects (or whatever they're called now) such as document.all. Unsubscribing. Not sure why I didn't earlier… I need to stay a code-free user. :-) On Thu, Mar 16, 2017 at 7:08 PM, 段垚 wrote:

Re: Function#toString revision: JSDoc comments?

2016-04-20 Thread Garrett Smith
On Sat, Apr 16, 2016 at 7:53 AM, Caitlin Potter wrote: > How would that interact with angular.js' Function.prototype.toString > parsing? Seems like doing that could break some content, even if it were > useful > Comments are generally a failure of the developer to write

Re: How to modify the scope chain without `with` ?

2016-02-16 Thread Garrett Smith
On Mon, Feb 15, 2016 at 1:13 AM, Coroutines wrote: > This post might be overly wordy. Sorry. It relates to the > functionality provided by the `with` keyword and why I think it's > important in the future. > > I am currently rewriting a templating module that I think is

Re: JavaScript Language feature Idea

2016-01-24 Thread Garrett Smith
On Sat, Jan 23, 2016 at 12:46 PM, kdex wrote: > @Michał: That really depends on the point of view: If you need zero-based > indexing from the right, as `[]` does from the left, you'd use > `Array.prototype.last`. > > On Samstag, 23. Januar 2016 20:56:02 CET Michał Wadas wrote: >> I

Re: Confusion with Object.prototype.toString and primitive string datatype

2016-01-01 Thread Garrett Smith
Because javascript is dynamically typed, conversion from objects to primitive values and vice versa. This is done respectively by the internal [[ToPrimitive]] and [[ToObject]] methods. See Object.prototype.toString, step 3 | Let O be ToObject(this value).

Re: Maven like dependency management for browsers

2015-08-07 Thread Garrett Smith
On 8/7/15, Behrang Saeedzadeh behran...@gmail.com wrote: Hi Sebastien, Guys — On Sun, Aug 2, 2015 at 10:38 PM Sébastien Cevey seb.ce...@guardian.co.uk wrote: [...] Versions can be specified either at the top-level config, or even at the import level, e.g.:

Re: Can't do push in forEach

2015-05-14 Thread Garrett Smith
On 5/14/15, Emanuel Allen emanuelal...@hotmail.com wrote: Surprise that I can't do arr1.forEeach(arr2.push); Check that line more carefully. Will throw an error. Using bind as: push = arr2.bind(push); Arrays don't have a bind method. -- Garrett @xkit ChordCycles.com garretts.github.io

Re: let function

2015-05-14 Thread Garrett Smith
On 5/14/15, Alexander Jones a...@weej.com wrote: Ah, thanks for explaining! What about the Temporal Dead Zone of let, or const binding semantics, for those of us who are obsessive enough to desire that kind of thing everywhere? Let a constructive discussion about this proposal take place. The

Re: let function

2015-05-14 Thread Garrett Smith
On 5/14/15, Kevin Smith zenpars...@gmail.com wrote: Good points. All the more reason to throw out declarations as statements in favour of let/const/var, which we all have to understand well anyway, for other types of variable. Declarations aren't going anywhere, Getting rid of

Re: Declaration binding instationationing

2015-04-29 Thread Garrett Smith
OK, here is a bug report: Bug 4336 - 10.5 Declaration binding instantiation https://bugs.ecmascript.org/show_bug.cgi?id=4336 On 4/29/15, Mathias Bynens mathi...@opera.com wrote: On Wed, Apr 29, 2015 at 7:29 AM, Garrett Smith dhtmlkitc...@gmail.com wrote: There is an English problem here

Declaration binding instationationing

2015-04-28 Thread Garrett Smith
There is an English problem here: Let existingProp be the resulting of calling the [[GetProperty]] internal method of go with argument fn. Can the spec be made easier to read? -- Garrett @xkit ChordCycles.com garretts.github.io personx.tumblr.com ___

Re: super() on class that extends

2015-04-10 Thread Garrett Smith
On 4/10/15, Axel Rauschmayer a...@rauschma.de wrote: The reason why you need to call the super-constructor from a derived class constructor is due to where ES6 allocates instances - they are allocated by/in the base class (this is necessary so that constructors can be subclassed that have

Re: Accepting an array as the first parameter to String.prototype.includes

2015-03-10 Thread Garrett Smith
) But if Garrett Smith was trying to point out that `.contains()` would be better naming for the specific purpose of using an Array: `str.contains([Mary, Bob])` then ok? maybe. str.contains was Andrea's interpretation of my example. Nevermind that; let me try again... You first asked about making

Re: Accepting an array as the first parameter to String.prototype.includes

2015-03-10 Thread Garrett Smith
On 3/10/15, Garrett Smith dhtmlkitc...@gmail.com wrote: On 3/10/15, Edwin Reynoso eor...@gmail.com wrote: [...] specs if I want to understand what I am doing in order to pay my rent. It can and should suck less. Let me rephrase that: I don't mean that the specification sucks - sitting down

Re: Accepting an array as the first parameter to String.prototype.includes

2015-03-10 Thread Garrett Smith
On 3/10/15, Andrea Giammarchi andrea.giammar...@gmail.com wrote: I'm still having hard time understanding what's the difference between contains and the good old indexOf beside the RegExp check ... but I agree having multiple explicit searches instead of multiple implicit searches won't make

Re: Accepting an array as the first parameter to String.prototype.includes

2015-03-10 Thread Garrett Smith
On 3/10/15, Andrea Giammarchi andrea.giammar...@gmail.com wrote: contains better than indexOf ? I'd agree only if contains wasn't accepting any extra argument, which makes it even more (pointless?) similar to indexOf. If it had only one incoming parameter, you could have `[maria,

Re: Proposal: Additional Meta Properties for ES7

2015-02-26 Thread Garrett Smith
Can you show an example of how callee is used with a fat arrow function? (()={alert(callee);})() Thanks. On 2/26/15, Allen Wirfs-Brock al...@wirfs-brock.com wrote: Here is a new proposal for some additional meta properties that should be considered for ES7

Re: JavaScript 2015?

2015-01-22 Thread Garrett Smith
On 1/22/15, Brendan Eich bren...@mozilla.org wrote: Andrea Giammarchi wrote: agreed and not only, it took years before various engines fully implemented ES5 so saying years later that an engine is fully compliant with a year in the past feels so wrong !!! Why is that? Where is the thread

Re: Proposal: Syntax sugar for single exit and early exit functions.

2014-11-17 Thread Garrett Smith
On 11/16/14, Biju bijumaill...@gmail.com wrote: [...] Proposal: I wish there was some syntax sugar like function someClickHandler(){ doStuff(); doAnotherStuff(); doYetAnotherStuff(); } finally { return false; } function rf() { try { throw-an-error; } finally {

Re: Having a non-enumerable Array.prototype.contains may not beweb-compatible

2014-10-07 Thread Garrett Smith
Old sites with old version of Mootools will have problems when trying to use native Array.prototype.contains. Is that the only problem or is there something else I'm missing? On 10/7/14, Andrea Giammarchi andrea.giammar...@gmail.com wrote: FYI: from a MooTools core developer:

Re: use strict VS setTimeout

2014-09-07 Thread Garrett Smith
On 9/7/14, Domenic Denicola dome...@domenicdenicola.com wrote: I don't understand why this is any more surprising than any other function that calls its callback with .call(something). It doesn't matter whether the callback is strict or not; .call(window), which is what the spec does, will

Re: use strict VS setTimeout

2014-09-07 Thread Garrett Smith
On 9/7/14, Mark Miller erig...@gmail.com wrote: On Sun, Sep 7, 2014 at 11:27 AM, Domenic Denicola dome...@domenicdenicola.com wrote: I don't understand why this is any more surprising than any other function that calls its callback with .call(something). The issue is what the something

Re: use strict VS setTimeout

2014-09-07 Thread Garrett Smith
On 9/7/14, Andrea Giammarchi andrea.giammar...@gmail.com wrote: **implicitly fail** from a user point of view that used use strict to avoid receiving the global context in there ... I am not sure how much you want to turn it back to me but you are missing the point and I've not much else to

Re: use strict VS setTimeout

2014-09-07 Thread Garrett Smith
On 9/7/14, Andrea Giammarchi andrea.giammar...@gmail.com wrote: this is getting nowhere ... yeah Garret, you can use `.call` and we all know that ... Now I want you to answer this: why on earth would you expect a global context in a setTimeout or setInterval operation for a function/method

Re: Exotic OBJECT?

2014-08-13 Thread Garrett Smith
On 8/12/14, Allen Wirfs-Brock al...@wirfs-brock.com wrote: On Aug 12, 2014, at 7:52 PM, Garrett Smith wrote: On 8/12/14, Allen Wirfs-Brock al...@wirfs-brock.com wrote: On Aug 12, 2014, at 2:17 PM, Garrett Smith wrote: On 8/12/14, Allen Wirfs-Brock al...@wirfs-brock.com wrote

Exotic OBJECT?

2014-08-12 Thread Garrett Smith
What's the explanation and reason for this strange characteristic of the OBJECT element in Firefox? Firefox 31: typeof document.createElement(object) function Function.prototype.toString.call(document.createElement(object)); TypeError: Function.prototype.toString called on incompatible object If

Re: Exotic OBJECT?

2014-08-12 Thread Garrett Smith
On 8/12/14, Claude Pache claude.pa...@gmail.com wrote: Le 12 août 2014 à 18:44, Garrett Smith dhtmlkitc...@gmail.com a écrit : What's the explanation and reason for this strange characteristic of the OBJECT element in Firefox? Firefox 31: typeof document.createElement(object) function

Re: Exotic OBJECT?

2014-08-12 Thread Garrett Smith
On 8/12/14, Allen Wirfs-Brock al...@wirfs-brock.com wrote: Allen - On Aug 12, 2014, at 9:44 AM, Garrett Smith wrote: What's the explanation and reason for this strange characteristic of the OBJECT element in Firefox? Firefox 31: typeof document.createElement(object) function

Re: Exotic OBJECT?

2014-08-12 Thread Garrett Smith
On 8/12/14, Allen Wirfs-Brock al...@wirfs-brock.com wrote: On Aug 12, 2014, at 2:17 PM, Garrett Smith wrote: On 8/12/14, Allen Wirfs-Brock al...@wirfs-brock.com wrote: [...] | Function.prototype.toString | ... | | The toString function is not generic; it throws a | TypeError exception

Re: Array.prototype.contains

2014-07-24 Thread Garrett Smith
On 7/24/14, Andrea Giammarchi andrea.giammar...@gmail.com wrote: What is this about? Not an answer nor a solution to what I've said... Just think that NaN is rarely an explicit value, rather something potentially generated at runtime. Would you .some(Number.isNAN.bind(Number)) all the Arrays?

Re: Array.prototype.contains

2014-07-23 Thread Garrett Smith
On 7/23/14, Maël Nison nison.m...@gmail.com wrote: Isn't replacing DOMStringList a different issue than adding Array.prototype.contains ? Using indexOf is possible, but a .contains() method would give a stronger notice of intent when reading code. So too, for cases of removing an item,

Re: Array.prototype.contains

2014-07-23 Thread Garrett Smith
On 7/23/14, Andrea Giammarchi andrea.giammar...@gmail.com wrote: agreed, already imagining loops like ```js while (arr.contains(value)) arr.remove(value); ``` although that looks a bit nicer than ```js var i; while (-1 (i = arr.indexOf(value))) arr.splice(i, 1); ``` my main concern

Re: TC39 vs the community

2014-06-26 Thread Garrett Smith
Nice. I wonder what Horse would think of Vermin Supreme's pony identification program. But in all seriousness, Google, MSFT, are all pushing for IoT or wearables by putting on events featuring that, creating a buzz, and making press on the event. On 6/23/14, Brendan Eich bren...@mozilla.org

Re: TC39 vs the community

2014-06-24 Thread Garrett Smith
On 6/23/14, joe joe...@gmail.com wrote: And here I thought you were making an educated argument with your explanation of the history of propaganda and public relations. When I first read corporate propaganda, I thought you mean the propaganda of JS developers, not commercial corporations.

Re: TC39 vs the community

2014-06-22 Thread Garrett Smith
On 6/20/14, David Bruant bruan...@gmail.com wrote: Hi, I'm not quite sure what this is all about, so forking in hope for clarifications. I'm sorry to send a message that will probably be read as noise by a lot of people, but I'm also tired of some of these pointless and unconstructive, if

Re: The initialization steps for Web browsers

2014-06-10 Thread Garrett Smith
On 6/10/14, Ian Hickson i...@hixie.ch wrote: On Tue, 10 Jun 2014, Allen Wirfs-Brock wrote: Hi Ian; Allen. (Also, how could step 6's substeps ever get triggered?) Working backwards, step 5 does many things, some of which are specified as having error conditions and exceptions, so I have to

Re: Date Object Doesn't Work.

2014-05-29 Thread Garrett Smith
On 5/28/14, Andrea Giammarchi andrea.giammar...@gmail.com wrote: Hi Andrea - While I agree we should expect consistent results, you might get more consistent one via UTC time, i.e. ``` var r = new Date(2013, 02, 10), r2 = new Date(2013, 02, 10), diff = 7; r.setUTCHours(2 + diff);

Date Object Doesn't Work.

2014-05-28 Thread Garrett Smith
Yesterday, I posed the question about an event starts at 2am, 2014, and ends immediately after 3 am, on May 9, how long is it? The event, in that case, should be 23 hours due to 1h DST loss. (spring forward). But then I noticed more anomalies: !doctype html head titletest DST 1/title style

Re: [whatwg] Date Update?

2014-05-27 Thread Garrett Smith
On 5/25/14, Norbert Lindenberg ecmascr...@lindenbergsoftware.com wrote: On May 19, 2014, at 11:34 , Garrett Smith dhtmlkitc...@gmail.com wrote: On 1/19/14, Norbert Lindenberg ecmascr...@lindenbergsoftware.com wrote: On Jan 19, 2014, at 10:01 , Jasper St. Pierre jstpie...@mecheye.net wrote

Re: [whatwg] Date Update?

2014-05-27 Thread Garrett Smith
On 5/27/14, Garrett Smith dhtmlkitc...@gmail.com wrote: Question: If the even starts at 2am and ends immediately after 3 am, on May 9, how long is it? Correction: Mar 9, not May 9. -- Garrett @xkit ChordCycles.com garretts.github.io ___ es-discuss

Re: Integrating the Webs' dependency systems

2014-05-23 Thread Garrett Smith
On 5/23/14, Ian Hickson i...@hixie.ch wrote: On Fri, 23 May 2014, Ryosuke Niwa wrote: On May 23, 2014, at 3:14 PM, Ian Hickson i...@hixie.ch wrote: Hi guys - - script needs= in HTML Could someone give me a pointer about this? This is the first time I've heard of this feature. It's a

FunctionDeclaration as an element of a Block statement's StatementList

2014-05-20 Thread Garrett Smith
Prior to the Sixth Edition, the ECMAScript specification did not define the occurrence of a FunctionDeclaration as an element of a Block statement's StatementList. The problem is not necessarily that FunctionDeclaration appears in a Block, that FunctionDeclatation appears in places in a program

Error Instances Stack Property

2014-05-20 Thread Garrett Smith
Should Error Instance have a standard `stack` property? Seems to be a very common feature nowadays. Why isn't it being specified in EcmaScript 6? https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/stack Thanks, -- Garrett @xkit ChordCycles.com

Re: [whatwg] Date Update?

2014-05-19 Thread Garrett Smith
On 1/19/14, Norbert Lindenberg ecmascr...@lindenbergsoftware.com wrote: On Jan 19, 2014, at 10:01 , Jasper St. Pierre jstpie...@mecheye.net wrote: On Sunday, January 19, 2014, Garrett Smith dhtmlkitc...@gmail.com wrote: What considerations are there for codifying the behavior

Re: [whatwg] Date Update?

2014-05-19 Thread Garrett Smith
On 5/19/14, Garrett Smith dhtmlkitc...@gmail.com wrote: On 1/19/14, Norbert Lindenberg ecmascr...@lindenbergsoftware.com wrote: On Jan 19, 2014, at 10:01 , Jasper St. Pierre jstpie...@mecheye.net wrote: On Sunday, January 19, 2014, Garrett Smith dhtmlkitc...@gmail.com wrote: What

Re: Function Syntax

2011-05-11 Thread Garrett Smith
On 5/10/11, Allen Wirfs-Brock al...@wirfs-brock.com wrote: On May 10, 2011, at 4:53 PM, Douglas Crockford wrote: I look at ECMAScript as serving four groups: 1. The beginners for whom the language was designed. 2. The web developers who owe their livelihoods to the language. Library users.

Re: arrow syntax unnecessary and the idea that function is too long

2011-05-10 Thread Garrett Smith
On 5/10/11, Oliver Hunt oli...@apple.com wrote: [...] I think I'd prefer the #{ expr } or #(args...){ expr } syntaxes simply to\ What good is Arguments? [...] * Generalised object subtyping * Probably Mark's simple map and set APIs -- these can be implemented in\ If it's wish list time,

Re: arrow syntax unnecessary and the idea that function is too long

2011-05-08 Thread Garrett Smith
On 5/7/11, Faisal Vali fais...@gmail.com wrote: Kyle Simpson get...@gmail.com Date: Sat, 7 May 2011 21:58:32 -0500 Subject: Re: arrow syntax unnecessary and the idea that function is too long snip With all due respect, Brendan's personal tastes on what kind of code he likes to write is

Re: arrow syntax unnecessary and the idea that function is too long

2011-05-07 Thread Garrett Smith
On 5/7/11, Isaac Schlueter i...@izs.me wrote: [...] Blocks in JS are useless, can't we just do away with them? Blocks are required for many productions such as try/catch/finally. Almost all existing code uses blocks to group statements together. Blocks can't be removed. -- Garrett

Re: Best practices for exception handling?

2011-04-29 Thread Garrett Smith
On 4/29/11, Dmitry A. Soshnikov dmitry.soshni...@gmail.com wrote: On 30.04.2011 0:22, Axel Rauschmayer wrote: With JavaScript, is throwing a string considered bad style (now or in the future)? That is, is throwing a new Error(msg) better than throwing msg directly? Why? To get a meaningful

Re: Automatic Semicolon Insertion: value vs cost; predictabilityandcontrol; alternatives

2011-04-19 Thread Garrett Smith
On 4/19/11, Brendan Eich bren...@mozilla.com wrote: On Apr 19, 2011, at 8:39 AM, Isaac Schlueter wrote: This style is more easily scanned. The important tokens are along the left edge, which forms a straight line with logical and orderly breaks, and those tokens are not overused, so their

Re: Automatic Semicolon Insertion: value vs cost; predictabilityandcontrol; alternatives

2011-04-19 Thread Garrett Smith
On 4/19/11, Isaac Schlueter i...@izs.me wrote: On Tue, Apr 19, 2011 at 11:02, Garrett Smith dhtmlkitc...@gmail.com wrote: On 4/19/11, Brendan Eich bren...@mozilla.com wrote: I don't mean to annoy by repeating the same things, but here goes: Is `()` Grouping Operator or Arguments

Re: Automatic Semicolon Insertion: value vs cost; predictabilityandcontrol; alternatives

2011-04-19 Thread Garrett Smith
On 4/19/11, Brendan Eich bren...@mozilla.com wrote: On Apr 19, 2011, at 3:08 PM, Garrett Smith wrote: On 4/19/11, Isaac Schlueter i...@izs.me wrote: ASI didn't change the program behavior. ASI didn't happen in that example. Isaac is correct. Newline elision changed the program behavior

Re: Automatic Semicolon Insertion: value vs cost; predictabilityandcontrol; alternatives

2011-04-19 Thread Garrett Smith
On 4/19/11, Garrett Smith dhtmlkitc...@gmail.com wrote: On 4/19/11, Brendan Eich bren...@mozilla.com wrote: On Apr 19, 2011, at 3:08 PM, Garrett Smith wrote: On 4/19/11, Isaac Schlueter i...@izs.me wrote: ASI didn't change the program behavior. ASI didn't happen in that example. Isaac

Re: Automatic Semicolon Insertion: value vs cost; predictabilityandcontrol; alternatives

2011-04-19 Thread Garrett Smith
On 4/19/11, Brendan Eich bren...@mozilla.com wrote: [...] But good point. Indeed, feel free to file a bug at https://bugzilla.mozilla.org asking for such a warning. I'll support it. I'll do it. -- Garrett ___ es-discuss mailing list

Re: Automatic Semicolon Insertion: value vs cost; predictabilityandcontrol; alternatives

2011-04-19 Thread Garrett Smith
On 4/19/11, Brendan Eich bren...@mozilla.com wrote: [...] You are asking for an warning when a file ends without a semicolon required by the grammar, and ASI kicks in. Fair point, good idea. It's not going to do enough by itself, since warnings are easy to miss, and often annoy the wrong party

Re: Automatic Semicolon Insertion: value vs cost; predictabilityandcontrol; alternatives

2011-04-18 Thread Garrett Smith
On 4/18/11, Claus Reinke claus.rei...@talk21.com wrote: The only places where semicolons are ever used in the Node.js package manager are in the 'for' loops headers and at the *beginning* of the lines that would be interpreted incorrectly because of the lack of the semicolon at the end of the

Re: Automatic Semicolon Insertion: value vs cost; predictability and control; alternatives

2011-04-17 Thread Garrett Smith
On 4/17/11, Brendan Eich bren...@mozilla.com wrote: On Apr 17, 2011, at 10:52 AM, Claus Reinke wrote: [TLDR] ASI is not going to be removed. I don't know why you think it could be. Why not? Iif developers would stop doing that then eventually, can't it be removed? It is not hard at all to

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

2011-04-17 Thread Garrett Smith
On 4/17/11, Mike Ratcliffe mratcli...@mozilla.com wrote: I remember going over a few hundred thousand lines of JavaScript and adding semicolons because I had decided to minify it. I also remember that for months I was receiving bug reports from sections of code where I had missed the

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

2011-04-17 Thread Garrett Smith
On 4/17/11, Allen Wirfs-Brock al...@wirfs-brock.com wrote: On Apr 17, 2011, at 12:33 PM, Mike Ratcliffe wrote: ... Personally I would welcome some kind of option to disable ASI with open arms. Garrett's strict mode warning idea makes sense to me but I am fairly certain that not everybody

Re: Automatic Semicolon Insertion: value vs cost; predictability and control; alternatives

2011-04-17 Thread Garrett Smith
On 4/17/11, Jason Orendorff jason.orendo...@gmail.com wrote: On Sun, Apr 17, 2011 at 12:07 PM, Garrett Smith dhtmlkitc...@gmail.com wrote: On 4/17/11, Brendan Eich bren...@mozilla.com wrote: On Apr 17, 2011, at 10:52 AM, Claus Reinke wrote: [TLDR] ASI is not going to be removed. I don't know

Re: Automatic Semicolon Insertion: value vs cost; predictability and control; alternatives

2011-04-17 Thread Garrett Smith
On 4/17/11, Mikeal Rogers mikeal.rog...@gmail.com wrote: do modern javascript implementations actually insert semicolons? Function.prototype.toString says yes. ___ es-discuss mailing list es-discuss@mozilla.org

Re: Automatic Semicolon Insertion: value vs cost; predictability and control; alternatives

2011-04-17 Thread Garrett Smith
On 4/17/11, Wes Garland w...@page.ca wrote: On 17 April 2011 20:09, Garrett Smith dhtmlkitc...@gmail.com wrote: Function.prototype.toString says yes. That's not a really valid evaluation IMO. At least in mozilla's case, the semi colon appears in this by virtue of the bytecode decompiler

Re: Existential operator

2011-04-15 Thread Garrett Smith
On 4/14/11, Brendan Eich bren...@mozilla.com wrote: There is no ambiguity problem with ? followed by . and then (with whitespace allowed, of course) an IdentifierName. We need the lookahead to an identifier-name starting-character to avoid this: var tolerance = big ?.1:.01; So we can't

Re: Existential operator

2011-04-13 Thread Garrett Smith
On 4/13/11, Kyle Simpson get...@gmail.com wrote: See http://wiki.ecmascript.org/doku.php?id=strawman:default_operator -- the proposal there is ?? and ??= since single ? is ambiguous after an expression due to conditional expressions (?:). The default operator doesn't address a significant

Re: 'this' is more complicated than I thought (PropertyReferences break equivalences)

2011-04-11 Thread Garrett Smith
On 4/11/11, Claus Reinke claus.rei...@talk21.com wrote: Like most Javascript programmers, I have tended to follow a simple rule for functions using 'this': eta-expand method selections, use .bind, or get into trouble. That is unnecessary and inefficient. Instead, I use the following algorithm:

Re: 'this' is more complicated than I thought (PropertyReferences break equivalences)

2011-04-11 Thread Garrett Smith
On 4/11/11, Claus Reinke claus.rei...@talk21.com wrote: Like most Javascript programmers, I have tended to follow a simple rule for functions using 'this': eta-expand method selections, use .bind, or get into trouble. That is unnecessary, inefficient, and adds clutter. That most JavaScript

Re: Standardizing out-of-memory and stack-depth-exceeded errors?

2011-03-23 Thread Garrett Smith
On 3/22/11, Joshua Bell j...@lindenlab.com wrote: I was noodling with a (toy) compiler-to-JS for a (dead) language that supports error handlers for two boundary conditions - stack depth exceeded out of memory - and noticed that the relevant behavior in JS is not standard across browsers. Has

Re: Standardizing out-of-memory and stack-depth-exceeded errors?

2011-03-23 Thread Garrett Smith
On 3/23/11, Mike Shaver mike.sha...@gmail.com wrote: On Wed, Mar 23, 2011 at 6:21 PM, Garrett Smith dhtmlkitc...@gmail.com wrote: javascript: alert(new InternalError(Got on tha inside, bitch!)); Hrm. seems odd to expose the constructor publicly. Necessary to permit instanceof testing

Re: Standardizing out-of-memory and stack-depth-exceeded errors?

2011-03-23 Thread Garrett Smith
Bad quoting made it confusing, but I was (am) right. Edited as intended below: On 3/23/11, Garrett Smith dhtmlkitc...@gmail.com wrote: On 3/23/11, Mike Shaver mike.sha...@gmail.com wrote: On Wed, Mar 23, 2011 at 6:21 PM, Garrett Smith dhtmlkitc...@gmail.com wrote: javascript: alert(new

Re: Standardizing out-of-memory and stack-depth-exceeded errors?

2011-03-23 Thread Garrett Smith
On 3/23/11, Mike Shaver mike.sha...@gmail.com wrote: On Wed, Mar 23, 2011 at 8:21 PM, Garrett Smith dhtmlkitc...@gmail.com wrote: Bad quoting made it confusing, but I was (am) right. Edited as intended below: On 3/23/11, Garrett Smith dhtmlkitc...@gmail.com wrote: On 3/23/11, Mike Shaver

Re: Standardizing __proto__

2011-03-21 Thread Garrett Smith
On 3/18/11, Kyle Simpson get...@gmail.com wrote: There's LOTS of sites out there that still (unfortunately) do unsafe overwriting/overloading of the native's prototypes. For instance, just a few months ago, I ran across a site that was creating a Array.prototype.push() implementation that was

Re: HTML5 spec. seems to unnecessarily ban strict mode event handlers

2011-03-17 Thread Garrett Smith
On 3/17/11, Juriy Zaytsev kan...@gmail.com wrote: Thanks for bringing this quirk to the surface. I remember being puzzled by the presence of this wording in HTML5 spec but never got a chance to do anything about it. By non-standard I meant not part of ECMA-262 standard (not that it's not

Re: HTML5 spec. seems to unnecessarily ban strict mode event handlers

2011-02-03 Thread Garrett Smith
On 2/3/11, Allen Wirfs-Brock al...@wirfs-brock.com wrote: I was browsing Kangax's strict mode test result page (http://kangax.github.com/es5-compat-table/strict-mode/ ) and I noticed that he listed the recognition of a use strict directive of a event handler as a non-standard feature that he

Re: HTML5 spec. seems to unnecessarily ban strict mode event handlers

2011-02-03 Thread Garrett Smith
On 2/3/11, Allen Wirfs-Brock al...@wirfs-brock.com wrote: Regarding the call language, it would probably be best if it was described in terms of invoking the [[Call]] internal method of the handler's function object. However, that might be unnecessary if if the WebIDL ECMASCript binding makes

Re: substitutes for arguments and arguments.callee in ECMAScript 5

2011-01-06 Thread Garrett Smith
On 1/5/11, Allen Wirfs-Brock al...@wirfs-brock.com wrote: [...] the function expression form has a well-defined meaning anywhere including in the compound statement blocks such as if-statements. The meaning of the latter two declaration forms are not defined by the standard when they occur

Re: Private names use cases

2010-12-20 Thread Garrett Smith
On 12/20/10, Allen Wirfs-Brock al...@wirfs-brock.com wrote: I've seen mentions in the recent thread that the goal of the Private Names proposal was to support private fields for objects. While that may be a goal of some participants in the discussion, it is not what I would state as the goal.

Re: Function declarations as statements

2010-11-11 Thread Garrett Smith
On 11/11/10, Michael Day mike...@yeslogic.com wrote: Hi Brendan and Allen, Thanks for the pointers. So for Harmony, we are reclaiming function in block (must be a direct child of a braced block) to bind a block-local name on block entry (so hoisting lives, but only to top of block -- so you

Re: Can DOM methods be native Function objects?

2010-10-11 Thread Garrett Smith
On 10/10/10, Mark S. Miller erig...@google.com wrote: On Mon, Oct 11, 2010 at 5:54 AM, Garrett Smith dhtmlkitc...@gmail.comwrote: [...] And that brings me to my next point: AIUI, host objects have two types. We discussed this before... (searching archives...) | The specification allows

Re: Can DOM methods be native Function objects?

2010-10-10 Thread Garrett Smith
On 10/10/10, Brendan Eich bren...@mozilla.com wrote: On Oct 10, 2010, at 4:14 PM, Mark S. Miller wrote: My interpretation is that the spec in this regard is consistent with reality as intended and is not an ass. (Somewhat disconcerting to hear hints of the spec being called an ass.) Could

Re: Can DOM methods be native Function objects?

2010-10-10 Thread Garrett Smith
On 10/10/10, Garrett Smith dhtmlkitc...@gmail.com wrote: On 10/10/10, Brendan Eich bren...@mozilla.com wrote: On Oct 10, 2010, at 4:14 PM, Mark S. Miller wrote: [...] Here I use native functions to mean either the built-in functions of ES5 clause 15, or the DOM built-in functions

Re: Rationalizing ASI (was: simple shorter function syntax)

2010-07-27 Thread Garrett Smith
On 7/25/10, Mark S. Miller erig...@google.com wrote: On Sun, Jul 25, 2010 at 11:36 AM, Brendan Eich bren...@mozilla.com wrote: On Jul 25, 2010, at 10:52 AM, Mark S. Miller wrote: The problem is that as long as ASI exists, one will often see working code such as this, since it does usually

Re: [[Class]] Property of Host Object

2010-07-23 Thread Garrett Smith
On 7/22/10, Mark S. Miller erig...@google.com wrote: On Thu, Jul 22, 2010 at 11:16 PM, David Flanagan da...@davidflanagan.comwrote: Allen, The host vs. native distinction has long bothered me as well. Thanks for a particularly lucid explanation. In the next edition of the spec, perhaps

Re: [[Class]] Property of Host Object

2010-07-18 Thread Garrett Smith
On 7/18/10, Allen Wirfs-Brock allen.wirfs-br...@microsoft.com wrote: The more important issue is our intent regarding the definitions of host and native objects. First regarding, alert in IE. Historically it is what it is and nobody should make any assumptions concerning the future based

Re: [[Class]] Property of Host Object

2010-07-17 Thread Garrett Smith
On 7/16/10, Mark S. Miller erig...@google.com wrote: On Fri, Jul 16, 2010 at 9:54 PM, Garrett Smith dhtmlkitc...@gmail.comwrote: I have a question reqarding [[Class]] property as defined In ES5: | The value of the [[Class]] internal property of a host object | may be any String value except

Re: [[Class]] Property of Host Object

2010-07-17 Thread Garrett Smith
On 7/17/10, Mark S. Miller erig...@google.com wrote: [+es5-discuss as a possible errata issue arises below] On Sat, Jul 17, 2010 at 12:37 AM, Garrett Smith dhtmlkitc...@gmail.comwrote: On 7/16/10, Mark S. Miller erig...@google.com wrote: On Fri, Jul 16, 2010 at 9:54 PM, Garrett Smith

[[Class]] Property of Host Object

2010-07-16 Thread Garrett Smith
I have a question reqarding [[Class]] property as defined In ES5: | The value of the [[Class]] internal property of a host object | may be any String value except one of Arguments, Array, | Boolean, Date, Error, Function, JSON, Math, Number, | Object, RegExp, and String May it be something other

Re: RE: JSON parser grammar

2010-06-22 Thread Garrett Smith
On 6/3/09, Douglas Crockford doug...@crockford.com wrote: Allen Wirfs-Brock wrote: JSON.parse([010]) should be an error, per spec. Nobody follows the spec though... As I read them neither the RFC or the current ES5 JSON grammar recognize [010] as a valid JSON form, so according to the ES5

Re: JSON parser grammar

2010-06-22 Thread Garrett Smith
On 6/22/10, Luke Smith lsm...@lucassmith.name wrote: On Jun 22, 2010, at 7:20 PM, Oliver Hunt wrote: On Jun 22, 2010, at 7:07 PM, Dean Landolt wrote: On Tue, Jun 22, 2010 at 9:34 PM, Oliver Hunt oli...@apple.com wrote: [...] As far as I can tell, all the major browsers accept tabs, as

Re: JSONNumber - optional decimal

2010-06-15 Thread Garrett Smith
On 6/10/10, Sigbjorn Finne sigbjorn.fi...@gmail.com wrote: Hi Garrett, On 6/9/2010 05:46, Garrett Smith wrote: ... IF anyone has a correct JSON parser, I would appreciate it. Also, are there any good test suites for JSON? http://testsuites.opera.com/JSON/ is one. Hallvord Steen has

Re: JSONNumber - optional decimal

2010-06-09 Thread Garrett Smith
On 6/8/10, Oliver Hunt oli...@apple.com wrote: On Jun 8, 2010, at 8:46 PM, Garrett Smith wrote: [...] IF anyone has a correct JSON parser, I would appreciate it. Also, are there any good test suites for JSON? I spent quite a bit of time ensuring JSC's JSON parser exactly matched the spec

JSONNumber - optional decimal

2010-06-08 Thread Garrett Smith
Today I looked for a good json regexp tester and finding nothing, decided to write one. The strategy that occurred to me was to first define a regex for the literal components (ES5 lumps literal value into the JSONValue alongside JSONObject and JSONArray). That way, I could reuse the literal

Re: Adoption of the Typed Array Specification

2010-05-13 Thread Garrett Smith
On Thu, May 13, 2010 at 5:34 PM, Mark S. Miller erig...@google.com wrote: On Thu, May 13, 2010 at 5:15 PM, Vladimir Vukicevic vladi...@mozilla.com wrote: This is difficult to do, given the goals of typed arrays -- they wouldn't behave like normal Arrays in most meaningful ways.  At the core,

Re: Where to Report Spec Errata?

2010-05-10 Thread Garrett Smith
Grammar Ok, got it. Allen -Original Message- From: es-discuss-boun...@mozilla.org [mailto:es-discuss- boun...@mozilla.org] On Behalf Of Garrett Smith Sent: Sunday, May 09, 2010 4:32 PM To: Mark S. Miller Cc: es5-disc...@mozilla.org; es-discuss; Erik Arvidsson Subject: Re: Where

Where to Report Spec Errata?

2010-05-09 Thread Garrett Smith
Where is the right place to report errata in the ES5 specification? ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Where to Report Spec Errata?

2010-05-09 Thread Garrett Smith
On Sun, May 9, 2010 at 3:56 PM, Mark S. Miller erig...@google.com wrote: On Sun, May 9, 2010 at 3:50 PM, Erik Arvidsson erik.arvids...@gmail.com wrote: On Sun, May 9, 2010 at 15:19, Garrett Smith dhtmlkitc...@gmail.com wrote: Where is the right place to report errata in the ES5

Re: Function.prototype.bind

2010-05-01 Thread Garrett Smith
On Sat, May 1, 2010 at 7:13 AM, Brendan Eich bren...@mozilla.com wrote: On May 1, 2010, at 3:28 AM, Jürg Lehni wrote: On 1 May 2010, at 01:50, Brendan Eich wrote: [...] Odd, that is neither fish nor fowl. Does any other library have such a bind? Anyway, Moo was not around when TC39 was

Re: Function.prototype.bind

2010-05-01 Thread Garrett Smith
On Fri, Apr 30, 2010 at 11:07 PM, Brendan Eich bren...@mozilla.com wrote: On Apr 30, 2010, at 10:28 PM, Garrett Smith wrote: It could be that we missed a chance to add Function.bind(callable, thisObj, argsArray). Adding such a static method might have provided the desired common utility

Re: Function.prototype.bind

2010-04-30 Thread Garrett Smith
On Fri, Apr 30, 2010 at 5:50 PM, Brendan Eich bren...@mozilla.com wrote: On Apr 30, 2010, at 5:33 PM, Jürg Lehni wrote: [...] Yes, jQuery nicely avoids the whole prototype issue. What do the spec contributors have to say about scripts that modify built-ins? The concept don't modify objects

Re: three small proposals: the bikeshed cometh!

2010-04-29 Thread Garrett Smith
On Thu, Apr 29, 2010 at 12:25 AM, Alex Russell a...@dojotoolkit.org wrote: Some small, pre-colored panels for the shed. Given that these are mostly matters of syntax and not semantics, please believe me when I suggest that the warts discussed herein present sharp edges that should be rounded

  1   2   >