| 18 | } |
| 19 | |
| 20 | v8::Local<v8::FunctionTemplate> URLSearchParamsImpl::GetCtor(v8::Isolate *isolate) { |
| 21 | v8::Local<v8::FunctionTemplate> ctorTmpl = v8::FunctionTemplate::New(isolate, Ctor); |
| 22 | ctorTmpl->SetClassName(ArgConverter::ConvertToV8String(isolate, "URLSearchParams")); |
| 23 | |
| 24 | auto tmpl = ctorTmpl->InstanceTemplate(); |
| 25 | tmpl->SetInternalFieldCount(1); |
| 26 | tmpl->Set( |
| 27 | ArgConverter::ConvertToV8String(isolate, "append"), |
| 28 | v8::FunctionTemplate::New(isolate, Append)); |
| 29 | tmpl->Set( |
| 30 | ArgConverter::ConvertToV8String(isolate, "delete"), |
| 31 | v8::FunctionTemplate::New(isolate, Delete)); |
| 32 | |
| 33 | tmpl->Set( |
| 34 | ArgConverter::ConvertToV8String(isolate, "entries"), |
| 35 | v8::FunctionTemplate::New(isolate, Entries)); |
| 36 | |
| 37 | tmpl->Set( |
| 38 | ArgConverter::ConvertToV8String(isolate, "forEach"), |
| 39 | v8::FunctionTemplate::New(isolate, ForEach)); |
| 40 | |
| 41 | tmpl->Set( |
| 42 | ArgConverter::ConvertToV8String(isolate, "get"), |
| 43 | v8::FunctionTemplate::New(isolate, Get)); |
| 44 | |
| 45 | tmpl->Set( |
| 46 | ArgConverter::ConvertToV8String(isolate, "getAll"), |
| 47 | v8::FunctionTemplate::New(isolate, GetAll)); |
| 48 | |
| 49 | tmpl->Set( |
| 50 | ArgConverter::ConvertToV8String(isolate, "has"), |
| 51 | v8::FunctionTemplate::New(isolate, Has)); |
| 52 | |
| 53 | tmpl->Set( |
| 54 | ArgConverter::ConvertToV8String(isolate, "keys"), |
| 55 | v8::FunctionTemplate::New(isolate, Keys)); |
| 56 | |
| 57 | tmpl->Set( |
| 58 | ArgConverter::ConvertToV8String(isolate, "set"), |
| 59 | v8::FunctionTemplate::New(isolate, Set)); |
| 60 | |
| 61 | tmpl->SetAccessor( |
| 62 | ArgConverter::ConvertToV8String(isolate, "size"), |
| 63 | GetSize |
| 64 | ); |
| 65 | |
| 66 | |
| 67 | tmpl->Set( |
| 68 | ArgConverter::ConvertToV8String(isolate, "sort"), |
| 69 | v8::FunctionTemplate::New(isolate, Sort)); |
| 70 | |
| 71 | tmpl->Set(ArgConverter::ConvertToV8String(isolate, "toString"), |
| 72 | v8::FunctionTemplate::New(isolate, &ToString)); |
| 73 | |
| 74 | |
| 75 | tmpl->Set(ArgConverter::ConvertToV8String(isolate, "values"), |
| 76 | v8::FunctionTemplate::New(isolate, &Values)); |
| 77 | |