Skip to content

Commit 82bc31e

Browse files
committed
Restructured a source code
1 parent d49ebbb commit 82bc31e

File tree

23 files changed

+164
-118
lines changed

23 files changed

+164
-118
lines changed

src/JavaScriptEngineSwitcher.ChakraCore/ChakraCoreJsEngine.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ static ChakraCoreJsEngine()
9292
#endif
9393

9494
/// <summary>
95-
/// Constructs a instance of adapter for the ChakraCore JS engine
95+
/// Constructs an instance of adapter for the ChakraCore JS engine
9696
/// </summary>
9797
public ChakraCoreJsEngine()
9898
: this(new ChakraCoreSettings())
@@ -1290,8 +1290,6 @@ public override bool SupportsGarbageCollection
12901290

12911291
#endregion
12921292

1293-
#endregion
1294-
12951293
#region IDisposable implementation
12961294

12971295
/// <summary>
@@ -1341,5 +1339,7 @@ private void Dispose(bool disposing)
13411339
}
13421340

13431341
#endregion
1342+
1343+
#endregion
13441344
}
13451345
}

src/JavaScriptEngineSwitcher.ChakraCore/ChakraCoreJsEngineFactory.cs

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,6 @@ public sealed class ChakraCoreJsEngineFactory : IJsEngineFactory
1212
/// </summary>
1313
private readonly ChakraCoreSettings _settings;
1414

15-
/// <summary>
16-
/// Gets a name of JS engine
17-
/// </summary>
18-
public string EngineName
19-
{
20-
get { return ChakraCoreJsEngine.EngineName; }
21-
}
22-
2315

2416
/// <summary>
2517
/// Constructs an instance of the ChakraCore JS engine factory
@@ -38,6 +30,17 @@ public ChakraCoreJsEngineFactory(ChakraCoreSettings settings)
3830
}
3931

4032

33+
#region IJsEngineFactory implementation
34+
35+
/// <summary>
36+
/// Gets a name of JS engine
37+
/// </summary>
38+
public string EngineName
39+
{
40+
get { return ChakraCoreJsEngine.EngineName; }
41+
}
42+
43+
4144
/// <summary>
4245
/// Creates a instance of the ChakraCore JS engine
4346
/// </summary>
@@ -46,5 +49,7 @@ public IJsEngine CreateEngine()
4649
{
4750
return new ChakraCoreJsEngine(_settings);
4851
}
52+
53+
#endregion
4954
}
5055
}

src/JavaScriptEngineSwitcher.ChakraCore/ChakraCoreSettings.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public bool EnableExperimentalFeatures
4444

4545

4646
/// <summary>
47-
/// Constructs instance of the ChakraCore settings
47+
/// Constructs an instance of the ChakraCore settings
4848
/// </summary>
4949
public ChakraCoreSettings()
5050
{

src/JavaScriptEngineSwitcher.Core/JsEngineSwitcher.cs

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -44,24 +44,6 @@ public static IJsEngineSwitcher Instance
4444
get { return Current; }
4545
}
4646

47-
/// <summary>
48-
/// Gets or sets a name of default JS engine
49-
/// </summary>
50-
public string DefaultEngineName
51-
{
52-
get;
53-
set;
54-
}
55-
56-
/// <summary>
57-
/// Gets a collection of JS engine factories
58-
/// </summary>
59-
public JsEngineFactoryCollection EngineFactories
60-
{
61-
get;
62-
private set;
63-
}
64-
6547

6648
/// <summary>
6749
/// Constructs an instance of JS engine switcher
@@ -87,6 +69,27 @@ public JsEngineSwitcher(JsEngineFactoryCollection engineFactories, string defaul
8769
}
8870

8971

72+
#region IJsEngineSwitcher implementation
73+
74+
/// <summary>
75+
/// Gets or sets a name of default JS engine
76+
/// </summary>
77+
public string DefaultEngineName
78+
{
79+
get;
80+
set;
81+
}
82+
83+
/// <summary>
84+
/// Gets a collection of JS engine factories
85+
/// </summary>
86+
public JsEngineFactoryCollection EngineFactories
87+
{
88+
get;
89+
private set;
90+
}
91+
92+
9093
/// <summary>
9194
/// Creates a instance of JS engine
9295
/// </summary>
@@ -126,5 +129,7 @@ public IJsEngine CreateDefaultEngine()
126129

127130
return jsEngine;
128131
}
132+
133+
#endregion
129134
}
130135
}

src/JavaScriptEngineSwitcher.Core/Undefined.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@ public sealed class Undefined
1010
/// </summary>
1111
public static readonly Undefined Value = new Undefined();
1212

13+
1314
private Undefined()
1415
{ }
1516

17+
1618
/// <summary>
1719
/// Returns a string that represents the current object
1820
/// </summary>

src/JavaScriptEngineSwitcher.Jint/JintJsEngine.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,14 @@ public sealed class JintJsEngine : JsEngineBase
5353

5454

5555
/// <summary>
56-
/// Constructs a instance of adapter for the Jint JS engine
56+
/// Constructs an instance of adapter for the Jint JS engine
5757
/// </summary>
5858
public JintJsEngine()
5959
: this(new JintSettings())
6060
{ }
6161

6262
/// <summary>
63-
/// Constructs a instance of adapter for the Jint JS engine
63+
/// Constructs an instance of adapter for the Jint JS engine
6464
/// </summary>
6565
/// <param name="settings">Settings of the Jint JS engine</param>
6666
public JintJsEngine(JintSettings settings)
@@ -576,8 +576,6 @@ public override bool SupportsGarbageCollection
576576

577577
#endregion
578578

579-
#endregion
580-
581579
#region IDisposable implementation
582580

583581
public override void Dispose()
@@ -592,5 +590,7 @@ public override void Dispose()
592590
}
593591

594592
#endregion
593+
594+
#endregion
595595
}
596596
}

src/JavaScriptEngineSwitcher.Jint/JintJsEngineFactory.cs

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,6 @@ public sealed class JintJsEngineFactory : IJsEngineFactory
1212
/// </summary>
1313
private readonly JintSettings _settings;
1414

15-
/// <summary>
16-
/// Gets a name of JS engine
17-
/// </summary>
18-
public string EngineName
19-
{
20-
get { return JintJsEngine.EngineName; }
21-
}
22-
2315

2416
/// <summary>
2517
/// Constructs an instance of the Jint JS engine factory
@@ -38,6 +30,17 @@ public JintJsEngineFactory(JintSettings settings)
3830
}
3931

4032

33+
#region IJsEngineFactory implementation
34+
35+
/// <summary>
36+
/// Gets a name of JS engine
37+
/// </summary>
38+
public string EngineName
39+
{
40+
get { return JintJsEngine.EngineName; }
41+
}
42+
43+
4144
/// <summary>
4245
/// Creates a instance of the Jint JS engine
4346
/// </summary>
@@ -46,5 +49,7 @@ public IJsEngine CreateEngine()
4649
{
4750
return new JintJsEngine(_settings);
4851
}
52+
53+
#endregion
4954
}
5055
}

src/JavaScriptEngineSwitcher.Jint/JintSettings.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public int Timeout
6464

6565

6666
/// <summary>
67-
/// Constructs instance of the Jint settings
67+
/// Constructs an instance of the Jint settings
6868
/// </summary>
6969
public JintSettings()
7070
{

src/JavaScriptEngineSwitcher.Jurassic/FileScriptSource.cs

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,9 @@ internal sealed class FileScriptSource : OriginalScriptSource
2828
/// </summary>
2929
private readonly Encoding _encoding;
3030

31-
/// <summary>
32-
/// Gets a document name
33-
/// </summary>
34-
public override string Path
35-
{
36-
get { return _documentName; }
37-
}
38-
3931

4032
/// <summary>
41-
/// Constructs a instance of <see cref="FileScriptSource"/>
33+
/// Constructs an instance of <see cref="FileScriptSource"/>
4234
/// </summary>
4335
/// <param name="documentName">The document name</param>
4436
/// <param name="path">The path to the JS-file</param>
@@ -75,6 +67,17 @@ public FileScriptSource(string documentName, string path, Encoding encoding = nu
7567
}
7668

7769

70+
#region Jurassic.ScriptSource overrides
71+
72+
/// <summary>
73+
/// Gets a document name
74+
/// </summary>
75+
public override string Path
76+
{
77+
get { return _documentName; }
78+
}
79+
80+
7881
/// <summary>
7982
/// Gets a reader that can be used to read the source code from JS-file
8083
/// </summary>
@@ -84,5 +87,7 @@ public override TextReader GetReader()
8487
{
8588
return new StreamReader(_path, _encoding, true);
8689
}
90+
91+
#endregion
8792
}
8893
}

src/JavaScriptEngineSwitcher.Jurassic/JurassicJsEngine.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,14 @@ public sealed class JurassicJsEngine : JsEngineBase
5252

5353

5454
/// <summary>
55-
/// Constructs a instance of adapter for the Jurassic JS engine
55+
/// Constructs an instance of adapter for the Jurassic JS engine
5656
/// </summary>
5757
public JurassicJsEngine()
5858
: this(new JurassicSettings())
5959
{ }
6060

6161
/// <summary>
62-
/// Constructs a instance of adapter for the Jurassic JS engine
62+
/// Constructs an instance of adapter for the Jurassic JS engine
6363
/// </summary>
6464
/// <param name="settings">Settings of the Jurassic JS engine</param>
6565
public JurassicJsEngine(JurassicSettings settings)
@@ -560,8 +560,6 @@ public override void ExecuteResource(string resourceName, Assembly assembly)
560560

561561
#endregion
562562

563-
#endregion
564-
565563
#region IDisposable implementation
566564

567565
public override void Dispose()
@@ -576,5 +574,7 @@ public override void Dispose()
576574
}
577575

578576
#endregion
577+
578+
#endregion
579579
}
580580
}

0 commit comments

Comments
 (0)