File tree Expand file tree Collapse file tree 6 files changed +29
-16
lines changed Expand file tree Collapse file tree 6 files changed +29
-16
lines changed Original file line number Diff line number Diff line change @@ -41,7 +41,6 @@ namespace OpenQA.Selenium.BiDi.Communication.Json;
4141[ JsonSerializable ( typeof ( Modules . Script . ObjectRemoteValue ) ) ]
4242[ JsonSerializable ( typeof ( Modules . Script . FunctionRemoteValue ) ) ]
4343[ JsonSerializable ( typeof ( Modules . Script . RegExpRemoteValue ) ) ]
44- [ JsonSerializable ( typeof ( Modules . Script . RegExpRemoteValue . RegExpValue ) , TypeInfoPropertyName = "Script_RegExpRemoteValue_RegExpValue" ) ]
4544[ JsonSerializable ( typeof ( Modules . Script . DateRemoteValue ) ) ]
4645[ JsonSerializable ( typeof ( Modules . Script . MapRemoteValue ) ) ]
4746[ JsonSerializable ( typeof ( Modules . Script . SetRemoteValue ) ) ]
Original file line number Diff line number Diff line change @@ -112,12 +112,6 @@ public record MapLocalValue(IEnumerable<IEnumerable<LocalValue>> Value) : LocalV
112112
113113public record ObjectLocalValue ( IEnumerable < IEnumerable < LocalValue > > Value ) : LocalValue ;
114114
115- public record RegExpLocalValue ( RegExpLocalValue . RegExpValue Value ) : LocalValue
116- {
117- public record RegExpValue ( string Pattern )
118- {
119- public string ? Flags { get ; set ; }
120- }
121- }
115+ public record RegExpLocalValue ( RegExpValue Value ) : LocalValue ;
122116
123117public record SetLocalValue ( IEnumerable < LocalValue > Value ) : LocalValue ;
Original file line number Diff line number Diff line change 1+ // <copyright file="RegExpValue.cs" company="Selenium Committers">
2+ // Licensed to the Software Freedom Conservancy (SFC) under one
3+ // or more contributor license agreements. See the NOTICE file
4+ // distributed with this work for additional information
5+ // regarding copyright ownership. The SFC licenses this file
6+ // to you under the Apache License, Version 2.0 (the
7+ // "License"); you may not use this file except in compliance
8+ // with the License. You may obtain a copy of the License at
9+ //
10+ // http://www.apache.org/licenses/LICENSE-2.0
11+ //
12+ // Unless required by applicable law or agreed to in writing,
13+ // software distributed under the License is distributed on an
14+ // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+ // KIND, either express or implied. See the License for the
16+ // specific language governing permissions and limitations
17+ // under the License.
18+ // </copyright>
19+
20+ namespace OpenQA . Selenium . BiDi . Modules . Script ;
21+
22+ public record RegExpValue ( string Pattern )
23+ {
24+ public string ? Flags { get ; set ; }
25+ }
Original file line number Diff line number Diff line change @@ -141,16 +141,11 @@ public record FunctionRemoteValue : RemoteValue
141141 public InternalId ? InternalId { get ; set ; }
142142}
143143
144- public record RegExpRemoteValue ( RegExpRemoteValue . RegExpValue Value ) : RemoteValue
144+ public record RegExpRemoteValue ( RegExpValue Value ) : RemoteValue
145145{
146146 public Handle ? Handle { get ; set ; }
147147
148148 public InternalId ? InternalId { get ; set ; }
149-
150- public record RegExpValue ( string Pattern )
151- {
152- public string ? Flags { get ; set ; }
153- }
154149}
155150
156151public record DateRemoteValue ( string Value ) : RemoteValue
Original file line number Diff line number Diff line change @@ -281,7 +281,7 @@ await context.Script.CallFunctionAsync($$"""
281281 [ Test ]
282282 public void CanCallFunctionWithArgumentRegExp ( )
283283 {
284- var arg = new RegExpLocalValue ( new RegExpLocalValue . RegExpValue ( "foo*" ) { Flags = "g" } ) ;
284+ var arg = new RegExpLocalValue ( new RegExpValue ( "foo*" ) { Flags = "g" } ) ;
285285
286286 Assert . That ( async ( ) =>
287287 {
Original file line number Diff line number Diff line change @@ -177,7 +177,7 @@ public async Task CanCallFunctionAndReturnRegExp()
177177 var response = await context . Script . CallFunctionAsync ( "() => { return /foo*/g; }" , false ) ;
178178
179179 Assert . That ( response . Result , Is . AssignableTo < RegExpRemoteValue > ( ) ) ;
180- Assert . That ( response . Result , Is . EqualTo ( new RegExpRemoteValue ( new RegExpRemoteValue . RegExpValue ( "foo*" ) { Flags = "g" } ) ) ) ;
180+ Assert . That ( response . Result , Is . EqualTo ( new RegExpRemoteValue ( new RegExpValue ( "foo*" ) { Flags = "g" } ) ) ) ;
181181 }
182182
183183 [ Test ]
You can’t perform that action at this time.
0 commit comments