(node *ast.Node)
| 1193 | } |
| 1194 | |
| 1195 | func (b *Binder) bindParameter(node *ast.Node) { |
| 1196 | decl := node.AsParameterDeclaration() |
| 1197 | if node.Flags&ast.NodeFlagsAmbient == 0 { |
| 1198 | // It is a SyntaxError if the identifier eval or arguments appears within a FormalParameterList of a |
| 1199 | // strict mode FunctionLikeDeclaration or FunctionExpression(13.1) |
| 1200 | b.checkStrictModeEvalOrArguments(node, decl.Name()) |
| 1201 | } |
| 1202 | if ast.IsBindingPattern(decl.Name()) { |
| 1203 | index := slices.Index(node.Parent.Parameters(), node) |
| 1204 | b.bindAnonymousDeclaration(node, ast.SymbolFlagsFunctionScopedVariable, "__"+strconv.Itoa(index)) |
| 1205 | } else { |
| 1206 | b.declareSymbolAndAddToSymbolTable(node, ast.SymbolFlagsFunctionScopedVariable, ast.SymbolFlagsParameterExcludes) |
| 1207 | } |
| 1208 | // If this is a property-parameter, then also declare the property symbol into the |
| 1209 | // containing class. |
| 1210 | if ast.IsParameterPropertyDeclaration(node, node.Parent) { |
| 1211 | classDeclaration := node.Parent.Parent |
| 1212 | flags := ast.SymbolFlagsProperty | core.IfElse(decl.QuestionToken != nil, ast.SymbolFlagsOptional, ast.SymbolFlagsNone) |
| 1213 | b.declareSymbol(ast.GetMembers(classDeclaration.Symbol()), classDeclaration.Symbol(), node, flags, ast.SymbolFlagsPropertyExcludes) |
| 1214 | } |
| 1215 | } |
| 1216 | |
| 1217 | func (b *Binder) bindFunctionDeclaration(node *ast.Node) { |
| 1218 | if !b.file.IsDeclarationFile && node.Flags&ast.NodeFlagsAmbient == 0 && ast.IsAsyncFunction(node) { |
no test coverage detected