JavaScript ECMAScript definitions

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • manno

    JavaScript ECMAScript definitions

    Hi all,

    more or less just out of curiosity...

    I had a short 'discussion' about JavaScript in different borwsers. The
    other guy said that there's differeces in JavaScript accross browsers (I
    assumed he meant apart from versions) "because there's different
    functions".
    I didn't agree because I think that's because of different DOM's. I know
    that for example IE 5.0 (or 5.5?) does not support array.push() (and a
    lot more), but isn't that just sloppy implementation or simply using
    different versions of the language?

    Is it safe to say that one version of JavaScript should be the same
    everywhere except for DOM differences?

    Is JavaScript ECMA-262 with browserspecific elements?

    Thanks in advance,

    Manno
  • Martin Honnen

    #2
    Re: JavaScript ECMAScript definitions



    manno wrote:

    [color=blue]
    > I had a short 'discussion' about JavaScript in different borwsers. The
    > other guy said that there's differeces in JavaScript accross browsers (I
    > assumed he meant apart from versions) "because there's different
    > functions".
    > I didn't agree because I think that's because of different DOM's. I know
    > that for example IE 5.0 (or 5.5?) does not support array.push() (and a
    > lot more), but isn't that just sloppy implementation or simply using
    > different versions of the language?[/color]

    Well, array.push is not part of the DOM at all, its a method of the core
    object Array.

    [color=blue]
    > Is JavaScript ECMA-262 with browserspecific elements?[/color]

    It depends on whom you ask and perhaps it also depends when you ask or
    asked someone.
    With its introduction in the Netscape 2.02 browser there was only one
    implementation of the language and that was in a browser environment but
    there was no ECMAScript standard at all. Later Netscape used its
    JavaScript engine also on the server and documented both client-side
    JavaScript and server-side JavaScript "versions" which consisted of core
    objects specified in ECMAScript and host environment specific objects
    like window, document in client-side JavaScript and server specific
    objects in server-side JavaScript.
    By now Netscape respectively Mozilla has two open-source JavaScript
    engines, one called Spidermonkey implemented in C, the other called
    Rhino imlemented in Java, and there are many different applications that
    use those engines. So you can have JavaScript scripting in many
    environments, not only browser specific ones.
    And the MS JScript scripting engine can also be embedded in many
    different environments, in the IE browser but as well in ASP pages as in
    Windows Script host.

    --

    Martin Honnen


    Comment

    • manno

      #3
      Re: JavaScript ECMAScript definitions

      Martin Honnen wrote:
      [color=blue]
      > Well, array.push is not part of the DOM at all, its a method of the core
      > object Array.[/color]

      I know the array object's functions are no part of any DOM, I was trying
      to go along in the arguments of the guy I argued with. But to go
      _against_ his argument, is it sloppy implementation or just another
      version of JavaScript that IE 5 version uses?
      [color=blue]
      > So you can have JavaScript scripting in many
      > environments, not only browser specific ones.[/color]

      That was more or less why I asked, Flash (and the new Director MX 2004)
      support "ECMAScript-compliant JavaScript syntax", I was wondering if
      this actually could be said of browsers too: "Firefox supports
      ECMAScript-compliant JavaScript syntax".

      All with a different 'DOM' ofcourse.

      Thanks
      Manno

      Comment

      • Martin Honnen

        #4
        Re: JavaScript ECMAScript definitions



        manno wrote:
        [color=blue]
        > Martin Honnen wrote:
        >[color=green]
        >> Well, array.push is not part of the DOM at all, its a method of the
        >> core object Array.[/color]
        >
        >
        > I know the array object's functions are no part of any DOM, I was trying
        > to go along in the arguments of the guy I argued with. But to go
        > _against_ his argument, is it sloppy implementation or just another
        > version of JavaScript that IE 5 version uses?[/color]

        MS calls its implementation of JavaScript/ECMAScript JScript. I think
        IE5 came with JScript 5 and whether at that time ECMAScript edition 3
        was already out I don't remember exactly, I think Windows 98 already
        featured IE5 while the ECMAScript edition 3 standard came out at the end
        of 1999 thus MS was probably not sloppy in implementing that standard
        but rather focussing on other things and waiting for ECMAScript edition
        3 to be finalized.
        --

        Martin Honnen


        Comment

        • Lasse Reichstein Nielsen

          #5
          Re: JavaScript ECMAScript definitions

          manno <manno@xs4all.n l> writes:
          [color=blue]
          > I know the array object's functions are no part of any DOM, I was
          > trying to go along in the arguments of the guy I argued with. But to
          > go _against_ his argument, is it sloppy implementation or just another
          > version of JavaScript that IE 5 version uses?[/color]

          It's JScript, not Javascript. There is no standard for Javascript
          (except perhaps Netscape's documentation for JavaScript).
          What there is, is ECMAScript, as specified by ECMA 262. It is currently
          at version 3. Array.prototype .push was not in ECMA 262 v2, but is in
          v3. It is likely that the versions of JScript shipped with IE 5 was
          based on ECMA 262 v2.
          [color=blue]
          > That was more or less why I asked, Flash (and the new Director MX
          > 2004) support "ECMAScript-compliant JavaScript syntax", I was
          > wondering if this actually could be said of browsers too: "Firefox
          > supports ECMAScript-compliant JavaScript syntax".[/color]

          Sure. And it is just a way of saying "supports ECMAScript" that still
          makes sense for people who think it's all called Javascript.

          /L
          --
          Lasse Reichstein Nielsen - lrn@hotpop.com
          DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleD OM.html>
          'Faith without judgement merely degrades the spirit divine.'

          Comment

          • Dr John Stockton

            #6
            Re: JavaScript ECMAScript definitions

            JRS: In article <40892a9d$1@ola f.komtel.net>, seen in
            news:comp.lang. javascript, Martin Honnen <mahotrash@yaho o.de> posted at
            Fri, 23 Apr 2004 16:39:21 :[color=blue]
            >
            >MS calls its implementation of JavaScript/ECMAScript JScript. I think
            >IE5 came with JScript 5 and whether at that time ECMAScript edition 3
            >was already out I don't remember exactly, I think Windows 98 already
            >featured IE5 while the ECMAScript edition 3 standard came out at the end
            >of 1999 thus MS was probably not sloppy in implementing that standard
            >but rather focussing on other things and waiting for ECMAScript edition
            >3 to be finalized.[/color]

            Windows 98 was released in the UK (on 1998-07-01, IIRC) with MSIE 4
            4.72.3110 SP1 using JScript 3.1.2124 or so it seems.

            --
            © John Stockton, Surrey, UK. ?@merlyn.demon. co.uk Turnpike v4.00 IE 4 ©
            <URL:http://jibbering.com/faq/> Jim Ley's FAQ for news:comp.lang. javascript
            <URL:http://www.merlyn.demo n.co.uk/js-index.htm> jscr maths, dates, sources.
            <URL:http://www.merlyn.demo n.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.

            Comment

            • manno

              #7
              Re: JavaScript ECMAScript definitions

              Lasse Reichstein Nielsen wrote:

              Thanks both for enlightning stuff a bit. I realise reading my questions
              that I may not have been really clear.

              About the JScript in IE. I was aware of JScript, but thought it was
              totally seperate from JavaScript (never bothered to look at it except
              for minimal serverside scripting).
              But if IE calls it JScript and doesn't run JavaScript, what happens with
              the type and language attribute of the script tag if set to
              "text/JavaScript" and "JavaScript{ver sion}"?

              Manno

              Comment

              • Java  script  Dude

                #8
                Re: JavaScript ECMAScript definitions

                manno <manno@xs4all.n l> wrote in message news:<40891a11$ 0$559$e4fe514c@ news.xs4all.nl> ...[color=blue]
                > Hi all,
                >
                > more or less just out of curiosity...
                >
                > I had a short 'discussion' about JavaScript in different borwsers. The
                > other guy said that there's differeces in JavaScript accross browsers (I
                > assumed he meant apart from versions) "because there's different
                > functions".
                > I didn't agree because I think that's because of different DOM's. I know
                > that for example IE 5.0 (or 5.5?) does not support array.push() (and a
                > lot more), but isn't that just sloppy implementation or simply using
                > different versions of the language?
                >
                > Is it safe to say that one version of JavaScript should be the same
                > everywhere except for DOM differences?
                >
                > Is JavaScript ECMA-262 with browserspecific elements?
                >
                > Thanks in advance,
                >
                > Manno[/color]

                IE 5.5+ supports array.push(), IE Mac does not.

                Comment

                • Martin Honnen

                  #9
                  Re: JavaScript ECMAScript definitions



                  Dr John Stockton wrote:
                  [color=blue]
                  > JRS: In article <40892a9d$1@ola f.komtel.net>, seen in
                  > news:comp.lang. javascript, Martin Honnen <mahotrash@yaho o.de> posted at
                  > Fri, 23 Apr 2004 16:39:21 :
                  >[color=green]
                  >>MS calls its implementation of JavaScript/ECMAScript JScript. I think
                  >>IE5 came with JScript 5 and whether at that time ECMAScript edition 3
                  >>was already out I don't remember exactly, I think Windows 98 already
                  >>featured IE5 while the ECMAScript edition 3 standard came out at the end
                  >>of 1999 thus MS was probably not sloppy in implementing that standard
                  >>but rather focussing on other things and waiting for ECMAScript edition
                  >>3 to be finalized.[/color]
                  >
                  >
                  > Windows 98 was released in the UK (on 1998-07-01, IIRC) with MSIE 4
                  > 4.72.3110 SP1 using JScript 3.1.2124 or so it seems.[/color]

                  Somehow I still associate some IE5 release with some Windows 98 release,
                  I think there is also Windows 98 second edition (Windows 98 2 ED), maybe
                  that came with IE5 and was still out before the ECMAScript edition 3
                  specification.


                  --

                  Martin Honnen


                  Comment

                  • Thomas 'PointedEars' Lahn

                    #10
                    Re: JavaScript ECMAScript definitions

                    manno wrote:[color=blue]
                    > About the JScript in IE. I was aware of JScript, but thought it was
                    > totally seperate from JavaScript [...][/color]

                    It is. Nevertheless both JavaScript and JScript are ECMAScript
                    implementations (actually, JScript claims to be one while JavaScript is
                    one), so they share common objects and methods. However, since objects and
                    methods may be (and actually are) implemented differently. ECMAScript is a
                    language to be implemented and the language specification makes clear where
                    a conforming implementation has certain liberties.
                    [color=blue]
                    > But if IE calls it JScript and doesn't run JavaScript, what happens with
                    > the type and language attribute of the script tag if set to
                    > "text/JavaScript" and "JavaScript{ver sion}"?[/color]

                    It executes it anyway, using an engine that supports both JScript and VBScript.


                    PointedEars

                    Comment

                    • Jim Ley

                      #11
                      Re: JavaScript ECMAScript definitions

                      On Mon, 03 May 2004 05:35:07 +0200, Thomas 'PointedEars' Lahn
                      <PointedEars@we b.de> wrote:
                      [color=blue]
                      >manno wrote:[color=green]
                      >> About the JScript in IE. I was aware of JScript, but thought it was
                      >> totally seperate from JavaScript [...][/color]
                      >
                      >It is. Nevertheless both JavaScript and JScript are ECMAScript
                      >implementation s (actually, JScript claims to be one while JavaScript is
                      >one),[/color]

                      Sorry, why do you claim a distinction, the number of non-conformance
                      to the specs is minimal in both implementations , but both
                      implementations have them. JavaScript is certainly not a conformant
                      implementation any more than JScript is.
                      [color=blue]
                      >It executes it anyway, using an engine that supports both JScript and VBScript.[/color]

                      The core Script Engine doesn't support both JScript and VBScript,
                      there's a host engine which supports any ActiveScripting language, and
                      there's seperate implementations of JScript and VBScript - delete
                      vbscript.dll from your windows box and JScript still works fine.

                      Jim.
                      --
                      comp.lang.javas cript FAQ - http://jibbering.com/faq/

                      Comment

                      • Thomas 'PointedEars' Lahn

                        #12
                        Re: JavaScript ECMAScript definitions

                        Jim Ley wrote:
                        [color=blue]
                        > Thomas 'PointedEars' Lahn <PointedEars@we b.de> wrote:[color=green]
                        >> manno wrote:[color=darkred]
                        >>> About the JScript in IE. I was aware of JScript, but thought it was
                        >>> totally seperate from JavaScript [...][/color]
                        >>
                        >> It is. Nevertheless both JavaScript and JScript are ECMAScript
                        >> implementations (actually, JScript claims to be one while JavaScript is
                        >> one),[/color]
                        >
                        > Sorry, why do you claim a distinction, the number of non-conformance to
                        > the specs is minimal in both implementations , but both implementations
                        > have them. JavaScript is certainly not a conformant implementation any
                        > more than JScript is.[/color]

                        Two obvious reasons: For example, I know of versions of JScript which yield
                        a script error even if one only tests *if* a property exists. In JScript,
                        only a function statement with mandatory identifier is specified; the
                        "function" operator (allowing for anonymous functions) as defined in
                        JavaScript, works anyway. I do not know of similar flaws in JavaScript.
                        [color=blue][color=green]
                        >> It executes it anyway, using an engine that supports both JScript and
                        >> VBScript.[/color]
                        >
                        > The core Script Engine doesn't support both JScript and VBScript, there's
                        > a host engine which supports any ActiveScripting language, and there's
                        > seperate implementations of JScript and VBScript - delete vbscript.dll
                        > from your windows box and JScript still works fine.[/color]

                        ACK, thanks.


                        PointedEars

                        Comment

                        • Jim Ley

                          #13
                          Re: JavaScript ECMAScript definitions

                          On Mon, 03 May 2004 21:49:13 +0200, Thomas 'PointedEars' Lahn
                          <PointedEars@we b.de> wrote:
                          [color=blue]
                          >Jim Ley wrote:
                          >Two obvious reasons: For example, I know of versions of JScript which yield
                          >a script error even if one only tests *if* a property exists.[/color]

                          Sure, but I know of the same in SpiderMonkey impls.
                          [color=blue]
                          > In JScript,
                          >only a function statement with mandatory identifier is specified; the
                          >"function" operator (allowing for anonymous functions) as defined in
                          >JavaScript, works anyway.[/color]

                          Sorry, I'm missing what you're trying to say here? it's something
                          defined in _JavaScript_ that you're saying isn't in JScript and that's
                          a reason to say JScript isn't ECMAScript conformant?
                          [color=blue]
                          > I do not know of similar flaws in JavaScript.[/color]

                          Just yesterday there was a discussion on the non-conformance of \b in
                          RegExps - it was agreed it was a positive non-conformance, but it's
                          still not conformant. There are also others.

                          Jim.
                          --
                          comp.lang.javas cript FAQ - http://jibbering.com/faq/

                          Comment

                          • Thomas 'PointedEars' Lahn

                            #14
                            Re: JavaScript ECMAScript definitions

                            Jim Ley wrote:[color=blue]
                            > Thomas 'PointedEars' Lahn wrote:[color=green]
                            >> Jim Ley wrote: Two obvious reasons: For example, I know of versions of
                            >> JScript which yield a script error even if one only tests *if* a
                            >> property exists.[/color]
                            >
                            > Sure, but I know of the same in SpiderMonkey impls.[/color]

                            And that is a *serious* violation of the ECMAScript specification.
                            Tests must be possible, even if they are unsuccessful at last.
                            [color=blue][color=green]
                            >> In JScript, only a function statement with mandatory identifier is
                            >> specified; the "function" operator (allowing for anonymous functions)
                            >> as defined in JavaScript, works anyway.[/color]
                            >
                            > Sorry, I'm missing what you're trying to say here? it's something
                            > defined in _JavaScript_ that you're saying isn't in JScript and that's a
                            > reason to say JScript isn't ECMAScript conformant?[/color]

                            No anonymous functions with "function" keyword and without identifier
                            are specified in ECMAScript. JavaScript calls this a "function"
                            operator. JScript does not specify this at all, yet it works.


                            PointedEars

                            Comment

                            • Randy Webb

                              #15
                              Re: JavaScript ECMAScript definitions

                              Thomas 'PointedEars' Lahn wrote:[color=blue]
                              > Jim Ley wrote:
                              >[color=green]
                              >>Thomas 'PointedEars' Lahn wrote:
                              >>[color=darkred]
                              >>>Jim Ley wrote: Two obvious reasons: For example, I know of versions of
                              >>>JScript which yield a script error even if one only tests *if* a
                              >>>property exists.[/color]
                              >>
                              >>Sure, but I know of the same in SpiderMonkey impls.[/color]
                              >
                              >
                              > And that is a *serious* violation of the ECMAScript specification.[/color]

                              ECMA is a recommendation and nothing more. It reminds me of the W3C.
                              Yes, its nice to "comply", but it is not *required*. I would rather
                              write/produce code that *works* than code that *complies* but doesn't work.


                              --
                              Randy
                              Chance Favors The Prepared Mind
                              comp.lang.javas cript FAQ - http://jibbering.com/faq/

                              Comment

                              Working...