| 1422 | |
| 1423 | namespace imp { |
| 1424 | inline void |
| 1425 | widenString(std::vector<uint16_t> *ws, const uint8_t *s, int l) { |
| 1426 | size_t len = static_cast<size_t>(l); |
| 1427 | if (l < 0) { |
| 1428 | len = strlen(reinterpret_cast<const char*>(s)); |
| 1429 | } |
| 1430 | assert(len <= INT_MAX && "string too long"); |
| 1431 | ws->resize(len); |
| 1432 | std::copy(s, s + len, ws->begin()); // NOLINT(build/include_what_you_use) |
| 1433 | } |
| 1434 | } // end of namespace imp |
| 1435 | |
| 1436 | inline MaybeLocal<v8::String> |