File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
dotnet/src/webdriver/BiDi/Modules/Script Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -222,6 +222,15 @@ public static NumberLocalValue Number(double value)
222222 public static NullLocalValue Null { get ; } = new NullLocalValue ( ) ;
223223
224224 public static UndefinedLocalValue Undefined { get ; } = new UndefinedLocalValue ( ) ;
225+ public static RegExpLocalValue Regex ( string pattern , string ? flags = null )
226+ {
227+ if ( pattern is null )
228+ {
229+ throw new ArgumentNullException ( nameof ( pattern ) ) ;
230+ }
231+
232+ return new RegExpLocalValue ( new RegExpValue ( pattern ) { Flags = flags } ) ;
233+ }
225234
226235 /// <summary>
227236 /// Converts a .NET Regex into a BiDi Regex
@@ -234,6 +243,11 @@ public static NumberLocalValue Number(double value)
234243 /// </remarks>
235244 public static RegExpLocalValue Regex ( Regex regex )
236245 {
246+ if ( regex is null )
247+ {
248+ throw new ArgumentNullException ( nameof ( regex ) ) ;
249+ }
250+
237251 RegexOptions options = regex . Options ;
238252
239253 if ( options == RegexOptions . None )
You can’t perform that action at this time.
0 commit comments