@@ -63,7 +63,7 @@ function calculateIncomeTax(salary) {
6363 ;
6464
6565 // Act
66- using ( var jsEngine = CreateJsEngine ( logger . Log ) )
66+ using ( var jsEngine = CreateJsEngine ( consoleCallback : logger . Log ) )
6767 {
6868 jsEngine . EmbedHostType ( "favoriteSchoolSubject" , favoriteSchoolSubject ) ;
6969 jsEngine . EmbedHostObject ( "wikipediaPageUrl" , wikipediaPageUrl ) ;
@@ -93,12 +93,12 @@ public void SupportsConsoleInfoMethod()
9393console.info(driveLetter, 'drive has been formatted successfully!');" ;
9494
9595 // Act
96- JsRuntimeException exception = null ;
9796 IJsEngine jsEngine = null ;
97+ JsRuntimeException exception = null ;
9898
9999 try
100100 {
101- jsEngine = CreateJsEngine ( logger . Log ) ;
101+ jsEngine = CreateJsEngine ( consoleCallback : logger . Log ) ;
102102 jsEngine . Execute ( input ) ;
103103 }
104104 catch ( JsRuntimeException e )
@@ -128,13 +128,13 @@ public void SupportsConsoleWarnMethod()
128128 const string input = @"console.warn('Watch out, the doors are closing!');
129129console.warn('Watch yourself,', 'be careful!');
130130console.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
134134 ;
135135
136136 // Act
137- using ( var jsEngine = CreateJsEngine ( logger . Log ) )
137+ using ( var jsEngine = CreateJsEngine ( consoleCallback : logger . Log ) )
138138 {
139139 jsEngine . Execute ( input ) ;
140140 }
@@ -156,10 +156,10 @@ public void SupportsConsoleErrorMethod()
156156 var logger = new StringLogger ( sb ) ;
157157
158158 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 ;
160160
161161 // Act
162- using ( var jsEngine = CreateJsEngine ( logger . Log ) )
162+ using ( var jsEngine = CreateJsEngine ( consoleCallback : logger . Log ) )
163163 {
164164 jsEngine . Execute ( input ) ;
165165 }
@@ -188,8 +188,7 @@ public void Log(string type, object[] args)
188188 {
189189 if ( type != "log" )
190190 {
191- _buffer . Append ( type ) ;
192- _buffer . Append ( ": " ) ;
191+ _buffer . AppendFormat ( "{0}: " , type ) ;
193192 }
194193
195194 for ( int argIndex = 0 ; argIndex < args . Length ; argIndex ++ )
0 commit comments