shithub: libmujs

Download patch

ref: 44d4109a1c58e29e185b73bdd3b91a39dbd883d7
parent: 617261bff9d668028187244206f2f7822611ca98
author: Tor Andersson <[email protected]>
date: Tue May 9 09:16:23 EDT 2017

Use the line number of the lookahead token when building the syntax tree.

We were tagging nodes with the previous token's line number, which is
not correct.

--- a/jsparse.c
+++ b/jsparse.c
@@ -128,8 +128,8 @@
 
 static void jsP_next(js_State *J)
 {
-	J->astline = J->lexline;
 	J->lookahead = jsY_lex(J);
+	J->astline = J->lexline;
 }
 
 #define jsP_accept(J,x) (J->lookahead == x ? (jsP_next(J), 1) : 0)