When it is molten the NaCl dissociates because it is an ionic compound and the only molecules present are Na+ and Cl-, so when we pass a current through the electrolysis of these ions will occur.
Note that ionise is for covalent molecules decomposing in water will dissociate is ionic compounds decomposing in water. Water ionises but NaCl dissociates