Open GoogleCodeExporter opened 9 years ago
Better solution:
As I go deeper in the issue i find even using temp variable is not appreciated
solution, because when the value changed in method, the actual field is not
modified till function return,
ALL code is Pseudo-code
see:
Foo.prototype.changeVar = function(val, propName) //where var is reference
{
val.Value = "something";
this.firePropertyChanged(propName); //ERROR: function should return till the actual reference is modified.
return val.Value;
};
so I think you should do different approach something like this
JS:
var $$this = this;
var $$v = {Setter:function ($$value) {
$$this._test = $$value;
}, Value:this._test};
Foo.prototype.changeVar = function(val)
{
val.Setter(1);
};
It is just Idea and Pseudo-code, not working code.
Original comment by Madnik7@gmail.com
on 18 Sep 2012 at 2:12
Original comment by DanelK...@gmail.com
on 28 Jan 2013 at 4:56
Original issue reported on code.google.com by
Madnik7@gmail.com
on 18 Sep 2012 at 12:19