My favorites | Sign in
Project Home Downloads Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions

Issue 145 attachment: mxunit.framework.PublicProxyMaker.cfc.diff (2.8 KB)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
Index: PublicProxyMaker.cfc
===================================================================
--- PublicProxyMaker.cfc (revision 87)
+++ PublicProxyMaker.cfc (working copy)
@@ -45,15 +45,15 @@
</cfif>

<!--- generate a CFC that contains a public method. this method will call the private method we want to call --->
- <cfset s_args = constructArgumentsTags(methodStruct)>
-
+ <cfset s_argTags = constructArgumentsTags(methodStruct)>
+
<cfoutput>
<cfsavecontent variable="output">
- <%cfcomponent% extends="#md.name#">
-
+ <%cfcomponent extends="#md.name#"%>
+
<%cffunction name="#arguments.proxyMethodName#" access="public"%>
- #s_args.tags#
- <%cf#componentReturnTag# #renamedExistingMethod#(#s_args.args#)%>
+ #s_argTags#
+ <%cf#componentReturnTag# #renamedExistingMethod#(argumentCollection=arguments)%>
<%/cffunction%>

<%/cfcomponent%>
@@ -104,29 +104,26 @@

</cffunction>

- <cffunction name="constructArgumentsTags" returntype="struct" access="private" hint="creates the cfargument tags, the method call to the private method, and the return statement for the component">
+ <cffunction name="constructArgumentsTags" returntype="string" access="private" hint="creates the cfargument tags, the method call to the private method, and the return statement for the component">
<cfargument name="privateMethodStruct" type="struct" hint="the structure of metadata for the private method under consideration">
- <cfset var strArgs = "">
<cfset var strArgTags = "">
<cfset var thisParamString = "">
<cfset var thisTagString = "">
<cfset var a_params = privateMethodStruct.Parameters>
<cfset var p = 1>
<cfset var pCount = ArrayLen(a_params)>
- <cfset var s_return = StructNew()>

<cfloop from="1" to="#pCount#" index="p">
- <cfparam name="a_params[p].default" default="">
<cfparam name="a_params[p].required" default="false">
- <cfset thisTagString = "<cfargument name='#a_params[p].name#' required='#a_params[p].required#' default='#a_params[p].default#'>">
+ <cfset thisTagString = "<cfargument name='#a_params[p].name#' required='#a_params[p].required#'">
+ <cfif structKeyExists(a_params[p], 'default')>
+ <cfset thisTagString = thisTagString & " default='#a_params[p].default#'">
+ </cfif>
+ <cfset thisTagString = thisTagString & ">">
<cfset thisParamString = a_params[p].name & " = arguments.#a_params[p].name#">
<cfset strArgTags = ListAppend(strArgTags, thisTagString, lineSep)>
- <cfset strArgs = ListAppend(strArgs, thisParamString)>
</cfloop>
- <cfset s_return.tags = strArgTags>
- <cfset s_return.args = strArgs>
- <cfreturn s_return>
- <!--- <cfreturn strArgTags & lineSep & "<cfreturn #privateMethodStruct.name#(#strArgs#)>"> --->
+ <cfreturn strArgTags>
</cffunction>

</cfcomponent>
\ No newline at end of file
Powered by Google Project Hosting