[js] compiler: prepare reference object to be used for parent assignment