(params, kind?: string)
| 1987 | } |
| 1988 | |
| 1989 | parsePattern(params, kind?: string): Node.BindingIdentifier | Node.BindingPattern { |
| 1990 | let pattern; |
| 1991 | |
| 1992 | if (this.match('[')) { |
| 1993 | pattern = this.parseArrayPattern(params, kind); |
| 1994 | } else if (this.match('{')) { |
| 1995 | pattern = this.parseObjectPattern(params, kind); |
| 1996 | } else { |
| 1997 | if (this.matchKeyword('let') && (kind === 'const' || kind === 'let')) { |
| 1998 | this.tolerateUnexpectedToken(this.lookahead, Messages.LetInLexicalBinding); |
| 1999 | } |
| 2000 | params.push(this.lookahead); |
| 2001 | pattern = this.parseVariableIdentifier(kind); |
| 2002 | } |
| 2003 | |
| 2004 | return pattern; |
| 2005 | } |
| 2006 | |
| 2007 | parsePatternWithDefault(params, kind?: string): Node.AssignmentPattern | Node.BindingIdentifier | Node.BindingPattern { |
| 2008 | const startToken = this.lookahead; |
no test coverage detected