Describe the bug
The second parameter to map:merge#2 may contain "duplicates" as a key.
The current implementation does not allow that.
map:merge((), map{}) throws an error instead
<error type="err:FOJS0005" message="Invalid options. value for duplicates key was not recognised: "/>
Expected behavior
To behave as defined in the spec https://www.w3.org/TR/xpath-functions-31/#func-map-merge
- The effect of calling the single-argument function is the same as the effect of calling the two-argument function with an empty map as the value of $options.
To Reproduce
xquery version "3.1";
module namespace t="http://exist-db.org/xquery/test";
declare namespace test="http://exist-db.org/xquery/xqsuite";
declare variable $t:maps := (
map {"a": 1},
map {"a": 2},
map {"a": 3}
);
declare
%test:assertTrue
function t:map-merge-empty-options() {
let $expected := map:merge($t:maps)
let $actual := map:merge($t:maps, map {})
return $expected?a eq $actual?a
};
Context (please always complete the following information):
- OS: macOS 12.6
- eXist-db version: 6.1.0-SNAPSHOT
- Java Version Java8u352
Additional context
- How is eXist-db installed? built from source
- Any custom changes in e.g.
conf.xml? none
Describe the bug
The second parameter to map:merge#2 may contain "duplicates" as a key.
The current implementation does not allow that.
map:merge((), map{})throws an error insteadExpected behavior
To behave as defined in the spec https://www.w3.org/TR/xpath-functions-31/#func-map-merge
To Reproduce
Context (please always complete the following information):
Additional context
conf.xml? none