Re: Sphere SFML v0.65alpha
Reply #76 –
Problem with Jurassic:
I run this bit of code:
function game()
{
var prop = 8;
var a = {
get prop() { return prop; }
};
Abort(a.prop);
}
In Sphere 1.5/1.6 with Spidermonkey 1.5 it will print out 8.
In Sphere SFML with Jurassic it will print out "function prop() { return prop; }".
Obviously there is a scoping issue in one or the other. I'm betting that Spidermonkey is itself nowhere near the ECMA standard, but it could also be that the Jurassic parser missed a corner case. And since Jurassic uses a recursive decent parser I don't know where the grammar is to change besides to hand-roll the correct procedure for resolving the right scope. It could be a complex issue!
But I'm not certain it being a scoping issue. Because this works in both:
function game()
{
var other = 8;
var a = {
get prop() { return other; }
};
Abort(a.prop);
}
So long as it doesn't used a variable named after the getter/setter call it will work just fine.