Loading ...
Sorry, an error occurred while loading the content.

Re: Node not defined

Expand Messages
  • douglascrockford
    ... That document describes a rather large number of interfaces, which may be interesting in the abstract because JavaScript, as you know, does not have
    Message 1 of 7 , Oct 22, 2012
    • 0 Attachment
      --- In jslint_com@yahoogroups.com, Joshua Bell <inexorabletash@...> wrote:
      >
      > On Thu, Oct 18, 2012 at 12:03 AM, douglascrockford <douglas@...>wrote:
      >
      > > **
      > >
      > >
      > > --- In jslint_com@yahoogroups.com, Ian Toltz <itoltz@> wrote:
      > >
      > > > I get the error
      > > >
      > > > 'Node' was used before it was defined.
      > > >
      > > > From the line:
      > > >
      > > > if (nodes[i].nodeType === Node.TEXT_NODE) {
      > > >
      > > > I do have the "Assume a browser" option on.
      > > >
      > > > I believe this to be in error, as Node is one of the pre-defined objects
      > > in
      > > > JS (at least in a browser, not sure if that's the case in other
      > > > environments) like Math.
      > >
      > > Can you please cite the relevant standard?
      > >
      > >
      > Since the original poster hasn't replied:
      >
      > http://www.w3.org/TR/DOM-Level-3-Core/core.html
      >
      > That spec - which so far as I know is implemented by all the current
      > browsers - introduces a rather large number of new global objects into the
      > browser. And that spec is not alone, given the rapid pace of browser
      > evolution at the moment.


      That document describes a rather large number of interfaces, which may be interesting in the abstract because JavaScript, as you know, does not have interfaces.

      Can you please identify a standard that makes these things global or properties of the window object?
    • Joshua Bell
      ... That would be the ECMAScript binding of WebIDL: http://dev.w3.org/2006/webapi/WebIDL/#ecmascript-binding Web standards typically define IDL fragments and
      Message 2 of 7 , Oct 22, 2012
      • 0 Attachment
        On Mon, Oct 22, 2012 at 9:53 AM, douglascrockford <douglas@...>wrote:

        > **
        >
        >
        > --- In jslint_com@yahoogroups.com, Joshua Bell <inexorabletash@...> wrote:
        > >
        > > On Thu, Oct 18, 2012 at 12:03 AM, douglascrockford <douglas@...>wrote:
        > >
        > > > **
        >
        > > >
        > > >
        > > > --- In jslint_com@yahoogroups.com, Ian Toltz <itoltz@> wrote:
        > > >
        > > > > I get the error
        > > > >
        > > > > 'Node' was used before it was defined.
        > > > >
        > > > > From the line:
        > > > >
        > > > > if (nodes[i].nodeType === Node.TEXT_NODE) {
        > > > >
        > > > > I do have the "Assume a browser" option on.
        > > > >
        > > > > I believe this to be in error, as Node is one of the pre-defined
        > objects
        > > > in
        > > > > JS (at least in a browser, not sure if that's the case in other
        > > > > environments) like Math.
        > > >
        > > > Can you please cite the relevant standard?
        > > >
        > > >
        > > Since the original poster hasn't replied:
        > >
        > > http://www.w3.org/TR/DOM-Level-3-Core/core.html
        > >
        > > That spec - which so far as I know is implemented by all the current
        > > browsers - introduces a rather large number of new global objects into
        > the
        > > browser. And that spec is not alone, given the rapid pace of browser
        > > evolution at the moment.
        >
        > That document describes a rather large number of interfaces, which may be
        > interesting in the abstract because JavaScript, as you know, does not have
        > interfaces.
        >
        > Can you please identify a standard that makes these things global or
        > properties of the window object?
        >
        >
        That would be the ECMAScript binding of WebIDL:

        http://dev.w3.org/2006/webapi/WebIDL/#ecmascript-binding

        Web standards typically define IDL fragments and by reference to WebIDL,
        interfaces in these fragments are exposed as properties of the ECMAScript
        environment.


        [Non-text portions of this message have been removed]
      Your message has been successfully submitted and would be delivered to recipients shortly.