[PATCH 2/9] jscript: Move filling the PROTREF into a helper.