js: class inheritance