Skip to content

Commit

Permalink
Unit tests and adjustments.
Browse files Browse the repository at this point in the history
  • Loading branch information
leonelsanchesdasilva committed Nov 4, 2023
1 parent 25740cc commit 634f295
Show file tree
Hide file tree
Showing 2 changed files with 213 additions and 185 deletions.
5 changes: 5 additions & 0 deletions src/xpath/expr-context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ export class ExprContext {
constructor(
nodeList: XNode[],
outputNodeList: XNode[],
xsltVersion: '1.0' | '2.0' | '3.0' = '1.0',
opt_position?: number,
opt_outputPosition?: number,
opt_outputDepth?: number,
Expand All @@ -102,6 +103,8 @@ export class ExprContext {
) {
this.nodeList = nodeList;
this.outputNodeList = outputNodeList;
this.xsltVersion = xsltVersion;

this.position = opt_position || 0;
this.outputPosition = opt_outputPosition || 0;

Expand Down Expand Up @@ -158,6 +161,7 @@ export class ExprContext {
return new ExprContext(
opt_nodeList || this.nodeList,
opt_outputNodeList || this.outputNodeList,
this.xsltVersion,
typeof opt_position !== 'undefined' ? opt_position : this.position,
typeof opt_outputPosition !== 'undefined' ? opt_outputPosition : this.outputPosition,
this.outputDepth,
Expand All @@ -176,6 +180,7 @@ export class ExprContext {
return new ExprContext(
this.nodeList,
opt_outputNodeList || this.outputNodeList,
this.xsltVersion,
this.position,
typeof opt_outputPosition !== 'undefined' ? opt_outputPosition : this.outputPosition,
typeof opt_outputDepth !== 'undefined' ? opt_outputDepth : this.outputDepth,
Expand Down
Loading

0 comments on commit 634f295

Please sign in to comment.