JavaScritp implementation of ObjectPath