@@ -63,7 +63,7 @@ function calculateIncomeTax(salary) {
63
63
;
64
64
65
65
// Act
66
- using ( var jsEngine = CreateJsEngine ( logger . Log ) )
66
+ using ( var jsEngine = CreateJsEngine ( consoleCallback : logger . Log ) )
67
67
{
68
68
jsEngine . EmbedHostType ( "favoriteSchoolSubject" , favoriteSchoolSubject ) ;
69
69
jsEngine . EmbedHostObject ( "wikipediaPageUrl" , wikipediaPageUrl ) ;
@@ -93,12 +93,12 @@ public void SupportsConsoleInfoMethod()
93
93
console.info(driveLetter, 'drive has been formatted successfully!');" ;
94
94
95
95
// Act
96
- JsRuntimeException exception = null ;
97
96
IJsEngine jsEngine = null ;
97
+ JsRuntimeException exception = null ;
98
98
99
99
try
100
100
{
101
- jsEngine = CreateJsEngine ( logger . Log ) ;
101
+ jsEngine = CreateJsEngine ( consoleCallback : logger . Log ) ;
102
102
jsEngine . Execute ( input ) ;
103
103
}
104
104
catch ( JsRuntimeException e )
@@ -128,13 +128,13 @@ public void SupportsConsoleWarnMethod()
128
128
const string input = @"console.warn('Watch out, the doors are closing!');
129
129
console.warn('Watch yourself,', 'be careful!');
130
130
console.warn('It is forbidden to watch!');" ;
131
- string targetOutput = "warn: Watch out, the doors are closing!" + Environment . NewLine +
132
- "warn: Watch yourself, be careful!" + Environment . NewLine +
133
- "warn: It is forbidden to watch!" + Environment . NewLine
131
+ string targetOutput = "warn: Watch out, the doors are closing!" + Environment . NewLine +
132
+ "warn: Watch yourself, be careful!" + Environment . NewLine +
133
+ "warn: It is forbidden to watch!" + Environment . NewLine
134
134
;
135
135
136
136
// Act
137
- using ( var jsEngine = CreateJsEngine ( logger . Log ) )
137
+ using ( var jsEngine = CreateJsEngine ( consoleCallback : logger . Log ) )
138
138
{
139
139
jsEngine . Execute ( input ) ;
140
140
}
@@ -156,10 +156,10 @@ public void SupportsConsoleErrorMethod()
156
156
var logger = new StringLogger ( sb ) ;
157
157
158
158
const string input = @"console.error('A terrible thing happened!');" ;
159
- string targetOutput = "error: A terrible thing happened!" + Environment . NewLine ;
159
+ string targetOutput = "error: A terrible thing happened!" + Environment . NewLine ;
160
160
161
161
// Act
162
- using ( var jsEngine = CreateJsEngine ( logger . Log ) )
162
+ using ( var jsEngine = CreateJsEngine ( consoleCallback : logger . Log ) )
163
163
{
164
164
jsEngine . Execute ( input ) ;
165
165
}
@@ -188,8 +188,7 @@ public void Log(string type, object[] args)
188
188
{
189
189
if ( type != "log" )
190
190
{
191
- _buffer . Append ( type ) ;
192
- _buffer . Append ( ": " ) ;
191
+ _buffer . AppendFormat ( "{0}: " , type ) ;
193
192
}
194
193
195
194
for ( int argIndex = 0 ; argIndex < args . Length ; argIndex ++ )
0 commit comments