"Fossies" - the Fresh Open Source Software Archive 
Member "gnash-0.8.10/testsuite/misc-swfmill.all/afunc_dict.xml" (19 Jan 2012, 3373 Bytes) of package /linux/www/old/gnash-0.8.10.tar.gz:
As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) XML source code syntax highlighting (style:
standard) with prefixed line numbers.
Alternatively you can here
view or
download the uninterpreted source code file.
1 <?xml version="1.0"?>
2 <swf version="6" compressed="0">
3
4 <!--
5
6 Test file for https://savannah.gnu.org/bugs/?33521
7
8 Shows that functions keep a reference on the constant
9 pool in place at time of their definition, even if
10 the pool in the action buffer is overridden at time
11 of function call.
12
13 This file uses anonymous function, see func_dict.xml
14 for a named function.
15
16 -->
17
18 <Header framerate="12" frames="1">
19 <size>
20 <Rectangle left="0" right="12800" top="0" bottom="9600"/>
21 </size>
22 <tags>
23 <DoAction>
24 <actions>
25
26 <!-- Dictionary at time of function definition -->
27 <Dictionary>
28 <strings>
29 <String value="a"/>
30 </strings>
31 </Dictionary>
32
33 <!-- Name we'll assign to the function -->
34 <PushData>
35 <items>
36 <StackString value="f"/>
37 </items>
38 </PushData>
39
40 <!-- Function code -->
41 <DeclareFunction name="" argc="0" length="15">
42 <args/>
43 </DeclareFunction>
44 <PushData>
45 <items>
46 <StackString value="r"/>
47 </items>
48 </PushData>
49 <Duplicate/>
50 <GetVariable/>
51 <PushData>
52 <items>
53 <StackDictionaryLookup index="0"/>
54 </items>
55 </PushData>
56 <AddTyped/>
57 <SetVariable/>
58
59 <!-- Assigning the anonymous function to the variable `f' -->
60 <SetVariable/>
61
62 <!-- Dictionary after function definition -->
63 <Dictionary>
64 <strings>
65 <String value="b"/>
66 </strings>
67 </Dictionary>
68
69
70 <!-- Main code -->
71
72 // Append dict[0] to `r'
73 <PushData>
74 <items>
75 <StackString value="r"/>
76 </items>
77 </PushData>
78 <Duplicate/>
79 <GetVariable/>
80 <PushData>
81 <items>
82 <StackDictionaryLookup index="0"/>
83 </items>
84 </PushData>
85 <AddTyped/>
86 <SetVariable/>
87
88 // Call the function appending dict[0] to `r'
89 <PushData>
90 <items>
91 <StackInteger value="0"/>
92 <StackString value="f"/>
93 </items>
94 </PushData>
95 <CallFunction/>
96 <Pop/>
97
98 // Verify `r' equals 'ba'
99 <PushData>
100 <items>
101 <StackString value="ba"/>
102 <StackString value="r"/>
103 </items>
104 </PushData>
105 <GetVariable/>
106 <EqualTyped/>
107
108 // If true, jump to PASSED tracing
109 <BranchIfTrue byteOffset="51"/>
110
111 // Else, trace XFAILED
112 <PushData>
113 <items>
114 <StackString value="FAILED: func used overridden dictionary "/>
115 </items>
116 </PushData>
117 <Trace/>
118 <BranchAlways byteOffset="44"/> // get to end
119
120 // PASSED tracing
121 <PushData>
122 <items>
123 <StackString value="PASSED: func used original dictionary "/>
124 </items>
125 </PushData>
126 <Trace/>
127
128 // END OF TEST tag
129 <PushData>
130 <items>
131 <StackString value="END OF TEST"/>
132 </items>
133 </PushData>
134 <Trace/>
135
136 <EndAction/>
137 </actions>
138 </DoAction>
139 <ShowFrame/>
140 <End/>
141 </tags>
142 </Header>
143 </swf>