Fixed a bug where a function statement error when auto-executed

If no exports variable is defined, the wrapping function became
a function statement, which blew up when it was auto-executed.

Signed-off-by: Ozan Turgut <ozanturgut@gmail.com>