forked from ClearFoundry/ClearScript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathV8Proxy.NetCore.cs
More file actions
35 lines (31 loc) · 846 Bytes
/
Copy pathV8Proxy.NetCore.cs
File metadata and controls
35 lines (31 loc) · 846 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
using System.Reflection;
using Microsoft.ClearScript.Util;
using Microsoft.ClearScript.Util.IJW;
namespace Microsoft.ClearScript.V8
{
internal abstract partial class V8Proxy
{
private static Assembly GetAssembly()
{
if (assembly == null)
{
assembly = LoadAssemblyWithIJWHostLibrary();
}
return assembly;
}
private static Assembly LoadAssemblyWithIJWHostLibrary()
{
var hIJWHostLibrary = IJWHostLibrary.Load();
try
{
return LoadAssembly();
}
finally
{
NativeMethods.FreeLibrary(hIJWHostLibrary);
}
}
}
}