Value Function::Invoke(const std::vector<Value>& arguments)
{
- ScriptFrame frame;
+ ScriptFrame frame(false);
return m_Callback(arguments);
}
Value Function::InvokeThis(const Value& otherThis, const std::vector<Value>& arguments)
{
- ScriptFrame frame;
- frame.Self = otherThis;
+ ScriptFrame frame(otherThis, false);
return m_Callback(arguments);
}
ScriptFrame::AddImport(deprecatedNS);
}, 50);
-ScriptFrame::ScriptFrame(void)
- : Locals(new Dictionary()), Self(ScriptGlobal::GetGlobals()), Sandboxed(false), Depth(0)
+ScriptFrame::ScriptFrame(bool allocLocals)
+ : Locals(allocLocals ? new Dictionary() : nullptr), Self(ScriptGlobal::GetGlobals()), Sandboxed(false), Depth(0)
{
InitializeFrame();
}
-ScriptFrame::ScriptFrame(const Value& self)
- : Locals(new Dictionary()), Self(self), Sandboxed(false), Depth(0)
+ScriptFrame::ScriptFrame(const Value& self, bool allocLocals)
+ : Locals(allocLocals ? new Dictionary() : nullptr), Self(self), Sandboxed(false), Depth(0)
{
InitializeFrame();
}
bool Sandboxed;
int Depth;
- ScriptFrame(void);
- ScriptFrame(const Value& self);
+ ScriptFrame(bool allocLocals = true);
+ ScriptFrame(const Value& self, bool allocLocals = true);
~ScriptFrame(void);
void IncreaseStackDepth(void);