Serialize JS try statements without catch blocks
Factor out code for serialising JavaScript blocks