Blind stab at updating ternjs to mainline commit 6e77911446