shithub: libmujs

Download patch

ref: ffa8de1fc9dc0cac21f899e745b335af79e0d35b
parent: e9f4ecc3787d3c8147a380aa1f3649a4bea53a37
author: Tor Andersson <tor.andersson@artifex.com>
date: Wed Jan 7 11:47:17 EST 2015

strict mode: eval code is evaluated in its own scope.

Create a closure for eval code instead of letting it abuse the function's
own scope (as is done by setting scope to NULL).

--- a/jsstate.c
+++ b/jsstate.c
@@ -55,7 +55,7 @@
 	P = jsP_parse(J, filename, source);
 	F = jsC_compile(J, P);
 	jsP_freeparse(J);
-	js_newscript(J, F, iseval ? NULL : J->GE);
+	js_newscript(J, F, iseval ? (J->strict ? J->E : NULL) : J->GE);
 
 	js_endtry(J);
 }