- From: Ian Hickson <ian@hixie.ch>
- Date: Wed, 30 Jul 2008 09:42:07 +0000 (UTC)
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. `._.-(,_..'--(,_..'`-.;.'
Received on Wednesday, 30 July 2008 02:42:07 UTC