a few years later but in case of something needs this tip. In your code before return in var rectShape you need the code line
rectShape.r = 10; //for example.