| 309 | } |
| 310 | |
| 311 | void URLSearchParamsImpl::Values(const v8::FunctionCallbackInfo<v8::Value> &args) { |
| 312 | URLSearchParamsImpl *ptr = GetPointer(args.This()); |
| 313 | auto isolate = args.GetIsolate(); |
| 314 | auto context = isolate->GetCurrentContext(); |
| 315 | if (ptr == nullptr) { |
| 316 | args.GetReturnValue().Set(v8::Array::New(isolate)); |
| 317 | return; |
| 318 | } |
| 319 | |
| 320 | auto keys = ptr->GetURLSearchParams()->get_keys(); |
| 321 | |
| 322 | auto len = ptr->GetURLSearchParams()->size(); |
| 323 | auto ret = v8::Array::New(isolate, len); |
| 324 | int i = 0; |
| 325 | while (keys.has_next()) { |
| 326 | auto key = keys.next(); |
| 327 | if (key) { |
| 328 | auto value = ptr->GetURLSearchParams()->get(key.value()); |
| 329 | if (value.has_value()) { |
| 330 | ret->Set(context, i++, |
| 331 | ArgConverter::ConvertToV8String(isolate, std::string(value.value()))); |
| 332 | } |
| 333 | |
| 334 | } |
| 335 | |
| 336 | } |
| 337 | args.GetReturnValue().Set(ret); |
| 338 | |
| 339 | } |
| 340 | |
| 341 | |
| 342 | url_search_params *URLSearchParamsImpl::GetURLSearchParams() { |
nothing calls this directly
no test coverage detected