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

Method VariableStatement

bindings/bindings.go:544–566  ·  view source on GitHub ↗
(stmt *VariableStatement)

Source from the content-addressed store, hash-verified

542}
543
544func (b *Bindings) VariableStatement(stmt *VariableStatement) (*goja.Object, error) {
545 aliasFunc, err := b.f("variableStatement")
546 if err != nil {
547 return nil, err
548 }
549
550 siObj, err := b.ToTypescriptNode(stmt.Declarations)
551 if err != nil {
552 return nil, fmt.Errorf("alias type: %w", err)
553 }
554
555 res, err := aliasFunc(goja.Undefined(),
556 b.vm.ToValue(ToStrings(stmt.Modifiers)),
557 siObj,
558 )
559 if err != nil {
560 return nil, xerrors.Errorf("call aliasDecl: %w", err)
561 }
562
563 obj := res.ToObject(b.vm)
564
565 return obj, nil
566}
567
568func (b *Bindings) VariableDeclarationList(list *VariableDeclarationList) (*goja.Object, error) {
569 aliasFunc, err := b.f("variableDeclarationList")

Callers 1

Calls 3

fMethod · 0.95
ToTypescriptNodeMethod · 0.95
ToStringsFunction · 0.85

Tested by

no test coverage detected