@@ -172,6 +172,16 @@ bool BindingData::FastCanParse(Local<Value> receiver,
172172
173173CFunction BindingData::fast_can_parse_ (CFunction::Make(FastCanParse));
174174
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+
175185void BindingData::Format (const FunctionCallbackInfo<Value>& args) {
176186 CHECK_GT (args.Length (), 4 );
177187 CHECK (args[0 ]->IsString ()); // url href
@@ -352,6 +362,11 @@ void BindingData::CreatePerIsolateProperties(IsolateData* isolate_data,
352362 SetMethod (isolate, target, " update" , Update);
353363 SetFastMethodNoSideEffect (
354364 isolate, target, " canParse" , CanParse, &fast_can_parse_);
365+ SetFastMethodNoSideEffect (isolate,
366+ target,
367+ " canParseWithBase" ,
368+ CanParse,
369+ &fast_can_parse_with_base_);
355370}
356371
357372void BindingData::CreatePerContextProperties (Local<Object> target,
@@ -373,6 +388,8 @@ void BindingData::RegisterExternalReferences(
373388 registry->Register (CanParse);
374389 registry->Register (FastCanParse);
375390 registry->Register (fast_can_parse_.GetTypeInfo ());
391+ registry->Register (FastCanParseWithBase);
392+ registry->Register (fast_can_parse_with_base_.GetTypeInfo ());
376393}
377394
378395std::string FromFilePath (const std::string_view file_path) {
0 commit comments