1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/test/script/basic/parser/loopStat.js.EXPECTED Wed Apr 27 01:36:41 2016 +0800 1.3 @@ -0,0 +1,212 @@ 1.4 +{ 1.5 + "type": "Program", 1.6 + "body": [ 1.7 + { 1.8 + "type": "WhileStatement", 1.9 + "test": { 1.10 + "type": "Literal", 1.11 + "value": true 1.12 + }, 1.13 + "body": { 1.14 + "type": "BlockStatement", 1.15 + "body": [ 1.16 + { 1.17 + "type": "ExpressionStatement", 1.18 + "expression": { 1.19 + "type": "CallExpression", 1.20 + "callee": { 1.21 + "type": "Identifier", 1.22 + "name": "print" 1.23 + }, 1.24 + "arguments": [ 1.25 + { 1.26 + "type": "Literal", 1.27 + "value": "hello" 1.28 + } 1.29 + ] 1.30 + } 1.31 + } 1.32 + ] 1.33 + } 1.34 + } 1.35 + ] 1.36 +} 1.37 +{ 1.38 + "type": "Program", 1.39 + "body": [ 1.40 + { 1.41 + "type": "DoWhileStatement", 1.42 + "body": { 1.43 + "type": "BlockStatement", 1.44 + "body": [ 1.45 + { 1.46 + "type": "ExpressionStatement", 1.47 + "expression": { 1.48 + "type": "CallExpression", 1.49 + "callee": { 1.50 + "type": "Identifier", 1.51 + "name": "print" 1.52 + }, 1.53 + "arguments": [ 1.54 + { 1.55 + "type": "Literal", 1.56 + "value": "hello" 1.57 + } 1.58 + ] 1.59 + } 1.60 + } 1.61 + ] 1.62 + }, 1.63 + "test": { 1.64 + "type": "Literal", 1.65 + "value": true 1.66 + } 1.67 + } 1.68 + ] 1.69 +} 1.70 +{ 1.71 + "type": "Program", 1.72 + "body": [ 1.73 + { 1.74 + "type": "ForInStatement", 1.75 + "left": { 1.76 + "type": "Identifier", 1.77 + "name": "i" 1.78 + }, 1.79 + "right": { 1.80 + "type": "Identifier", 1.81 + "name": "obj" 1.82 + }, 1.83 + "body": { 1.84 + "type": "BlockStatement", 1.85 + "body": [ 1.86 + { 1.87 + "type": "ExpressionStatement", 1.88 + "expression": { 1.89 + "type": "CallExpression", 1.90 + "callee": { 1.91 + "type": "Identifier", 1.92 + "name": "print" 1.93 + }, 1.94 + "arguments": [ 1.95 + { 1.96 + "type": "MemberExpression", 1.97 + "object": { 1.98 + "type": "Identifier", 1.99 + "name": "obj" 1.100 + }, 1.101 + "property": { 1.102 + "type": "Identifier", 1.103 + "name": "i" 1.104 + }, 1.105 + "computed": true 1.106 + } 1.107 + ] 1.108 + } 1.109 + } 1.110 + ] 1.111 + }, 1.112 + "each": false 1.113 + } 1.114 + ] 1.115 +} 1.116 +{ 1.117 + "type": "Program", 1.118 + "body": [ 1.119 + { 1.120 + "type": "ForInStatement", 1.121 + "left": { 1.122 + "type": "Identifier", 1.123 + "name": "i" 1.124 + }, 1.125 + "right": { 1.126 + "type": "Identifier", 1.127 + "name": "obj" 1.128 + }, 1.129 + "body": { 1.130 + "type": "BlockStatement", 1.131 + "body": [ 1.132 + { 1.133 + "type": "ExpressionStatement", 1.134 + "expression": { 1.135 + "type": "CallExpression", 1.136 + "callee": { 1.137 + "type": "Identifier", 1.138 + "name": "print" 1.139 + }, 1.140 + "arguments": [ 1.141 + { 1.142 + "type": "Identifier", 1.143 + "name": "i" 1.144 + } 1.145 + ] 1.146 + } 1.147 + } 1.148 + ] 1.149 + }, 1.150 + "each": true 1.151 + } 1.152 + ] 1.153 +} 1.154 +{ 1.155 + "type": "Program", 1.156 + "body": [ 1.157 + { 1.158 + "type": "ForStatement", 1.159 + "init": { 1.160 + "type": "AssignmentExpression", 1.161 + "operator": "=", 1.162 + "left": { 1.163 + "type": "Identifier", 1.164 + "name": "i" 1.165 + }, 1.166 + "right": { 1.167 + "type": "Literal", 1.168 + "value": 0 1.169 + } 1.170 + }, 1.171 + "test": { 1.172 + "type": "BinaryExpression", 1.173 + "operator": "<", 1.174 + "left": { 1.175 + "type": "Identifier", 1.176 + "name": "i" 1.177 + }, 1.178 + "right": { 1.179 + "type": "Literal", 1.180 + "value": 10 1.181 + } 1.182 + }, 1.183 + "update": { 1.184 + "type": "UpdateExpression", 1.185 + "operator": "++", 1.186 + "prefix": false, 1.187 + "argument": { 1.188 + "type": "Identifier", 1.189 + "name": "i" 1.190 + } 1.191 + }, 1.192 + "body": { 1.193 + "type": "BlockStatement", 1.194 + "body": [ 1.195 + { 1.196 + "type": "ExpressionStatement", 1.197 + "expression": { 1.198 + "type": "CallExpression", 1.199 + "callee": { 1.200 + "type": "Identifier", 1.201 + "name": "print" 1.202 + }, 1.203 + "arguments": [ 1.204 + { 1.205 + "type": "Identifier", 1.206 + "name": "i" 1.207 + } 1.208 + ] 1.209 + } 1.210 + } 1.211 + ] 1.212 + } 1.213 + } 1.214 + ] 1.215 +}