Re: [caplet] Am I paranoid enough?

2009-02-17 Thread David-Sarah Hopwood
Mike Samuel wrote: 2009/2/16 David-Sarah Hopwood david.hopw...@industrial-designers.co.uk Suppose that S is a Unicode string in which each character matches ValidChar below, not containing the subsequences !, / or ]], and not containing ( followed by a character not matching AmpFollower). S

Re: object literal types

2009-02-17 Thread David-Sarah Hopwood
Michael Haufe wrote: var Point:object = { color:string x:double = 20, y:double = 50, z:double = 3 } - Sorry, typo correction: var Point:object = { color:string = red, x:double =

object literal types

2009-02-17 Thread Michael Haufe
David-Sarah Hopwood wrote: ':' (not '=') is used to separate a property name from its value, so it can't also be used for type annotations. Except in the case of JavaScript's non-standard Sharp Variables (https://developer.mozilla.org/En/Sharp_variables_in_JavaScript), which is what sparked

Re: object literal types

2009-02-17 Thread David-Sarah Hopwood
Michael Haufe wrote: David-Sarah Hopwood wrote: ':' (not '=') is used to separate a property name from its value, so it can't also be used for type annotations. Except in the case of JavaScript's non-standard Sharp Variables

Re: object literal types

2009-02-17 Thread Brendan Eich
On Feb 17, 2009, at 5:07 AM, Michael Haufe wrote: David-Sarah Hopwood wrote: ':' (not '=') is used to separate a property name from its value, so it can't also be used for type annotations. Except in the case of JavaScript's non-standard Sharp Variables

The global object in browsers

2009-02-17 Thread Ian Hickson
Right now ES3 assumes that there is a single global object, which is used at the top of the scope chain and that is returned for this in the global scope. It is possible to show that this is now what some browsers do: var x = 1; function f() { return x; } var global = this;

Re: The global object in browsers

2009-02-17 Thread Mark S. Miller
On Tue, Feb 17, 2009 at 2:02 PM, Ian Hickson i...@hixie.ch wrote: For HTML5, this behaviour has been defined in more detail. The global object is a Window object. This object is per-Document. The object returned by the window attribute on that global object is actually a WindowProxy object,

Re: The global object in browsers

2009-02-17 Thread Mark Miller
On Tue, Feb 17, 2009 at 2:02 PM, Ian Hickson i...@hixie.ch wrote: Now, if the other page's script calls f() and g(), it will get different results (2 and 1 respectively, if I didn't screw up the example code). For HTML5, this behaviour has been defined in more detail. The global object is a

Re: The global object in browsers

2009-02-17 Thread Ian Hickson
On Tue, 17 Feb 2009, Mark S. Miller wrote: I don't understand. If the object you're calling Window is inaccessible from ES code, and if the object you're calling WindowProxy forwards everything to your Window, why not just relabel Window - InternalWindow, WindowProxy - Window? I don't

Re: The global object in browsers

2009-02-17 Thread Ian Hickson
On Tue, 17 Feb 2009, Mark Miller wrote: On Tue, Feb 17, 2009 at 2:02 PM, Ian Hickson i...@hixie.ch wrote: Now, if the other page's script calls f() and g(), it will get different results (2 and 1 respectively, if I didn't screw up the example code). For HTML5, this behaviour has

Re: The global object in browsers

2009-02-17 Thread Brendan Eich
On Feb 17, 2009, at 3:09 PM, Brendan Eich wrote: On Feb 17, 2009, at 2:48 PM, Mark Miller wrote: On Tue, Feb 17, 2009 at 2:02 PM, Ian Hickson i...@hixie.ch wrote: Now, if the other page's script calls f() and g(), it will get different results (2 and 1 respectively, if I didn't screw up

Re: The global object in browsers

2009-02-17 Thread Garrett Smith
On Tue, Feb 17, 2009 at 2:36 PM, Mark S. Miller erig...@google.com wrote: On Tue, Feb 17, 2009 at 2:02 PM, Ian Hickson i...@hixie.ch wrote: The deeper problem here is that ES specs to date -- including the draft ES3.1 spec -- have not yet admitted the existence of multiple global objects. We

Re: The global object in browsers

2009-02-17 Thread Maciej Stachowiak
On Feb 17, 2009, at 2:02 PM, Ian Hickson wrote: Right now ES3 assumes that there is a single global object, which is used at the top of the scope chain and that is returned for this in the global scope. It is possible to show that this is now what some browsers do: var x = 1;

Re: object literal types

2009-02-17 Thread Michael Haufe
Brendan Eich wrote: On Feb 17, 2009, at 5:07 AM, Michael Haufe wrote: David-Sarah Hopwood wrote: ':' (not '=') is used to separate a property name from its value, so it can't also be used for type annotations. Except in the case of JavaScript's non-standard Sharp Variables

Re: The global object in browsers

2009-02-17 Thread Mark Miller
On Tue, Feb 17, 2009 at 3:02 PM, Ian Hickson i...@hixie.ch wrote: Here are some demos. 001 is a control test. If it says false, you have a violation of ES, and are likely incompatible with legacy content. If it says true, then test 002. If 002 says false, then ES is being violated in some

Re: The global object in browsers

2009-02-17 Thread Mark Miller
On Tue, Feb 17, 2009 at 5:03 PM, Ian Hickson i...@hixie.ch wrote: Indeed, I noted this earlier. The behavior HTML5 codifies is the behavior that the majority of browser vendors have asked me to codify. Majority, huh? Which vendors? How does the behavior they ask for correlate with what their

Re: The global object in browsers

2009-02-17 Thread Ian Hickson
On Tue, 17 Feb 2009, Mark Miller wrote: On Tue, Feb 17, 2009 at 5:03 PM, Ian Hickson i...@hixie.ch wrote: Indeed, I noted this earlier. The behavior HTML5 codifies is the behavior that the majority of browser vendors have asked me to codify. Majority, huh? Which vendors? How does the

Re: The global object in browsers

2009-02-17 Thread Brendan Eich
On Feb 17, 2009, at 4:03 PM, ihab.a...@gmail.com wrote: On Tue, Feb 17, 2009 at 3:35 PM, Garrett Smith dhtmlkitc...@gmail.com wrote: That document is not completely readable (at least in Firefox). I see the first heading: roduction. All subsequent headings appear truncted. Rats. Ok, so

Re: The global object in browsers

2009-02-17 Thread Mark Miller
On Tue, Feb 17, 2009 at 5:24 PM, Ian Hickson i...@hixie.ch wrote: Opera, Apple, and Mozilla. The HTML5 spec originally specced what IE does, namely throw an exception when running code whose global object doesn't match the current Window object, but Opera, Apple, and Mozilla rejected this on

Re: The global object in browsers

2009-02-17 Thread Brendan Eich
On Feb 17, 2009, at 6:31 PM, Mark Miller wrote: Now that I think I understand current and how weak the legacy constraints are, why not simply spec that your WindowProxy is the object to treated as the ECMAScript global object? The consequence would be that both f() and g() in your original

RE: The global object in browsers

2009-02-17 Thread Allen Wirfs-Brock
Perhaps this would be a good initial W3C HTML WG/ECMA TC-39 joint work item if we can expeditiously get past the bureaucratic hurdles. The fact that there isn't an existing consensus behavior among the major browsers would seem to present an opportunity to step back a bit and take a new look

Re: The global object in browsers

2009-02-17 Thread Mark Miller
+1 On Tue, Feb 17, 2009 at 5:10 PM, Allen Wirfs-Brock allen.wirfs-br...@microsoft.com wrote: Perhaps this would be a good initial W3C HTML WG/ECMA TC-39 joint work item if we can expeditiously get past the bureaucratic hurdles. The fact that there isn't an existing consensus behavior among

Re: The global object in browsers

2009-02-17 Thread Mark Miller
On Tue, Feb 17, 2009 at 6:38 PM, Brendan Eich bren...@mozilla.com wrote: On Feb 17, 2009, at 6:31 PM, Mark Miller wrote: Now that I think I understand current and how weak the legacy constraints are, why not simply spec that your WindowProxy is the object to treated as the ECMAScript global

Re: The global object in browsers

2009-02-17 Thread Brendan Eich
On Feb 17, 2009, at 8:17 PM, Mark Miller wrote: On Tue, Feb 17, 2009 at 6:38 PM, Brendan Eich bren...@mozilla.com wrote: On Feb 17, 2009, at 6:31 PM, Mark Miller wrote: Now that I think I understand current and how weak the legacy constraints are, why not simply spec that your WindowProxy

Re: The global object in browsers

2009-02-17 Thread Mark Miller
You misunderstood me a bit, but no matter. Now that I better understand the constraints -- thanks! -- what I was trying to say is irrelevant. What I mess. I am at a loss to find anything sensible to recommend. On Tue, Feb 17, 2009 at 9:20 PM, Brendan Eich bren...@mozilla.com wrote: On Feb 17,