shithub: libmujs

Download patch

ref: c1ad1ba1e482e7d01743e3f4f9517572bebf99ac
parent: d9ed73fd717ebbefe5595d139a133b762cea4e92
author: Tor Andersson <tor.andersson@artifex.com>
date: Mon Feb 2 12:27:07 EST 2015

Fix mistake when compiling array literals.

The values were being used as keys, and vice versa.

--- a/jscompile.c
+++ b/jscompile.c
@@ -265,8 +265,8 @@
 	int i = 0;
 	while (list) {
 		if (list->a->type != EXP_UNDEF) {
-			cexp(J, F, list->a);
 			emitnumber(J, F, i++);
+			cexp(J, F, list->a);
 			emit(J, F, OP_INITPROP);
 		} else {
 			++i;