Fri, 21 Feb 2014 17:58:33 +0530
8033745: Reflect upon Nashorn reflection
Reviewed-by: ahgross, attila, jlaskey
1 {
2 "type": "Program",
3 "body": [
4 {
5 "type": "ExpressionStatement",
6 "expression": {
7 "type": "MemberExpression",
8 "object": {
9 "type": "Identifier",
10 "name": "a"
11 },
12 "property": {
13 "type": "Literal",
14 "value": 3
15 },
16 "computed": true
17 }
18 }
19 ]
20 }
21 {
22 "type": "Program",
23 "body": [
24 {
25 "type": "ExpressionStatement",
26 "expression": {
27 "type": "MemberExpression",
28 "object": {
29 "type": "Identifier",
30 "name": "a"
31 },
32 "property": {
33 "type": "Identifier",
34 "name": "b"
35 },
36 "computed": true
37 }
38 }
39 ]
40 }
41 {
42 "type": "Program",
43 "body": [
44 {
45 "type": "ExpressionStatement",
46 "expression": {
47 "type": "MemberExpression",
48 "object": {
49 "type": "Identifier",
50 "name": "a"
51 },
52 "property": {
53 "type": "Literal",
54 "value": "foo"
55 },
56 "computed": true
57 }
58 }
59 ]
60 }
61 {
62 "type": "Program",
63 "body": [
64 {
65 "type": "ExpressionStatement",
66 "expression": {
67 "type": "MemberExpression",
68 "object": {
69 "type": "Identifier",
70 "name": "obj"
71 },
72 "property": {
73 "type": "Identifier",
74 "name": "foo"
75 },
76 "computed": false
77 }
78 }
79 ]
80 }
81 {
82 "type": "Program",
83 "body": [
84 {
85 "type": "ExpressionStatement",
86 "expression": {
87 "type": "MemberExpression",
88 "object": {
89 "type": "MemberExpression",
90 "object": {
91 "type": "Identifier",
92 "name": "obj"
93 },
94 "property": {
95 "type": "Identifier",
96 "name": "foo"
97 },
98 "computed": false
99 },
100 "property": {
101 "type": "Identifier",
102 "name": "bar"
103 },
104 "computed": false
105 }
106 }
107 ]
108 }
109 {
110 "type": "Program",
111 "body": [
112 {
113 "type": "ExpressionStatement",
114 "expression": {
115 "type": "NewExpression",
116 "callee": {
117 "type": "Identifier",
118 "name": "Type"
119 },
120 "arguments": []
121 }
122 }
123 ]
124 }
125 {
126 "type": "Program",
127 "body": [
128 {
129 "type": "ExpressionStatement",
130 "expression": {
131 "type": "NewExpression",
132 "callee": {
133 "type": "Identifier",
134 "name": "Type"
135 },
136 "arguments": []
137 }
138 }
139 ]
140 }
141 {
142 "type": "Program",
143 "body": [
144 {
145 "type": "ExpressionStatement",
146 "expression": {
147 "type": "NewExpression",
148 "callee": {
149 "type": "Identifier",
150 "name": "Type"
151 },
152 "arguments": [
153 {
154 "type": "Identifier",
155 "name": "a"
156 },
157 {
158 "type": "Literal",
159 "value": "hello"
160 }
161 ]
162 }
163 }
164 ]
165 }
166 {
167 "type": "Program",
168 "body": [
169 {
170 "type": "ExpressionStatement",
171 "expression": {
172 "type": "NewExpression",
173 "callee": {
174 "type": "MemberExpression",
175 "object": {
176 "type": "Identifier",
177 "name": "obj"
178 },
179 "property": {
180 "type": "Identifier",
181 "name": "Type"
182 },
183 "computed": false
184 },
185 "arguments": []
186 }
187 }
188 ]
189 }
190 {
191 "type": "Program",
192 "body": [
193 {
194 "type": "ExpressionStatement",
195 "expression": {
196 "type": "NewExpression",
197 "callee": {
198 "type": "MemberExpression",
199 "object": {
200 "type": "Identifier",
201 "name": "obj"
202 },
203 "property": {
204 "type": "Identifier",
205 "name": "Type"
206 },
207 "computed": false
208 },
209 "arguments": []
210 }
211 }
212 ]
213 }
214 {
215 "type": "Program",
216 "body": [
217 {
218 "type": "ExpressionStatement",
219 "expression": {
220 "type": "NewExpression",
221 "callee": {
222 "type": "MemberExpression",
223 "object": {
224 "type": "Identifier",
225 "name": "obj"
226 },
227 "property": {
228 "type": "Identifier",
229 "name": "Type"
230 },
231 "computed": false
232 },
233 "arguments": [
234 {
235 "type": "Identifier",
236 "name": "a"
237 },
238 {
239 "type": "Literal",
240 "value": "hello"
241 }
242 ]
243 }
244 }
245 ]
246 }
247 {
248 "type": "Program",
249 "body": [
250 {
251 "type": "ExpressionStatement",
252 "expression": {
253 "type": "CallExpression",
254 "callee": {
255 "type": "Identifier",
256 "name": "foo"
257 },
258 "arguments": []
259 }
260 }
261 ]
262 }
263 {
264 "type": "Program",
265 "body": [
266 {
267 "type": "ExpressionStatement",
268 "expression": {
269 "type": "CallExpression",
270 "callee": {
271 "type": "MemberExpression",
272 "object": {
273 "type": "Identifier",
274 "name": "obj"
275 },
276 "property": {
277 "type": "Identifier",
278 "name": "foo"
279 },
280 "computed": false
281 },
282 "arguments": []
283 }
284 }
285 ]
286 }
287 {
288 "type": "Program",
289 "body": [
290 {
291 "type": "ExpressionStatement",
292 "expression": {
293 "type": "CallExpression",
294 "callee": {
295 "type": "Identifier",
296 "name": "foo"
297 },
298 "arguments": [
299 {
300 "type": "Identifier",
301 "name": "a"
302 },
303 {
304 "type": "Identifier",
305 "name": "b"
306 }
307 ]
308 }
309 }
310 ]
311 }
312 {
313 "type": "Program",
314 "body": [
315 {
316 "type": "ExpressionStatement",
317 "expression": {
318 "type": "CallExpression",
319 "callee": {
320 "type": "MemberExpression",
321 "object": {
322 "type": "Identifier",
323 "name": "obj"
324 },
325 "property": {
326 "type": "Identifier",
327 "name": "foo"
328 },
329 "computed": false
330 },
331 "arguments": [
332 {
333 "type": "Identifier",
334 "name": "a"
335 },
336 {
337 "type": "Identifier",
338 "name": "b"
339 }
340 ]
341 }
342 }
343 ]
344 }