Comparison

util/serialization.lua @ 9480:006a71a83e6a

util.serialization: Make errors fatal by default (like the previous implementation)
author Kim Alvefur <zash@zash.se>
date Thu, 11 Oct 2018 22:42:17 +0200
parent 9341:009dad867e52
child 9483:903e0cfd4cc9
comparison
equal deleted inserted replaced
9479:3a683b2476e2 9480:006a71a83e6a
101 opt.itemstart = opt.itemstart or ""; 101 opt.itemstart = opt.itemstart or "";
102 opt.itemlast = opt.itemlast or ""; 102 opt.itemlast = opt.itemlast or "";
103 opt.equals = opt.equals or "="; 103 opt.equals = opt.equals or "=";
104 end 104 end
105 105
106 local fallback = opt.fatal and fatal_error or opt.fallback or default_fallback; 106 local fallback = opt.fallback or opt.fatal == false and default_fallback or fatal_error;
107 107
108 local function ser(v) 108 local function ser(v)
109 return (types[type(v)] or fallback)(v); 109 return (types[type(v)] or fallback)(v);
110 end 110 end
111 111