Skip to content

Commit 1597b8d

Browse files
committed
chore: add second arg to canParse polyfill
1 parent 719dda7 commit 1597b8d

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

composition-go/index.global.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

composition-go/polyfill.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ func urlParse(rawURL string, base string) (*urlShim, error) {
6363
}, nil
6464
}
6565

66-
func urlCanParse(rawURL string) bool {
67-
_, err := url.Parse(rawURL)
66+
func urlCanParse(rawURL string, base string) bool {
67+
_, err := urlParse(rawURL, base)
6868
return err == nil
6969
}

composition-go/shim/src/polyfill.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class URL {
1111
}
1212
}
1313

14-
static canParse(url) {
15-
return urlCanParse(url);
14+
static canParse(url, base = undefined) {
15+
return urlCanParse(url, base || '');
1616
}
1717
}

composition-go/vm_v8.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,9 @@ func urlCanParseV8(info *v8.FunctionCallbackInfo) *v8.Value {
243243
isolate := info.Context().Isolate()
244244
args := info.Args()
245245
url := args[0].String()
246+
base := args[1].String()
246247

247-
result := urlCanParse(url)
248+
result := urlCanParse(url, base)
248249
value, err := v8.NewValue(isolate, result)
249250
if err != nil {
250251
panic(err)

0 commit comments

Comments
 (0)