I'm doing a code audit and the toString method can be overwriten by an attacker due to an unwanted behavior. It is overwritting the toString method with a string rather than a method.
Take the following code :
let a = new Object();
a.toString = "function(){ return 'hello world' }"
a.toString is a string and not a function here. Thus, a.toString() won't work.
Is there any hack possible that would result in accidentally executing the toString string (considering the string can be anything and not considering eval) ?

aobject.