Update public API & Remove SandBoxStack (#469)

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
This commit is contained in:
Patrick Kim 2019-10-18 09:40:00 +09:00 committed by Hyukwoo Park
commit be2e01a807
9 changed files with 41 additions and 21 deletions

View file

@ -23,12 +23,26 @@
#include "runtime/Environment.h"
#include "runtime/EnvironmentRecord.h"
#include "runtime/NativeFunctionObject.h"
#include "runtime/VMInstance.h"
#include "parser/Script.h"
#include "interpreter/ByteCode.h"
#include "interpreter/ByteCodeInterpreter.h"
namespace Escargot {
SandBox::SandBox(Context* s)
: m_context(s)
{
m_oldSandBox = m_context->vmInstance()->m_currentSandBox;
m_context->vmInstance()->m_currentSandBox = this;
}
SandBox::~SandBox()
{
ASSERT(m_context->vmInstance()->m_currentSandBox == this);
m_context->vmInstance()->m_currentSandBox = m_oldSandBox;
}
void SandBox::processCatch(const Value& error, SandBoxResult& result)
{
ExecutionState state(m_context);