support class define in singleton class
Merge pull request #2288 from ksss/define-class

support class define in singleton class