-
-
Notifications
You must be signed in to change notification settings - Fork 222
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
Minify more type constructors #45
Conversation
(function (Boolean, String, Number) { | ||
return Boolean(a), String(b), Number(c); | ||
})(MyBoolean, MyString, MyNumber); | ||
(function (Boolean, String, Number, Object) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about Array?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see that you're testing for local binding so we should just add it here to the test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, missed that. I squashed the commits in a sensible way and added Array
there.
0172071
to
31891f6
Compare
31891f6
to
9a84e1b
Compare
3a97a11
to
e8016c3
Compare
e8016c3
to
e5a2d37
Compare
expect(transform(source)).toBe(expected); | ||
}); | ||
|
||
it("should turn Array(number) to [,] only if number is <=6", () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only issue here is oldIE: [,].length
is 2
in IE8- and 1
everywhere else.
Specifically, none of these work correctly there:
Array(1);
Array(2);
Array(3);
Array(4);
Array(5);
Array(6);
Are you going to support IE8 anywhere else?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if it's worth supporting IE8. But we need to at least mention this in the docs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd vote we document it for now, we could always have a separate transform to run through and pick out stuff like this that IE would choke on.
We need to also figure out how to denote plugins as safe (always identical functionality) or unsafe (identical functionality in most cases but not always). The |
Unsafe in IE8- only, right? |
This thing is awesome: https://astexplorer.net/