File tree Expand file tree Collapse file tree 1 file changed +0
-41
lines changed Expand file tree Collapse file tree 1 file changed +0
-41
lines changed Original file line number Diff line number Diff line change @@ -18,47 +18,6 @@ namespace React
1818 /// </summary>
1919 public static class JavaScriptEngineUtils
2020 {
21- /// <summary>
22- /// Determines if the current environment supports the ClearScript V8 engine
23- /// </summary>
24- /// <returns><c>true</c> if ClearScript is supported</returns>
25- public static bool EnvironmentSupportsClearScript ( )
26- {
27- #if NET40
28- return Environment . OSVersion . Platform == PlatformID . Win32NT ;
29- #else
30- return false ;
31- #endif
32- }
33-
34- /// <summary>
35- /// Attempts to use the specified engine and throws an exception if it doesn't work.
36- /// </summary>
37- public static void EnsureEngineFunctional < TEngine , TException > (
38- Func < Exception , TException > exceptionFactory
39- )
40- where TEngine : IJsEngine , new ( )
41- where TException : Exception
42- {
43- int result ;
44- try
45- {
46- using ( var engine = new TEngine ( ) )
47- {
48- result = engine . Evaluate < int > ( "1 + 1" ) ;
49- }
50- }
51- catch ( Exception ex )
52- {
53- throw exceptionFactory ( ex ) ;
54- }
55-
56- if ( result != 2 )
57- {
58- throw new ReactException ( "Mathematics is broken. 1 + 1 = " + result ) ;
59- }
60- }
61-
6221 /// <summary>
6322 /// Executes a code from JavaScript file.
6423 /// </summary>
You can’t perform that action at this time.
0 commit comments