MCPcopy Index your code
hub / github.com/Shopify/go-lua / writeConstants

Method writeConstants

dump.go:51–69  ·  view source on GitHub ↗
(p *prototype)

Source from the content-addressed store, hash-verified

49}
50
51func (d *dumpState) writeConstants(p *prototype) {
52 d.writeInt(len(p.constants))
53
54 for _, o := range p.constants {
55 d.writeByte(byte(d.l.valueToType(o)))
56
57 switch o := o.(type) {
58 case nil:
59 case bool:
60 d.writeBool(o)
61 case float64:
62 d.writeNumber(o)
63 case string:
64 d.writeString(o)
65 default:
66 d.l.assert(false)
67 }
68 }
69}
70
71func (d *dumpState) writePrototypes(p *prototype) {
72 d.writeInt(len(p.prototypes))

Callers 1

dumpFunctionMethod · 0.95

Calls 7

writeIntMethod · 0.95
writeByteMethod · 0.95
writeBoolMethod · 0.95
writeNumberMethod · 0.95
writeStringMethod · 0.95
valueToTypeMethod · 0.80
assertMethod · 0.45

Tested by

no test coverage detected