Skip to content
Snippets Groups Projects
Commit 0bc5a337 authored by deuce's avatar deuce
Browse files

Copy getters by reference as well.

parent 459474c4
No related branches found
No related tags found
No related merge requests found
......@@ -16,6 +16,17 @@ function parsePos(pos)
return ret;
}
function makePos(pos)
{
if(pos.x == null || pos.x < 1 || pos.x > 8)
throw("Illegal location '"+pos.toSource()+"'");
if(pos.y == null || pos.y < 1 || pos.y > 8)
throw("Illegal location '"+pos.toSource()+"'");
var ret=ascii(96+pos.x);
ret += ascii(48+pos.y);
return ret;
}
function parseColour(colour)
{
if(colour=='w')
......@@ -37,6 +48,9 @@ function toward(from, to)
function copyProps(from, to)
{
for(prop in from) {
to[prop]=from[prop];
if(from.__lookupGetter__(prop))
to.__defineGetter__(prop, from.__lookupGetter__(prop));
else
to[prop]=from[prop];
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment