File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -826,6 +826,17 @@ modes.forEach((logic) => {
826
826
) . toBe ( null )
827
827
} )
828
828
829
+ test ( 'allow access to objects named as their methods' , async ( ) => {
830
+ expect (
831
+ await logic . run (
832
+ {
833
+ var : 'toString'
834
+ } ,
835
+ { toString : 'hello' }
836
+ )
837
+ ) . toBe ( "hello" )
838
+ } )
839
+
829
840
test ( 'allow access to functions on objects when enabled' , async ( ) => {
830
841
logic . allowFunctions = true
831
842
expect (
Original file line number Diff line number Diff line change @@ -217,7 +217,7 @@ const defaultMethods = {
217
217
return notFound
218
218
}
219
219
}
220
- if ( engine . allowFunctions || typeof ( context && context [ key ] ) !== 'function' ) {
220
+ if ( engine . allowFunctions || typeof context !== 'function' ) {
221
221
return context
222
222
}
223
223
return null
You can’t perform that action at this time.
0 commit comments