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

Add __rest helper #6

Merged
merged 3 commits into from
Nov 21, 2016
Merged

Add __rest helper #6

merged 3 commits into from
Nov 21, 2016

Conversation

sandersn
Copy link
Member

No description provided.

@sandersn
Copy link
Member Author

@mhegazy do you know who is best to look at this?

for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && !e.indexOf(p))
t[p] = s[p];
return t;
};;
Copy link

@hzoo hzoo Nov 11, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

;; double semicolon here

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You do not need the 'this' check here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && !e.indexOf(p))
t[p] = s[p];
return t;
};;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You do not need the 'this' check here.

@@ -57,6 +58,13 @@ var __generator;
return t;
};

__rest = (this && this.__rest) || function (s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && !e.indexOf(p))
Copy link

@Jessidhia Jessidhia Nov 11, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This skips over enumerable Symbol keys (but this probably should be a bug against TypeScript instead)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would the fix be getOwnPropertyDescriptors? I don't know that much about Symbol keys.

I don't think this PR is the place to fix it regardless, because __extends and __assign already use for .. in.

@Jessidhia
Copy link

Jessidhia commented Nov 11, 2016

This doesn't update the tslib.es6.js helpers?

1. Clean up __rest definition
2. Add __rest to tslib.es6.js
@alitaheri
Copy link

__rest and __assign should be updated here too. As per microsoft/TypeScript#12248

@sandersn
Copy link
Member Author

Done, @alitaheri thanks for the reminder.

@alitaheri
Copy link

Any Updates on this? Feels like everything is in order. ❤️

@sandersn sandersn merged commit 21e6933 into master Nov 21, 2016
@sandersn sandersn deleted the add-rest branch November 21, 2016 19:05
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

Successfully merging this pull request may close these issues.

None yet

5 participants