scriptsharp icon indicating copy to clipboard operation
scriptsharp copied to clipboard

$exports is not defined

Open Sam7 opened this issue 12 years ago • 0 comments

When using only a single [ScriptModule] without referencing a single class, the compiler still does a "return $exports;" without ever defining it. As a result 'Uncaught ReferenceError: $exports is not defined ' is thrown.

I understand that I can just change the ScriptTemplate in the AssemblyInfo, but I'm just thinking, that it would be nice to have a working default behavior :)

I'd suggest a change in the ScriptGenerator.cs [Line 199]:

    else
    {
        _writer.Write("var $exports = null;");
    }

Cheers!

- btw. Thanks SO much for Schript# :D -

Sam7 avatar Jul 11 '13 11:07 Sam7