Only generate Math.__name__ for js if necessary.
Merge pull request #2246 from deltaluca/dev_js_Math__name__

Only generate Math.__name__ for js if necessary.