Bug #4611
closedXPath expression "function(){'x'}()" crashes with TypeError: this.closureContext.localVars.slice is not a function
100%
Description
Executing the expression XPath expression function(){'x'}()
crashes with TypeError: this.closureContext.localVars.slice is not a function
.
It appears that context.localVars is set to {}
when it should be []
.
I can't see where this initialization is happening.
Related issues
Updated by Michael Kay over 4 years ago
- Assignee changed from Michael Kay to John Lumley
It appears to be XPathEval line 1051
evalContext.localVars = topContext.paramVars;
where paramVars
is a map of parameters rather than an array.
I'm not sure how this is supposed to work - the code needs to map parameter names to slot numbers.
Updated by Michael Kay over 4 years ago
Changing two places where paramVars
is initialized to set the initial value to []
rather than {}
seems to do the trick.
Updated by Debbie Lockett about 4 years ago
- Status changed from New to Resolved
- Assignee changed from John Lumley to Michael Kay
- Fix Committed on JS Branch 2.0 added
Marking as resolved: the code patch was committed on the saxon-js-enterprise git repo on 2020-06-25 (under 'Implement more Saxon extension functions and "dot function" syntax;' commit).
Updated by Debbie Lockett about 4 years ago
- Related to Bug #4653: fn:fold-left with inline function in SaxonJS.XPath.evaluate added
Updated by Debbie Lockett about 4 years ago
- Related to deleted (Bug #4653: fn:fold-left with inline function in SaxonJS.XPath.evaluate)
Updated by Debbie Lockett about 4 years ago
- Has duplicate Bug #4653: fn:fold-left with inline function in SaxonJS.XPath.evaluate added
Updated by Community Admin almost 4 years ago
- Applies to JS Branch 2 added
- Applies to JS Branch deleted (
2.0)
Updated by Community Admin almost 4 years ago
- Fix Committed on JS Branch 2 added
- Fix Committed on JS Branch deleted (
2.0)
Updated by Debbie Lockett over 3 years ago
- Status changed from Resolved to Closed
- % Done changed from 0 to 100
- Fixed in JS Release set to Saxon-JS 2.1
Bug fix applied in the Saxon-JS 2.1 maintenance release.
Please register to edit this issue
Also available in: Atom PDF Tracking page