@@ -172,6 +172,16 @@ bool BindingData::FastCanParse(Local<Value> receiver,
172
172
173
173
CFunction BindingData::fast_can_parse_ (CFunction::Make(FastCanParse));
174
174
175
+ bool BindingData::FastCanParseWithBase (Local<Value> receiver,
176
+ const FastOneByteString& input,
177
+ const FastOneByteString& base) {
178
+ auto base_view = std::string_view (base.data , base.length );
179
+ return ada::can_parse (std::string_view (input.data , input.length ), &base_view);
180
+ }
181
+
182
+ CFunction BindingData::fast_can_parse_with_base_ (
183
+ CFunction::Make (FastCanParseWithBase));
184
+
175
185
void BindingData::Format (const FunctionCallbackInfo<Value>& args) {
176
186
CHECK_GT (args.Length (), 4 );
177
187
CHECK (args[0 ]->IsString ()); // url href
@@ -352,6 +362,11 @@ void BindingData::CreatePerIsolateProperties(IsolateData* isolate_data,
352
362
SetMethod (isolate, target, " update" , Update);
353
363
SetFastMethodNoSideEffect (
354
364
isolate, target, " canParse" , CanParse, &fast_can_parse_);
365
+ SetFastMethodNoSideEffect (isolate,
366
+ target,
367
+ " canParseWithBase" ,
368
+ CanParse,
369
+ &fast_can_parse_with_base_);
355
370
}
356
371
357
372
void BindingData::CreatePerContextProperties (Local<Object> target,
@@ -373,6 +388,8 @@ void BindingData::RegisterExternalReferences(
373
388
registry->Register (CanParse);
374
389
registry->Register (FastCanParse);
375
390
registry->Register (fast_can_parse_.GetTypeInfo ());
391
+ registry->Register (FastCanParseWithBase);
392
+ registry->Register (fast_can_parse_with_base_.GetTypeInfo ());
376
393
}
377
394
378
395
std::string FromFilePath (const std::string_view file_path) {
0 commit comments