var x = 1;
var m = new Module({
get x() {
return x;
}
});
print(m.x);
x++;
print(m.x); // ???
Does ToModule do a [[Get]] or does it keep the accessor?
What about setters? Does it keep identity of the getter function?
What does the following do?
var x = 1;
var m = new Module({
get x() {
return x;
}
});
print(m.x);
x++;
print(m.x); // ???
Does ToModule do a [[Get]] or does it keep the accessor?
What about setters? Does it keep identity of the getter function?
--
erik
[[ToModule]] does a [[Get]], so both of those lines print 1.
On Wed, Sep 11, 2013 at 10:28 AM, Erik Arvidsson
<erik.arvidsson at gmail.com> wrote:
> What does the following do?
>
> var x = 1;
> var m = new Module({
> get x() {
> return x;
> }
> });
> print(m.x);
> x++;
> print(m.x); // ???
>
> Does ToModule do a [[Get]] or does it keep the accessor?
[[ToModule]] does a [[Get], so both of those lines print 1.
> What about setters? Does it keep identity of the getter function?
Sam
What does the following do?
var x = 1; var m = new Module({ get x() { return x; } }); print(m.x); x++; print(m.x); // ???
Does ToModule do a [[Get]] or does it keep the accessor?
What about setters? Does it keep identity of the getter function?