diff options
author | Maximilian Goldstein <max.goldstein@qt.io> | 2020-07-03 11:50:06 +0200 |
---|---|---|
committer | Maximilian Goldstein <max.goldstein@qt.io> | 2020-07-03 13:47:04 +0200 |
commit | 256503fadf5a925933fc03980d7c878643b1fdca (patch) | |
tree | f6db8932c95afd0dae58120667f81d28c2012ff6 /src/qml/jsruntime | |
parent | bc314b11b08cdc6ce035bcbe85f5b1c1acddafd7 (diff) |
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 <ulf.hermann@qt.io>
Diffstat (limited to 'src/qml/jsruntime')
-rw-r--r-- | src/qml/jsruntime/qv4urlobject.cpp | 6 |
1 files changed, 1 insertions, 5 deletions
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) { |