Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bad output #111

Open
altano opened this issue Mar 19, 2016 · 0 comments
Open

Bad output #111

altano opened this issue Mar 19, 2016 · 0 comments

Comments

@altano
Copy link

altano commented Mar 19, 2016

TypeScript outputs AMD that looks like this:

define("SomeModule", ["require", "exports"], function(n, t) {
    var i, r, u;
    (function(n) {
        n[n.Unknown = 0] = "Unknown";
    })(t.ContextHostType || (t.ContextHostType = {}));
});

I don't know why it takes require itself as a dependency, but it should work.

AMDClean is pretending that dependency doesn't exist though and providing bad output:

;(function() {
var SomeModule = {};
SomeModule = function (n, t) {
  var i, r, u;
  (function (n) {
    n[n.Unknown = 0] = 'Unknown';
  }(t.ContextHostType || (t.ContextHostType = {})));
}(SomeModule);
}());

This blows up on t.ContextHostType, because n is the empty object that represents the exports, not t. I guess the right output would be to have the function take only one parameter?

You can see it here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant