@@ -51,6 +51,7 @@ export class ExprContext {
5151 xsltVersion : '1.0' | '2.0' | '3.0' ;
5252
5353 variables : { [ name : string ] : NodeValue } ;
54+ keys : { [ name : string ] : { [ key : string ] : NodeValue } } ;
5455 knownNamespaces : { [ alias : string ] : string } ;
5556
5657 caseInsensitive : any ;
@@ -110,6 +111,7 @@ export class ExprContext {
110111 this . outputPosition = opt_outputPosition || 0 ;
111112
112113 this . variables = opt_variables || { } ;
114+ this . keys = opt_parent ?. keys || { } ;
113115 this . knownNamespaces = opt_knownNamespaces || { } ;
114116
115117 this . parent = opt_parent || null ;
@@ -196,7 +198,7 @@ export class ExprContext {
196198 ) ;
197199 }
198200
199- setVariable ( name ?: any , value ?: any ) {
201+ setVariable ( name ?: string , value ?: NodeValue | string ) {
200202 if (
201203 value instanceof StringValue ||
202204 value instanceof BooleanValue ||
@@ -206,11 +208,12 @@ export class ExprContext {
206208 this . variables [ name ] = value ;
207209 return ;
208210 }
211+
209212 if ( 'true' === value ) {
210213 this . variables [ name ] = new BooleanValue ( true ) ;
211214 } else if ( 'false' === value ) {
212215 this . variables [ name ] = new BooleanValue ( false ) ;
213- } else if ( TOK_NUMBER . re . test ( value ) ) {
216+ } else if ( TOK_NUMBER . re . test ( String ( value ) ) ) {
214217 this . variables [ name ] = new NumberValue ( value ) ;
215218 } else {
216219 // DGF What if it's null?
0 commit comments