forked from ClearFoundry/ClearScript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathV8SplitProxyManaged.cpp
More file actions
38 lines (29 loc) · 1.24 KB
/
V8SplitProxyManaged.cpp
File metadata and controls
38 lines (29 loc) · 1.24 KB
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
36
37
38
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
#include "ClearScriptV8Native.h"
//-----------------------------------------------------------------------------
// V8SplitProxyManaged implementation
//-----------------------------------------------------------------------------
thread_local void** V8SplitProxyManaged::ms_pMethodTable = nullptr;
thread_local HostException* V8SplitProxyManaged::ms_pHostException = nullptr;
//-----------------------------------------------------------------------------
void** V8SplitProxyManaged::SetMethodTable(void** pMethodTable) noexcept
{
return std::exchange(ms_pMethodTable, pMethodTable);
}
//-----------------------------------------------------------------------------
void V8SplitProxyManaged::SetHostException(HostException&& exception) noexcept
{
_ASSERTE(ms_pHostException == nullptr);
ms_pHostException = new HostException(std::move(exception));
}
//-----------------------------------------------------------------------------
void V8SplitProxyManaged::ThrowHostException()
{
if (ms_pHostException != nullptr)
{
HostException exception(std::move(*ms_pHostException));
delete ms_pHostException;
throw exception;
}
}