Skip to content

Commit 50890dc

Browse files
committed
1. Added a .editorconfig file;
2. Unified formatting of different file types.
1 parent 3975b76 commit 50890dc

File tree

15 files changed

+340
-303
lines changed

15 files changed

+340
-303
lines changed

.editorconfig

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Top-most EditorConfig file
2+
root = true
3+
4+
[*]
5+
end_of_line = crlf
6+
indent_style = tab
7+
tab_width = 4
8+
trim_trailing_whitespace = true
9+
insert_final_newline = false
10+
11+
[*.json]
12+
indent_style = space
13+
indent_size = 2
14+
insert_final_newline = true
15+
16+
[*.cmd]
17+
indent_style = space
18+
indent_size = 4
19+
20+
[*.{xml,config,csproj,props,targets}]
21+
indent_style = space
22+
indent_size = 2
23+
24+
[*.sln]
25+
insert_final_newline = true
26+
27+
[*.{txt,md}]
28+
indent_style = space
29+
indent_size = unset
30+
31+
[**/Resources/**]
32+
charset = unset
33+
end_of_line = unset
34+
indent_style = unset
35+
indent_size = unset
36+
trim_trailing_whitespace = unset
37+
insert_final_newline = unset

README.md

Lines changed: 79 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -36,42 +36,42 @@ using MsieJavaScriptEngine.Helpers;
3636

3737
namespace MsieJavaScriptEngine.Example.Console
3838
{
39-
class Program
40-
{
41-
static void Main(string[] args)
42-
{
43-
try
44-
{
45-
using (var jsEngine = new MsieJsEngine())
46-
{
47-
const string expression = "7 * 8 - 20";
48-
var result = jsEngine.Evaluate<int>(expression);
49-
50-
Console.WriteLine("{0} = {1}", expression, result);
51-
}
52-
}
53-
catch (JsEngineLoadException e)
54-
{
55-
Console.WriteLine("During loading of JavaScript engine an error occurred.");
56-
Console.WriteLine();
57-
Console.WriteLine(JsErrorHelpers.GenerateErrorDetails(e));
58-
}
59-
catch (JsScriptException e)
60-
{
61-
Console.WriteLine("During processing of JavaScript code an error occurred.");
62-
Console.WriteLine();
63-
Console.WriteLine(JsErrorHelpers.GenerateErrorDetails(e));
64-
}
65-
catch (JsException e)
66-
{
67-
Console.WriteLine("During working of JavaScript engine an unknown error occurred.");
68-
Console.WriteLine();
69-
Console.WriteLine(JsErrorHelpers.GenerateErrorDetails(e));
70-
}
71-
72-
Console.ReadLine();
73-
}
74-
}
39+
class Program
40+
{
41+
static void Main(string[] args)
42+
{
43+
try
44+
{
45+
using (var jsEngine = new MsieJsEngine())
46+
{
47+
const string expression = "7 * 8 - 20";
48+
var result = jsEngine.Evaluate<int>(expression);
49+
50+
Console.WriteLine("{0} = {1}", expression, result);
51+
}
52+
}
53+
catch (JsEngineLoadException e)
54+
{
55+
Console.WriteLine("During loading of JavaScript engine an error occurred.");
56+
Console.WriteLine();
57+
Console.WriteLine(JsErrorHelpers.GenerateErrorDetails(e));
58+
}
59+
catch (JsScriptException e)
60+
{
61+
Console.WriteLine("During processing of JavaScript code an error occurred.");
62+
Console.WriteLine();
63+
Console.WriteLine(JsErrorHelpers.GenerateErrorDetails(e));
64+
}
65+
catch (JsException e)
66+
{
67+
Console.WriteLine("During working of JavaScript engine an unknown error occurred.");
68+
Console.WriteLine();
69+
Console.WriteLine(JsErrorHelpers.GenerateErrorDetails(e));
70+
}
71+
72+
Console.ReadLine();
73+
}
74+
}
7575
}
7676
```
7777

@@ -94,49 +94,49 @@ Also, when you create an instance of the <code title="MsieJavaScriptEngine.MsieJ
9494
Consider in detail properties of the <code title="MsieJavaScriptEngine.JsEngineSettings">JsEngineSettings</code> class:
9595

9696
<table border="1" style="font-size: 0.7em">
97-
<thead>
98-
<tr valign="top">
99-
<th>Property name</th>
100-
<th>Data&nbsp;type</th>
101-
<th>Default value</th>
102-
<th>Description</th>
103-
</tr>
104-
</thead>
105-
<tbody>
106-
<tr valign="top">
107-
<td><code>EnableDebugging</code></td>
108-
<td><code title="System.Boolean">Boolean</code></td>
109-
<td><code>false</code></td>
110-
<td>Flag for whether to allow debugging in Visual Studio by adding the <code>debugger</code> statement to script code.</td>
111-
</tr>
112-
<tr valign="top">
113-
<td><code>EngineMode</code></td>
114-
<td><code title="MsieJavaScriptEngine.JsEngineMode">JsEngineMode</code> enumeration</td>
115-
<td><code>Auto</code></td>
116-
<td>JavaScript engine mode.</td>
117-
</tr>
118-
<tr valign="top">
119-
<td><code>MaxStackSize</code></td>
120-
<td><code title="System.Int32">Int32</code></td>
121-
<td><code>503 808</code> or <code>1 007 616</code></td>
122-
<td>
123-
<p>Maximum stack size in bytes.</p>
124-
<p>Set a <code>0</code> to use the default maximum stack size specified in the header for the executable.</p>
125-
</td>
126-
</tr>
127-
<tr valign="top">
128-
<td><code>UseEcmaScript5Polyfill</code></td>
129-
<td><code title="System.Boolean">Boolean</code></td>
130-
<td><code>false</code></td>
131-
<td>Flag for whether to use the ECMAScript 5 Polyfill.</td>
132-
</tr>
133-
<tr valign="top">
134-
<td><code>UseJson2Library</code></td>
135-
<td><code title="System.Boolean">Boolean</code></td>
136-
<td><code>false</code></td>
137-
<td>Flag for whether to use the <a href="http://github.com/douglascrockford/JSON-js">JSON2</a> library</td>
138-
</tr>
139-
</tbody>
97+
<thead>
98+
<tr valign="top">
99+
<th>Property name</th>
100+
<th>Data&nbsp;type</th>
101+
<th>Default value</th>
102+
<th>Description</th>
103+
</tr>
104+
</thead>
105+
<tbody>
106+
<tr valign="top">
107+
<td><code>EnableDebugging</code></td>
108+
<td><code title="System.Boolean">Boolean</code></td>
109+
<td><code>false</code></td>
110+
<td>Flag for whether to allow debugging in Visual Studio by adding the <code>debugger</code> statement to script code.</td>
111+
</tr>
112+
<tr valign="top">
113+
<td><code>EngineMode</code></td>
114+
<td><code title="MsieJavaScriptEngine.JsEngineMode">JsEngineMode</code> enumeration</td>
115+
<td><code>Auto</code></td>
116+
<td>JavaScript engine mode.</td>
117+
</tr>
118+
<tr valign="top">
119+
<td><code>MaxStackSize</code></td>
120+
<td><code title="System.Int32">Int32</code></td>
121+
<td><code>503 808</code> or <code>1 007 616</code></td>
122+
<td>
123+
<p>Maximum stack size in bytes.</p>
124+
<p>Set a <code>0</code> to use the default maximum stack size specified in the header for the executable.</p>
125+
</td>
126+
</tr>
127+
<tr valign="top">
128+
<td><code>UseEcmaScript5Polyfill</code></td>
129+
<td><code title="System.Boolean">Boolean</code></td>
130+
<td><code>false</code></td>
131+
<td>Flag for whether to use the ECMAScript 5 Polyfill.</td>
132+
</tr>
133+
<tr valign="top">
134+
<td><code>UseJson2Library</code></td>
135+
<td><code title="System.Boolean">Boolean</code></td>
136+
<td><code>false</code></td>
137+
<td>Flag for whether to use the <a href="http://github.com/douglascrockford/JSON-js">JSON2</a> library</td>
138+
</tr>
139+
</tbody>
140140
</table>
141141

142142

build/common.props

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
<Project>
2-
<PropertyGroup>
3-
<Copyright>Copyright © 2012-2020 Andrey Taritsyn</Copyright>
4-
</PropertyGroup>
2+
<PropertyGroup>
3+
<Copyright>Copyright © 2012-2020 Andrey Taritsyn</Copyright>
4+
</PropertyGroup>
55

6-
<PropertyGroup Condition=" '$(TargetFramework)' == 'net40-client' Or '$(TargetFramework)' == 'net45' Or '$(TargetFramework)' == 'net461' ">
7-
<DefineConstants>$(DefineConstants);NETFULL</DefineConstants>
8-
</PropertyGroup>
6+
<PropertyGroup Condition=" '$(TargetFramework)' == 'net40-client' Or '$(TargetFramework)' == 'net45' Or '$(TargetFramework)' == 'net461' ">
7+
<DefineConstants>$(DefineConstants);NETFULL</DefineConstants>
8+
</PropertyGroup>
99

10-
<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard1.3' Or '$(TargetFramework)' == 'netstandard2.0' Or '$(TargetFramework)' == 'netstandard2.1' ">
11-
<DefineConstants>$(DefineConstants);NETSTANDARD</DefineConstants>
12-
</PropertyGroup>
10+
<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard1.3' Or '$(TargetFramework)' == 'netstandard2.0' Or '$(TargetFramework)' == 'netstandard2.1' ">
11+
<DefineConstants>$(DefineConstants);NETSTANDARD</DefineConstants>
12+
</PropertyGroup>
1313

14-
<PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp1.0' Or '$(TargetFramework)' == 'netcoreapp2.0' Or '$(TargetFramework)' == 'netcoreapp2.1' Or '$(TargetFramework)' == 'netcoreapp3.1' Or '$(TargetFramework)' == 'net5.0' ">
15-
<DefineConstants>$(DefineConstants);NETCOREAPP</DefineConstants>
16-
</PropertyGroup>
14+
<PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp1.0' Or '$(TargetFramework)' == 'netcoreapp2.0' Or '$(TargetFramework)' == 'netcoreapp2.1' Or '$(TargetFramework)' == 'netcoreapp3.1' Or '$(TargetFramework)' == 'net5.0' ">
15+
<DefineConstants>$(DefineConstants);NETCOREAPP</DefineConstants>
16+
</PropertyGroup>
1717
</Project>

build/net40-client-target.props

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project>
2-
<PropertyGroup Condition=" '$(TargetFramework)' == 'net40-client' ">
3-
<TargetFrameworkIdentifier>.NETFramework</TargetFrameworkIdentifier>
4-
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
5-
<TargetFrameworkProfile>client</TargetFrameworkProfile>
6-
</PropertyGroup>
2+
<PropertyGroup Condition=" '$(TargetFramework)' == 'net40-client' ">
3+
<TargetFrameworkIdentifier>.NETFramework</TargetFrameworkIdentifier>
4+
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
5+
<TargetFrameworkProfile>client</TargetFrameworkProfile>
6+
</PropertyGroup>
77
</Project>

build/strong-name-signing.props

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project>
2-
<PropertyGroup>
3-
<AssemblyOriginatorKeyFile>../../build/Key.snk</AssemblyOriginatorKeyFile>
4-
<SignAssembly>true</SignAssembly>
5-
<PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign>
6-
</PropertyGroup>
2+
<PropertyGroup>
3+
<AssemblyOriginatorKeyFile>../../build/Key.snk</AssemblyOriginatorKeyFile>
4+
<SignAssembly>true</SignAssembly>
5+
<PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign>
6+
</PropertyGroup>
77
</Project>

global.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"sdk": {
3-
"version": "5.0.302"
4-
}
5-
}
2+
"sdk": {
3+
"version": "5.0.302"
4+
}
5+
}

0 commit comments

Comments
 (0)