shithub: libmujs

Download patch

ref: b51b05b21687850c07b3f04bd40b6709f859b0bf
parent: 7bdfc5e2db95f66145db344b6d4d18036595636a
author: Tor Andersson <tor.andersson@artifex.com>
date: Wed Jan 7 12:24:11 EST 2015

strict mode: No automatic creation of global variables.

--- a/jsrun.c
+++ b/jsrun.c
@@ -802,6 +802,8 @@
 		}
 		E = E->outer;
 	} while (E);
+	if (J->strict)
+		js_referenceerror(J, "assignment to undeclared variable '%s'", name);
 	jsR_setproperty(J, J->G, name, stackidx(J, -1));
 }