Project

Profile

Help

Bug #3363

closed

Lazy evaluation of variables is not respected

Added by Michael Kay almost 7 years ago. Updated almost 4 years ago.

Status:
Closed
Priority:
Low
Assignee:
Category:
-
Sprint/Milestone:
-
Start date:
2017-07-22
Due date:
% Done:

0%

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

Description

When an expression is loop-lifted out of a loop, or out of an xsl:choose, it must be evaluated lazily to ensure that evaluation does not occur if the loop is executed zero times (or if the relevant branch of a conditional is not chosen). The SEF export file reflects this requirement with the value of let/@eval. But Saxon-JS ignores this attribute, meaning that the expression may be evaluated eagerly, leading to unwanted costs, unwanted failures, or premature side-effects.

(It might be that the appropriate solution is to avoid such aggressive optimization when -target:js is set).

Reported informally by John Lumley.

Please register to edit this issue

Also available in: Atom PDF Tracking page