libkroll/javascript/kjs_util.cpp
static JSValueRef GetFunctionPrototype(JSContextRef jsContext, JSValueRef* exception) 
	{
		JSObjectRef globalObject = JSContextGetGlobalObject(jsContext);
		JSStringRef fnPropName = JSStringCreateWithUTF8CString("Function");
		JSValueRef fnCtorValue = JSObjectGetProperty(jsContext, globalObject,
			fnPropName, exception);
		JSStringRelease(fnPropName);
		if (!fnCtorValue)
		{
			return JSValueMakeUndefined(jsContext);
		}

		JSObjectRef fnCtorObject = JSValueToObject(jsContext, fnCtorValue, exception);
		if (!fnCtorObject)
		{
			return JSValueMakeUndefined(jsContext);
		}

		JSStringRef protoPropName = JSStringCreateWithUTF8CString("prototype");
		JSValueRef fnPrototype = JSObjectGetProperty(jsContext, fnCtorObject,
			protoPropName, exception);
		JSStringRelease(protoPropName);
		if (!fnPrototype)
		{
			return JSValueMakeUndefined(jsContext);
		}

	return fnPrototype;
	}
/*
	 * The following takes the prototype from the Function constructor, this allows
	 * us to easily support call and apply on our objects that support CallAsFunction.
	 *
	 * NOTE: The return value is not protected.
	 */
The following takes the prototype from the Function constructor, this allows
us to easily support call and apply on our objects that support CallAsFunction.

The return value is not protected.
The following takes the prototype from the Function constructor this allows us to easily support call and apply on our objects that support CallAsFunction . The return value is not protected .
static JSValueRef GetFunctionPrototype(JSContextRef jsContext, JSValueRef* exception) 
	{
		JSObjectRef globalObject = JSContextGetGlobalObject(jsContext);
		JSStringRef fnPropName = JSStringCreateWithUTF8CString("Function");
		JSValueRef fnCtorValue = JSObjectGetProperty(jsContext, globalObject,
			fnPropName, exception);
		JSStringRelease(fnPropName);
		if (!fnCtorValue)
		{
			return JSValueMakeUndefined(jsContext);
		}
		JSObjectRef fnCtorObject = JSValueToObject(jsContext, fnCtorValue, exception);
		if (!fnCtorObject)
		{
			return JSValueMakeUndefined(jsContext);
		}
		JSStringRef protoPropName = JSStringCreateWithUTF8CString("prototype");
		JSValueRef fnPrototype = JSObjectGetProperty(jsContext, fnCtorObject,
			protoPropName, exception);
		JSStringRelease(protoPropName);
		if (!fnPrototype)
		{
			return JSValueMakeUndefined(jsContext);
		}
	return fnPrototype;
	}
static JSValueRef GetFunctionPrototype ( JSContextRef jsContext , JSValueRef * exception ) { JSObjectRef globalObject = JSContextGetGlobalObject ( jsContext ) ; JSStringRef fnPropName = JSStringCreateWithUTF8CString ( " " ) ; JSValueRef fnCtorValue = JSObjectGetProperty ( jsContext , globalObject , fnPropName , exception ) ; JSStringRelease ( fnPropName ) ; if ( ! fnCtorValue ) { return JSValueMakeUndefined ( jsContext ) ; } JSObjectRef fnCtorObject = JSValueToObject ( jsContext , fnCtorValue , exception ) ; if ( ! fnCtorObject ) { return JSValueMakeUndefined ( jsContext ) ; } JSStringRef protoPropName = JSStringCreateWithUTF8CString ( " " ) ; JSValueRef fnPrototype = JSObjectGetProperty ( jsContext , fnCtorObject , protoPropName , exception ) ; JSStringRelease ( protoPropName ) ; if ( ! fnPrototype ) { return JSValueMakeUndefined ( jsContext ) ; } return fnPrototype ; }
The following takes the prototype from the Function constructor, this allows
 us to easily support call and apply on our objects that support CallAsFunction.
The following takes the prototype from the Function constructor this allows us to easily support call and apply on our objects that support CallAsFunction .