Software / code / prosody
Comparison
util/serialization.lua @ 9060:69bc3144c2b7
util.serialization: Tighten up type checks
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Sun, 29 Jul 2018 00:17:41 +0200 |
| parent | 9008:ae3c52419ec1 |
| child | 9341:009dad867e52 |
comparison
equal
deleted
inserted
replaced
| 9059:e1db06a0cc6b | 9060:69bc3144c2b7 |
|---|---|
| 149 tag = fr; | 149 tag = fr; |
| 150 fr = mf; | 150 fr = mf; |
| 151 elseif mt then | 151 elseif mt then |
| 152 tag = mt.__type; | 152 tag = mt.__type; |
| 153 end | 153 end |
| 154 if fr then | 154 if type(fr) == "function" then |
| 155 t = fr(t); | 155 t = fr(t); |
| 156 if tag then | 156 if type(tag) == "string" then |
| 157 o[l], l = tag, l + 1; | 157 o[l], l = tag, l + 1; |
| 158 end | 158 end |
| 159 end | 159 end |
| 160 end | 160 end |
| 161 o[l], l = tstart, l + 1; | 161 o[l], l = tstart, l + 1; |