Project

Profile

Help

Bug #4653

closed

fn:fold-left with inline function in SaxonJS.XPath.evaluate

Added by Debbie Lockett almost 4 years ago. Updated about 3 years ago.

Status:
Duplicate
Priority:
Normal
Category:
-
Sprint/Milestone:
-
Start date:
2020-07-24
Due date:
% Done:

0%

Estimated time:
Applies to JS Branch:
2
Fix Committed on JS Branch:
2
Fixed in JS Release:
SEF Generated with:
Platforms:
Company:
-
Contact person:
-
Additional contact persons:
-

Description

As raised by Martin Honnen on the forum (https://saxonica.plan.io/boards/5/topics/7958), there is an issue running SaxonJS.XPath.evaluate on an expression which calls fold-left. For example:

SaxonJS.XPath.evaluate(`  fold-left(
    1 to 10,
    0,
    function($sum, $number) {
      $sum + $number
    }
  )`)

Results in "TypeError: this.closureContext.localVars.slice is not a function" on Node.js, and "Uncaught TypeError: this.fl.Ha.slice is not a function" in the browser.

The bug has been reproduced running Saxon-JS 2.0. Actually the problem does not arise when running against the current development builds, so it looks like other development work has already fixed the issue, but opening this bug to log properly.


Related issues

Is duplicate of SaxonJS - Bug #4611: XPath expression "function(){'x'}()" crashes with TypeError: this.closureContext.localVars.slice is not a functionClosedMichael Kay2020-06-25

Actions

Please register to edit this issue

Also available in: Atom PDF Tracking page