JS inheritance, is this right?