From 256503fadf5a925933fc03980d7c878643b1fdca Mon Sep 17 00:00:00 2001 From: Maximilian Goldstein Date: Fri, 3 Jul 2020 11:50:06 +0200 Subject: URL: Allow non-string parameters Previously we only allowed string parameters as the first parameter of the URL constructor. This excluded types like url. The behavior of instead trying to convert the parameter to a string and then interpreting this as an url matches the specification more closely. Change-Id: I6ef8db9d8c0f238ba8c51b1023decdfcc1caad87 Reviewed-by: Ulf Hermann --- src/qml/jsruntime/qv4urlobject.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src/qml/jsruntime') diff --git a/src/qml/jsruntime/qv4urlobject.cpp b/src/qml/jsruntime/qv4urlobject.cpp index 7e52c63248..6f9a9ecb69 100644 --- a/src/qml/jsruntime/qv4urlobject.cpp +++ b/src/qml/jsruntime/qv4urlobject.cpp @@ -659,12 +659,8 @@ ReturnedValue UrlCtor::virtualCallAsConstructor(const FunctionObject *that, cons Scope scope(v4); ScopedValue arg1(scope, argv[0]); - String *arg1StringValue = arg1->stringValue(); - if (arg1StringValue == nullptr) - return v4->throwTypeError(QLatin1String("Invalid parameter provided")); - - QString arg1String = arg1StringValue->toQString(); + QString arg1String = arg1->toQString(); QString urlString; if (argc == 2) { -- cgit v1.2.3