https://bugzilla.wikimedia.org/show_bug.cgi?id=37708
Web browser: ---
Bug #: 37708
Summary: mw.Uri.clone() doesn't make a deep copy
Product: MediaWiki
Version: unspecified
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: Unprioritized
Component: JavaScript
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected], [email protected]
Classification: Unclassified
Mobile Platform: ---
mw.Uri.clone() copies each property individually, but it doesn't make a deep
copy of the properties; almost all properties are simple types where it doesn't
matter, but query is an object.
What's funny is that this breaks the example in the class documentation:
>>> var a = new mw.Uri('http://localhost/w/index.php?foo=bar')
>>> var b = a.clone()
>>> a.extend({'baz':'quux'})
>>> a.toString()
"http://localhost/w/index.php?foo=bar&baz=quux"
>>> b.toString()
"http://localhost/w/index.php?foo=bar&baz=quux"
--
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l