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