[whatwg] Fake Code

Ian Hickson ian at hixie.ch
Wed Jul 30 02:42:07 PDT 2008


On Tue, 29 Jul 2008, Garrett Smith wrote:
> 
> Citation from:
> http://www.whatwg.org/specs/web-apps/current-work/#outlines
> 
> ------------------------------------------------------------------------
> The following JavaScript function shows how the tree walk could be
> implemented. [...]
> ------------------------------------------------------------------------
> 
> This code cannot be interpreted in a compliant implementation of 
> EcmaScript. It has more syntax errors than I can count. It is unclear 
> what the author thinks this code will do. If its intent were clearer, 
> and the syntax errors fewer, it might be possible for me to help out by 
> fixing them. The above code is not even close to ECMA262.

Fixed. As far as I can tell, the only problem was an extraneous "do". I 
tested the code after removing the odd extra "do" and it worked fine.

Tested by calling the function "test" and evaluating the following:

   var s = "";
   test(document,
       function (a) { s += "enter " + a + "\n"; },
       function (a) { s += "exit " + a + "\n"; });
   s

The output was what I expected. There were no syntax errors. Could you 
elaborate on what else you think is wrong other than the "do"?

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'



More information about the whatwg mailing list