MCPcopy Create free account
hub / github.com/coder/guts / VariableDeclarationList

Method VariableDeclarationList

bindings/bindings.go:568–593  ·  view source on GitHub ↗
(list *VariableDeclarationList)

Source from the content-addressed store, hash-verified

566}
567
568func (b *Bindings) VariableDeclarationList(list *VariableDeclarationList) (*goja.Object, error) {
569 aliasFunc, err := b.f("variableDeclarationList")
570 if err != nil {
571 return nil, err
572 }
573
574 var decls []interface{}
575 for _, decl := range list.Declarations {
576 v, err := b.ToTypescriptNode(decl)
577 if err != nil {
578 return nil, err
579 }
580 decls = append(decls, v)
581 }
582
583 res, err := aliasFunc(
584 goja.Undefined(),
585 b.vm.NewArray(decls...),
586 b.vm.ToValue(list.Flags),
587 )
588 if err != nil {
589 return nil, xerrors.Errorf("call variableDeclarationList: %w", err)
590 }
591
592 return res.ToObject(b.vm), nil
593}
594
595func (b *Bindings) VariableDeclaration(decl *VariableDeclaration) (*goja.Object, error) {
596 aliasFunc, err := b.f("variableDeclaration")

Callers 1

Calls 2

fMethod · 0.95
ToTypescriptNodeMethod · 0.95

Tested by

no test coverage detected