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) => {
826826 ) . toBe ( null )
827827 } )
828828
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+
829840 test ( 'allow access to functions on objects when enabled' , async ( ) => {
830841 logic . allowFunctions = true
831842 expect (
Original file line number Diff line number Diff line change @@ -217,7 +217,7 @@ const defaultMethods = {
217217 return notFound
218218 }
219219 }
220- if ( engine . allowFunctions || typeof ( context && context [ key ] ) !== 'function' ) {
220+ if ( engine . allowFunctions || typeof context !== 'function' ) {
221221 return context
222222 }
223223 return null
You can’t perform that action at this time.
0 commit comments