Parcourir la source

Intercepting option parsing exceptions

Sebastien Ros il y a 9 ans
Parent
commit
c5216f63d1
1 fichiers modifiés avec 1 ajouts et 2 suppressions
  1. 1 2
      Jint/Native/RegExp/RegExpConstructor.cs

+ 1 - 2
Jint/Native/RegExp/RegExpConstructor.cs

@@ -90,10 +90,9 @@ namespace Jint.Native.RegExp
             r.Prototype = PrototypeObject;
             r.Extensible = true;
 
-            var options = new Scanner("").ParseRegexOptions(f);
-
             try
             {
+                var options = new Scanner("").ParseRegexOptions(f);
                 r.Value = new Regex(p, options);
             }
             catch (Exception e)