| 1144 | }; |
| 1145 | |
| 1146 | function object_() { |
| 1147 | var first = true, a = []; |
| 1148 | while (!is("punc", "}")) { |
| 1149 | if (first) first = false; else expect(","); |
| 1150 | if (!exigent_mode && is("punc", "}")) |
| 1151 | // allow trailing comma |
| 1152 | break; |
| 1153 | var type = S.token.type; |
| 1154 | var name = as_property_name(); |
| 1155 | if (type == "name" && (name == "get" || name == "set") && !is("punc", ":")) { |
| 1156 | a.push([ as_name(), function_(false), name ]); |
| 1157 | } else { |
| 1158 | expect(":"); |
| 1159 | a.push([ name, expression(false) ]); |
| 1160 | } |
| 1161 | } |
| 1162 | next(); |
| 1163 | return as("object", a); |
| 1164 | }; |
| 1165 | |
| 1166 | function as_property_name() { |
| 1167 | switch (S.token.type) { |