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

Method PropertyAssignment

bindings/bindings.go:963–977  ·  view source on GitHub ↗

PropertyAssignment builds ` : ` for an ObjectLiteralExpression child.

(pa *PropertyAssignment)

Source from the content-addressed store, hash-verified

961// PropertyAssignment builds `<name>: <initializer>` for an
962// ObjectLiteralExpression child.
963func (b *Bindings) PropertyAssignment(pa *PropertyAssignment) (*goja.Object, error) {
964 paF, err := b.f("propertyAssignment")
965 if err != nil {
966 return nil, err
967 }
968 init, err := b.ToTypescriptNode(pa.Initializer)
969 if err != nil {
970 return nil, fmt.Errorf("property assignment %q initializer: %w", pa.Name, err)
971 }
972 res, err := paF(goja.Undefined(), b.vm.ToValue(pa.Name), init)
973 if err != nil {
974 return nil, xerrors.Errorf("call propertyAssignment: %w", err)
975 }
976 return res.ToObject(b.vm), nil
977}
978
979// Parameter builds a single `name: type` arrow-function parameter.
980func (b *Bindings) Parameter(p *Parameter) (*goja.Object, error) {

Callers 2

ToTypescriptNodeMethod · 0.95

Calls 2

fMethod · 0.95
ToTypescriptNodeMethod · 0.95

Tested by

no test coverage detected