From f4e8ad5e609921e677e579e01020930c64f652ba Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Tue, 4 Dec 2012 11:02:26 -0800 Subject: [PATCH] Correctly set the strict mode flag when calling eval() Change-Id: I677eea907a3b79373c0784c1496ed97f0f5ee6f6 Reviewed-by: Simon Hausmann --- qmljs_objects.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/qmljs_objects.cpp b/qmljs_objects.cpp index f12999b..12cc447 100644 --- a/qmljs_objects.cpp +++ b/qmljs_objects.cpp @@ -508,8 +508,14 @@ Value EvalFunction::call(ExecutionContext *context, Value /*thisObject*/, Value ctx = context; } + // set the correct strict mode flag on the context + bool cstrict = ctx->strictMode; + ctx->strictMode = strict; + Value result = f->code(ctx, f->codeData); + ctx->strictMode = cstrict; + if (strict) ctx->leaveCallContext(); -- 2.7.4