Quite a lot of stack rooting related changes.

Changes GetProperty, SetProperty and HasProperty and a few other
functions to take handles. The conversions to CScriptVal or
CScriptValRooted at some places should be removed in the future. I've
done that to avoid an even larger patch.

Refs #2415
Refs #2462

This was SVN commit r15568.
This commit is contained in:
Yves
2014-07-26 22:33:16 +00:00
parent e818b08344
commit 28bdd8540f
25 changed files with 801 additions and 619 deletions
+6 -6
View File
@@ -1021,7 +1021,7 @@ bool ScriptInterface::SetGlobal_(const char* name, jsval value, bool replace)
return ok;
}
bool ScriptInterface::SetProperty_(jsval obj, const char* name, jsval value, bool constant, bool enumerate)
bool ScriptInterface::SetProperty_(JS::HandleValue obj, const char* name, JS::HandleValue value, bool constant, bool enumerate)
{
JSAutoRequest rq(m->m_cx);
uint attrs = 0;
@@ -1039,7 +1039,7 @@ bool ScriptInterface::SetProperty_(jsval obj, const char* name, jsval value, boo
return true;
}
bool ScriptInterface::SetProperty_(jsval obj, const wchar_t* name, jsval value, bool constant, bool enumerate)
bool ScriptInterface::SetProperty_(JS::HandleValue obj, const wchar_t* name, JS::HandleValue value, bool constant, bool enumerate)
{
JSAutoRequest rq(m->m_cx);
uint attrs = 0;
@@ -1058,7 +1058,7 @@ bool ScriptInterface::SetProperty_(jsval obj, const wchar_t* name, jsval value,
return true;
}
bool ScriptInterface::SetPropertyInt_(jsval obj, int name, jsval value, bool constant, bool enumerate)
bool ScriptInterface::SetPropertyInt_(JS::HandleValue obj, int name, JS::HandleValue value, bool constant, bool enumerate)
{
JSAutoRequest rq(m->m_cx);
uint attrs = 0;
@@ -1076,7 +1076,7 @@ bool ScriptInterface::SetPropertyInt_(jsval obj, int name, jsval value, bool con
return true;
}
bool ScriptInterface::GetProperty_(jsval obj, const char* name, JS::MutableHandleValue out)
bool ScriptInterface::GetProperty_(JS::HandleValue obj, const char* name, JS::MutableHandleValue out)
{
JSAutoRequest rq(m->m_cx);
if (!obj.isObject())
@@ -1088,7 +1088,7 @@ bool ScriptInterface::GetProperty_(jsval obj, const char* name, JS::MutableHandl
return true;
}
bool ScriptInterface::GetPropertyInt_(jsval obj, int name, JS::MutableHandleValue out)
bool ScriptInterface::GetPropertyInt_(JS::HandleValue obj, int name, JS::MutableHandleValue out)
{
JSAutoRequest rq(m->m_cx);
if (!obj.isObject())
@@ -1100,7 +1100,7 @@ bool ScriptInterface::GetPropertyInt_(jsval obj, int name, JS::MutableHandleValu
return true;
}
bool ScriptInterface::HasProperty(jsval obj, const char* name)
bool ScriptInterface::HasProperty(JS::HandleValue obj, const char* name)
{
// TODO: proper errorhandling
JSAutoRequest rq(m->m_cx);