We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c856ec5 commit d59277aCopy full SHA for d59277a
src/node_url.cc
@@ -115,7 +115,7 @@ void BindingData::DomainToUnicode(const FunctionCallbackInfo<Value>& args) {
115
116
// TODO(@anonrig): Add V8 Fast API for CanParse method
117
void BindingData::CanParse(const FunctionCallbackInfo<Value>& args) {
118
- CHECK_GE(args.Length(), 2);
+ CHECK_GE(args.Length(), 1);
119
CHECK(args[0]->IsString()); // input
120
// args[1] // base url
121
test/parallel/test-whatwg-url-canparse.js
@@ -0,0 +1,9 @@
1
+'use strict';
2
+
3
+require('../common');
4
5
+const { URL } = require('url');
6
+const assert = require('assert');
7
8
+// It should not throw when called without a base string
9
+assert.strictEqual(URL.canParse('https://example.org'), true);
0 commit comments