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

Method makeNewCast

internal/parser/reparser.go:674–683  ·  view source on GitHub ↗
(t *ast.TypeNode, e *ast.Node, isAssertion bool)

Source from the content-addressed store, hash-verified

672}
673
674func (p *Parser) makeNewCast(t *ast.TypeNode, e *ast.Node, isAssertion bool) *ast.Node {
675 var assert *ast.Node
676 if isAssertion {
677 assert = p.factory.NewAsExpression(e, t)
678 } else {
679 assert = p.factory.NewSatisfiesExpression(e, t)
680 }
681 p.finishNodeWithEnd(assert, e.Pos(), e.End())
682 return assert
683}
684
685func getClassLikeData(parent *ast.Node) *ast.ClassLikeBase {
686 var class *ast.ClassLikeBase

Callers 1

reparseHostedMethod · 0.95

Calls 5

finishNodeWithEndMethod · 0.95
NewAsExpressionMethod · 0.80
PosMethod · 0.65
EndMethod · 0.65

Tested by

no test coverage detected