Support backward compatibility.

modify code by jslint.