| 254 | } |
| 255 | |
| 256 | static value default_value(const func_args & args) { |
| 257 | args.ensure_count(2, 3); |
| 258 | value val_check = args.get_kwarg_or_pos("boolean", 2); |
| 259 | bool check_bool = val_check->as_bool(); // undefined == false |
| 260 | bool no_value = check_bool |
| 261 | ? (!args.get_pos(0)->as_bool()) |
| 262 | : (args.get_pos(0)->is_undefined() || args.get_pos(0)->is_none()); |
| 263 | return no_value ? args.get_pos(1) : args.get_pos(0); |
| 264 | } |
| 265 | |
| 266 | const func_builtins & global_builtins() { |
| 267 | static const func_builtins builtins = { |
nothing calls this directly
no test coverage detected