Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit 7dd1216

Browse files
committed
Allow CreateScope() to override existing scope as well
1 parent 6d9b6fb commit 7dd1216

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/ServiceStack.Text/JsConfig.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,14 @@ public static JsConfigScope BeginScope()
3131
return new JsConfigScope();
3232
}
3333

34-
public static JsConfigScope CreateScope(string config)
34+
public static JsConfigScope CreateScope(string config, JsConfigScope scope = null)
3535
{
3636
if (string.IsNullOrEmpty(config))
37-
return null;
37+
return scope;
38+
39+
if (scope == null)
40+
scope = BeginScope();
3841

39-
var scope = BeginScope();
4042
var items = config.Split(',');
4143
foreach (var item in items)
4244
{

0 commit comments

Comments
 (0)