JSCoverage changes behaviour with getter/setters
Posted: 2008-09-01 5:40 pm
Hi,
I've just started using JSCoverage and found that it changes the behaviour of getter and setter functions.
For example, the following script alerts "true" and "true", but "false" and "false" after instrumentation.
I tested this with Firefox. I believe Opera and Safari support this syntax too, but not IE.
I've just started using JSCoverage and found that it changes the behaviour of getter and setter functions.
For example, the following script alerts "true" and "true", but "false" and "false" after instrumentation.
Code: Select all
function test () {
var test = {
x: 1,
y: 2,
get a() { return this.x },
set a(value) { this.x = value; this.y = value; }
};
window.alert (typeof (test.a) == "number");
test.a = 3;
window.alert (test.y == 3);
}