File tree 2 files changed +3
-1
lines changed
2 files changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -32,12 +32,14 @@ export class Context {
32
32
* Throw when accessing undefined variable?
33
33
*/
34
34
public strictVariables : boolean ;
35
+ public ownPropertyOnly : boolean ;
35
36
public constructor ( env : object = { } , opts : NormalizedFullOptions = defaultOptions , renderOptions : RenderOptions = { } ) {
36
37
this . sync = ! ! renderOptions . sync
37
38
this . opts = opts
38
39
this . globals = renderOptions . globals ?? opts . globals
39
40
this . environments = env
40
41
this . strictVariables = renderOptions . strictVariables ?? this . opts . strictVariables
42
+ this . ownPropertyOnly = renderOptions . ownPropertyOnly ?? opts . ownPropertyOnly
41
43
}
42
44
public getRegister ( key : string ) {
43
45
return ( this . registers [ key ] = this . registers [ key ] || { } )
@@ -74,7 +76,7 @@ export class Context {
74
76
public * _getFromScope ( scope : unknown , paths : PropertyKey [ ] | string ) : IterableIterator < unknown > {
75
77
if ( isString ( paths ) ) paths = paths . split ( '.' )
76
78
for ( let i = 0 ; i < paths . length ; i ++ ) {
77
- scope = yield readProperty ( scope as object , paths [ i ] , this . opts . ownPropertyOnly )
79
+ scope = yield readProperty ( scope as object , paths [ i ] , this . ownPropertyOnly )
78
80
if ( isNil ( scope ) && this . strictVariables ) {
79
81
throw new InternalUndefinedVariableError ( ( paths as string [ ] ) . slice ( 0 , i + 1 ) . join ! ( '.' ) )
80
82
}
File renamed without changes.
You can’t perform that action at this time.
0 commit comments