(node)
| 88720 | } |
| 88721 | } |
| 88722 | function checkGrammarBindingElement(node) { |
| 88723 | if (node.dotDotDotToken) { |
| 88724 | var elements = node.parent.elements; |
| 88725 | if (node !== ts.last(elements)) { |
| 88726 | return grammarErrorOnNode(node, ts.Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern); |
| 88727 | } |
| 88728 | checkGrammarForDisallowedTrailingComma(elements, ts.Diagnostics.A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma); |
| 88729 | if (node.propertyName) { |
| 88730 | return grammarErrorOnNode(node.name, ts.Diagnostics.A_rest_element_cannot_have_a_property_name); |
| 88731 | } |
| 88732 | } |
| 88733 | if (node.dotDotDotToken && node.initializer) { |
| 88734 | // Error on equals token which immediately precedes the initializer |
| 88735 | return grammarErrorAtPos(node, node.initializer.pos - 1, 1, ts.Diagnostics.A_rest_element_cannot_have_an_initializer); |
| 88736 | } |
| 88737 | } |
| 88738 | function isStringOrNumberLiteralExpression(expr) { |
| 88739 | return ts.isStringOrNumericLiteralLike(expr) || |
| 88740 | expr.kind === 219 /* SyntaxKind.PrefixUnaryExpression */ && expr.operator === 40 /* SyntaxKind.MinusToken */ && |
no test coverage detected