This week's book giveaway is in the General Computing forum. We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line! See this thread for details.
In your example, you are calling the function via its reference as print which is a property of the object literal that you assigned to test. Thus, that object literal, not the String instance is the function context.
By the way, please be sure to use UBB code tags when posting code to the forums. Please read this for more information. [ October 18, 2007: Message edited by: Bear Bibeault ]
No, there is no coupling. If you want the function context to be the String instance you could declare the function as a property of the String (rather than a property of a property of the String as you have) and call it via that property, or you can force it by using the Function.call() method.
To be honest, your example doesn't make a whole lot of sense to me as far as why you'd set something up in that manner, so I'm not sure what other recommendations to make. [ October 19, 2007: Message edited by: Bear Bibeault ]