various (type-safe) getters
| 316 | |
| 317 | // various (type-safe) getters |
| 318 | inline bool as_bool() const { |
| 319 | if (mType != BOOLEAN) |
| 320 | throw DukException() << "Expected boolean, got " << type_name(); |
| 321 | return mPOD.boolean; |
| 322 | } |
| 323 | |
| 324 | inline double as_double() const { |
| 325 | if (mType != NUMBER) |
nothing calls this directly
no test coverage detected