MCPcopy Create free account
hub / github.com/microsoft/typescript-go / checkStrictModeDeleteExpression

Method checkStrictModeDeleteExpression

internal/binder/binder.go:1408–1416  ·  view source on GitHub ↗
(node *ast.Node)

Source from the content-addressed store, hash-verified

1406}
1407
1408func (b *Binder) checkStrictModeDeleteExpression(node *ast.Node) {
1409 // Grammar checking
1410 expr := node.AsDeleteExpression()
1411 if expr.Expression.Kind == ast.KindIdentifier {
1412 // When a delete operator occurs within strict mode code, a SyntaxError is thrown if its
1413 // UnaryExpression is a direct reference to a variable, function argument, or function name
1414 b.errorOnNode(expr.Expression, diagnostics.X_delete_cannot_be_called_on_an_identifier_in_strict_mode)
1415 }
1416}
1417
1418func (b *Binder) checkStrictModePostfixUnaryExpression(node *ast.Node) {
1419 // Grammar checking

Callers 1

bindMethod · 0.95

Calls 2

errorOnNodeMethod · 0.95
AsDeleteExpressionMethod · 0.80

Tested by

no test coverage detected