I currently have an object labeled o
along with a reference to it.
Inside the scope of object o
, I define a member named m
.
Within object o, I execute:
o.m = "blah"
When I try to access m
outside of object o:
console.log(o.m)
The output is not "blah". To investigate, I ran:
console.log(this == this.parent.o)
This statement evaluates to true. I am puzzled by this behavior. My browser is Chrome 17.0.963.56 m
UPDATE
I also experimented within object o
:
this.m = "blah"
console.log(this.m) // prints "blah"
However, upon exiting that context and running:
console.log(o.m)
The result is different.
Below is the relevant code snippet (refer to this.addEvent("playPauseButtonClicked")):
// Controller code (singleton)
function controller() {
if (window.c) { return window.c; }
window.c = this;
...
}