(c)
| 5498 | } |
| 5499 | |
| 5500 | function classbody(c) { |
| 5501 | var name; |
| 5502 | var isStatic; |
| 5503 | var getset; |
| 5504 | var props = {}; |
| 5505 | var staticProps = {}; |
| 5506 | var computed; |
| 5507 | for (var i = 0; state.tokens.next.id !== "}"; ++i) { |
| 5508 | name = state.tokens.next; |
| 5509 | isStatic = false; |
| 5510 | getset = null; |
| 5511 | if (name.id === "[") { |
| 5512 | name = computedPropertyName(); |
| 5513 | } else if (isPropertyName(name)) { |
| 5514 | advance(); |
| 5515 | computed = false; |
| 5516 | if (name.identifier && name.value === "static") { |
| 5517 | if (isPropertyName(state.tokens.next) || state.tokens.next.id === "[") { |
| 5518 | computed = state.tokens.next.id === "["; |
| 5519 | isStatic = true; |
| 5520 | name = state.tokens.next; |
| 5521 | if (state.tokens.next.id === "[") { |
| 5522 | name = computedPropertyName(); |
| 5523 | } else advance(); |
| 5524 | } |
| 5525 | } |
| 5526 | |
| 5527 | if (name.identifier && (name.value === "get" || name.value === "set")) { |
| 5528 | if (isPropertyName(state.tokens.next) || state.tokens.next.id === "[") { |
| 5529 | computed = state.tokens.next.id === "["; |
| 5530 | getset = name; |
| 5531 | name = state.tokens.next; |
| 5532 | if (state.tokens.next.id === "[") { |
| 5533 | name = computedPropertyName(); |
| 5534 | } else advance(); |
| 5535 | } |
| 5536 | } |
| 5537 | } else { |
| 5538 | warning("W052", state.tokens.next, state.tokens.next.value || state.tokens.next.type); |
| 5539 | advance(); |
| 5540 | continue; |
| 5541 | } |
| 5542 | |
| 5543 | if (!checkPunctuators(state.tokens.next, ["("])) { |
| 5544 | error("E054", state.tokens.next, state.tokens.next.value); |
| 5545 | while (state.tokens.next.id !== "}" && |
| 5546 | !checkPunctuators(state.tokens.next, ["("])) { |
| 5547 | advance(); |
| 5548 | } |
| 5549 | if (state.tokens.next.value !== "(") { |
| 5550 | doFunction(undefined, c, false, null); |
| 5551 | } |
| 5552 | } |
| 5553 | |
| 5554 | if (!computed) { |
| 5555 | if (getset) { |
| 5556 | saveAccessor( |
| 5557 | getset.value, isStatic ? staticProps : props, name.value, name, true, isStatic); |
no test coverage detected