| 506 | } |
| 507 | |
| 508 | std::string gjs_debug_string(JSString* str) { |
| 509 | if (!str) |
| 510 | return "<null string>"; |
| 511 | if (!JS_StringIsLinear(str)) { |
| 512 | std::ostringstream out("<non-flat string of length ", |
| 513 | std::ios_base::ate); |
| 514 | out << JS_GetStringLength(str) << '>'; |
| 515 | return out.str(); |
| 516 | } |
| 517 | return gjs_debug_linear_string(JS_ASSERT_STRING_IS_LINEAR(str), |
| 518 | DoubleQuotes); |
| 519 | } |
| 520 | |
| 521 | std::string gjs_debug_symbol(JS::Symbol* const sym) { |
| 522 | if (!sym) |