Example #1
0
VJSObject VJSObject::GetPropertyAsObject( const VString& inPropertyName, JS4D::ExceptionRef *outException) const
{
	JSStringRef jsName = JS4D::VStringToString( inPropertyName);
	JSValueRef value = JSObjectGetProperty( fContext, fObject, jsName, outException);
	JSObjectRef objectRef = ((value != NULL) && JSValueIsObject( fContext, value)) ? JSValueToObject( fContext, value, outException) : NULL;
	JSStringRelease( jsName);
	return VJSObject( fContext, objectRef);
}
Example #2
0
VJSObject VJSPropertyIterator::GetPropertyAsObject( JS4D::ExceptionRef *outException) const
{
	JS4D::ValueRef value = _GetProperty(  outException);
	return VJSObject( fObject.GetContextRef(), ((value != NULL) && JSValueIsObject( fObject.GetContextRef(), value)) ? JSValueToObject( fObject.GetContextRef(), value, outException) : NULL);
}
VJSObject VJSContext::GetGlobalObject() const
{
	return VJSObject( fContext, JSContextGetGlobalObject( fContext));
}
VJSGlobalObject::operator VJSObject() const
{
	return VJSObject( fContext, JSContextGetGlobalObject( fContext));
}
VJSObject VJSContext::MakeFunction( const VString& inName, const VectorOfVString *inParamNames, const VString& inBody, const VURL *inUrl, sLONG inStartingLineNumber, JS4D::ExceptionRef *outException)
{
	return VJSObject( fContext, JS4D::MakeFunction( fContext, inName, inParamNames, inBody, inUrl, inStartingLineNumber, outException));
}