PropertyAssignment builds ` : ` for an ObjectLiteralExpression child.
(pa *PropertyAssignment)
| 961 | // PropertyAssignment builds `<name>: <initializer>` for an |
| 962 | // ObjectLiteralExpression child. |
| 963 | func (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. |
| 980 | func (b *Bindings) Parameter(p *Parameter) (*goja.Object, error) { |
no test coverage detected