I created some code that tried to use JSEvaluateScript to pass a script to an object. My expectation was that the script would be evaluated in the context of the object passed into the "thisObject" parameter, but I found that the script is always evaluated in the global context.
For example, I tried to do something like
JSObjectRef myDocumentObject = GetObjectRefForDocument(<some document here>);
JSEvaluateScript(jsContext, myScript, myDocumentObject, ... other args ...);
I wanted to pass the script:
but that came up with a type error. I had to use:
Which says to me that the script was evaluated in my global context, and not the context of my document object.
Fix landed in r31267.