Comments on: Experiment: JS Getters/Setters in IE7, IE6, etc. http://localhost/wp/2010/02/experiment-cross-browser-javascript-getters-and-setters/ this title probably isn't very original Fri, 30 May 2014 19:32:06 +0000 hourly 1 http://wordpress.org/?v=3.9.1 By: miscace http://localhost/wp/2010/02/experiment-cross-browser-javascript-getters-and-setters/comment-page-1/#comment-62228 Tue, 16 Oct 2012 06:12:17 +0000 http://antimatter15.com/wp/?p=937#comment-62228 Thx your code.
My code is follow:
Object.defineProperty(this, “MaxOverlappingBlocksRowCount”, {
get: function () {
return _maxOverlappingBlocksRowCount;
},
set: function (newValue) {
_maxOverlappingBlocksRowCount = newValue;
this.OnPropertyChanged(“MaxOverlappingBlocksRowCount”, newValue);
},
enumerable: true,
configurable: true
});

include you getset lib in my html file:

and I change above code like this:
try{
getset(function(){
Object.defineProperty(this, “MaxOverlappingBlocksRowCount”, {
get: function () {
return _maxOverlappingBlocksRowCount;
},
set: function (newValue) {
_maxOverlappingBlocksRowCount = newValue;
this.OnPropertyChanged(“MaxOverlappingBlocksRowCount”, newValue);
},
enumerable: true,
configurable: true
});
});
}catch(e){
if (console){
console.log();
}
}

is it right?

]]>
By: anonymous http://localhost/wp/2010/02/experiment-cross-browser-javascript-getters-and-setters/comment-page-1/#comment-28132 Mon, 03 Oct 2011 22:40:42 +0000 http://antimatter15.com/wp/?p=937#comment-28132 I can’t seem to get this working properly… could you provide the source code file?

]]>
By: SWL-Projekt » Object.defineHybridProperty http://localhost/wp/2010/02/experiment-cross-browser-javascript-getters-and-setters/comment-page-1/#comment-22843 Sat, 26 Mar 2011 19:20:08 +0000 http://antimatter15.com/wp/?p=937#comment-22843 [...] friendly answer for a cross browser get/set implementation, and surely much more friendly than what antimatter15 proposed some time ago (Pssss! dude, I could not find your real name in the “About” [...]

]]>
By: alexander farkas http://localhost/wp/2010/02/experiment-cross-browser-javascript-getters-and-setters/comment-page-1/#comment-18793 Thu, 30 Dec 2010 12:33:14 +0000 http://antimatter15.com/wp/?p=937#comment-18793 I have also worked on this. My approach is using DHTML behaviors. You can find this @https://github.com/aFarkas/x-browser-accessors

]]>
By: Zoltan Hawryluk http://localhost/wp/2010/02/experiment-cross-browser-javascript-getters-and-setters/comment-page-1/#comment-15984 Thu, 04 Nov 2010 02:53:05 +0000 http://antimatter15.com/wp/?p=937#comment-15984 Thanks for posting this! Am quite interested in this work. Did you get anyone to look further into the parser code? If so, I would love to see. If not, maybe I’ll play with it a bit. Would be great if we can get getters/setters to work across all browsers seamlessly :-D

Z.

]]>
By: pBorky http://localhost/wp/2010/02/experiment-cross-browser-javascript-getters-and-setters/comment-page-1/#comment-15965 Wed, 06 Oct 2010 13:27:32 +0000 http://antimatter15.com/wp/?p=937#comment-15965 Hi!
nice suggestion. I`m working on js framework that acts like standalone application and owns the DOM elements, and I`m using java-like notation of getters/setter, and methods to lookup native property or get set method. I try your paradigm , to inject original code , and I`ll send some updates. But .. I swear it is way to hell :)
some minor tips:
following foolproof code is to get source of function (I`m using redeclaration of toString method ) :
var src = Function.prototype.toString.call(fn);
code for getting newfunction from source (hopefully it works browser-wide) :
var newfunction = eval( ‘(function() { return ‘+ modified +’ })()’);
or to just execute:
return eval( ‘(‘+ modified +’ )()’);
somehow store injected functions in Map to avoid recompile each time.

]]>