File tree 2 files changed +14
-0
lines changed
2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -133,6 +133,9 @@ export function template(templateSpec, env) {
133
133
}
134
134
135
135
if ( resultIsAllowed ( result , container . protoAccessControl , propertyName ) ) {
136
+ if ( typeof result === 'function' ) {
137
+ return parent [ propertyName ] ( ) ;
138
+ }
136
139
return result ;
137
140
}
138
141
return undefined ;
Original file line number Diff line number Diff line change @@ -285,6 +285,17 @@ describe('security issues', function () {
285
285
} )
286
286
. toCompileTo ( 'abc' ) ;
287
287
} ) ;
288
+
289
+ it ( 'should use a proto method to trim a string' , function ( ) {
290
+ expectTemplate ( '{{aString.trim}}' )
291
+ . withInput ( { aString : ' abc ' } )
292
+ . withRuntimeOptions ( {
293
+ allowedProtoMethods : {
294
+ trim : true ,
295
+ } ,
296
+ } )
297
+ . toCompileTo ( 'abc' ) ;
298
+ } ) ;
288
299
} ) ;
289
300
290
301
describe ( 'control access to prototype non-methods via "allowedProtoProperties" and "allowProtoPropertiesByDefault' , function ( ) {
You can’t perform that action at this time.
0 commit comments