Browse Source

Fixing function strict mode test

Sebastien Ros 8 years ago
parent
commit
c5f71c54cf

+ 1 - 1
Jint/Native/Function/EvalFunctionInstance.cs

@@ -34,7 +34,7 @@ namespace Jint.Native.Function
             try
             {
                 var parser = new JavaScriptParser(code, new ParserOptions { AdaptRegexp = true, Tolerant = false });
-                var program = parser.ParseProgram(true);
+                var program = parser.ParseProgram(StrictModeScope.IsStrictModeCode);
                 using (new StrictModeScope(program.Strict))
                 {
                     using (new EvalCodeScope())

+ 1 - 1
Jint/Native/Function/FunctionConstructor.cs

@@ -86,7 +86,7 @@ namespace Jint.Native.Function
             try
             {
                 var functionExpression = "function f(" + p + ") { " + body + "}";
-                var parser = new JavaScriptParser(functionExpression);
+                var parser = new JavaScriptParser(functionExpression, new ParserOptions { AdaptRegexp = true, Tolerant = false });
                 function = parser.ParseProgram().Body.First().As<IFunction>();
             }
             catch (ParserException)