Browse Source

Fixing DebugMode

Sebastien Ros 8 years ago
parent
commit
ce99dc152d
1 changed files with 6 additions and 1 deletions
  1. 6 1
      Jint/Engine.cs

+ 6 - 1
Jint/Engine.cs

@@ -61,7 +61,7 @@ namespace Jint
             { typeof(UInt32), (Engine engine, object v) => new JsValue((UInt32)v) },
             { typeof(UInt32), (Engine engine, object v) => new JsValue((UInt32)v) },
             { typeof(UInt64), (Engine engine, object v) => new JsValue((UInt64)v) },
             { typeof(UInt64), (Engine engine, object v) => new JsValue((UInt64)v) },
             { typeof(JsValue), (Engine engine, object v) => (JsValue)v },
             { typeof(JsValue), (Engine engine, object v) => (JsValue)v },
-            { typeof(System.Text.RegularExpressions.Regex), (Engine engine, object v) => engine.RegExp.Construct(((System.Text.RegularExpressions.Regex)v).ToString().Trim('/')) }
+            { typeof(System.Text.RegularExpressions.Regex), (Engine engine, object v) => engine.RegExp.Construct((System.Text.RegularExpressions.Regex)v) }
         };
         };
 
 
         internal JintCallStack CallStack = new JintCallStack();
         internal JintCallStack CallStack = new JintCallStack();
@@ -297,6 +297,11 @@ namespace Jint
 
 
         public Engine Execute(string source, ParserOptions parserOptions)
         public Engine Execute(string source, ParserOptions parserOptions)
         {
         {
+            if (Options._IsDebugMode)
+            {
+                parserOptions.Loc = true;
+            }
+
             var parser = new JavaScriptParser(source, parserOptions);
             var parser = new JavaScriptParser(source, parserOptions);
             return Execute(parser.ParseProgram());
             return Execute(parser.ParseProgram());
         }
         }