Actions
Bug #5667
closedixsl:eval argument starting with a newline fails to evaluate
Start date:
2022-08-30
Due date:
% Done:
100%
Estimated time:
SEF Generated with:
Platforms:
Company:
-
Contact person:
-
Additional contact persons:
-
Description
<xsl:variable name="js-statement" as="xs:string"><![CDATA[(function isString (item) { return typeof item == 'string'})]]></xsl:variable>
<xsl:variable name="js-function" select="ixsl:eval($js-statement)"/>
<xsl:value-of select="exists($js-function)"/>
returns true
<xsl:variable name="js-statement" as="xs:string"><![CDATA[
(function isString (item) { return typeof item == 'string'})]]></xsl:variable>
<xsl:variable name="js-function" select="ixsl:eval($js-statement)"/>
<xsl:value-of select="exists($js-function)"/>
returns false
<xsl:variable name="js-statement" as="xs:string"><![CDATA[
(function isString (item) { return typeof item == 'string'})]]></xsl:variable>
<xsl:variable name="js-function" select="ixsl:eval(normalize-space($js-statement))"/>
<xsl:value-of select="exists($js-function)"/>
returns true
(note normalize-space()
)
Updated by Norm Tovey-Walsh over 2 years ago
- Sprint/Milestone set to SaxonJS 2.5
Updated by Norm Tovey-Walsh over 2 years ago
Sometimes (narrator voice: often), when I learn new things about JavaScript, I just want to cry.
Consider:
function f1() {
return 3+4
}
If you call f1()
, it will return 7.
Now consider:
function f2() {
return
3+4
}
If you call f2()
, it will return [checks notes] nothing.
The expression 3+4 is unreachable code.
Luckily, this works:
function f2() {
return (
3+4)
}
Updated by Norm Tovey-Walsh over 2 years ago
- Status changed from New to Resolved
- Applies to JS Branch 2, Trunk added
- Fix Committed on JS Branch 2, Trunk added
Updated by Michael Kay over 2 years ago
I'll try to remember that, but will almost certainly fail.
Updated by Norm Tovey-Walsh about 2 years ago
- Status changed from Resolved to Closed
- % Done changed from 0 to 100
- Fixed in JS Release set to SaxonJS 2.5
Fixed in SaxonJS 2.5.
Please register to edit this issue
Actions
Also available in: Atom PDF Tracking page