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

1340Re: Does JSLint parse DOM functions?

Expand Messages
  • Douglas Crockford
    Jun 13, 2010
      --- In jslint_com@yahoogroups.com, "paulur10" <paulur@...> wrote:
      > I tried to use the parse() function of JSLint to parse the following three pieces of JavaScript code:
      > 1. function(b, c){var a = b + c; return a; }
      > 2. window.addEventListener('click', click_hanlder, true);
      > 3. document.documentElement.innerHTML;
      > The outputs are the following:
      > 1. returns a correct tree.
      > 2. returns a tree with only one node of "window".
      > 3. crashes the browser.
      > I'm wondering whether JSLint doesn't support DOM function.

      JSLint's parse function was not intended to be used out of context, and it does not produce complete parse trees. You would do better to start with javascript.crockford.com/tdop/
    • Show all 5 messages in this topic