Skip to content

Conversation

12wrigja
Copy link
Contributor

@12wrigja 12wrigja commented Oct 2, 2021

Fixed for PlainDate, PlainDateTime, PlainMonthDay, PlainTime, and PlainYearMonth so as not to clobber @justingrant's work on fixing up types for the other files (not sure how cleanly the PRs would merge).

Copy link
Contributor

@justingrant justingrant left a comment

Choose a reason for hiding this comment

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

This is great! Such a great idea to do this. Every file except ecmascript.ts should be fair game for this change, and I'll plan to do the same for ecmascript.ts.

Do you think we should make the same change to the proposal-temporal code to keep them in sync? Or best to make it only here? @ptomato do you have an opinion?

@ptomato
Copy link
Contributor

ptomato commented Oct 4, 2021

I think an advantage of porting this to proposal-temporal would be reduced divergence for porting future changes from proposal-temporal to here, but on the other hand it would increase the divergence between the proposal-temporal code and the specification. So I feel neutral-to-negative about that.

@12wrigja
Copy link
Contributor Author

12wrigja commented Oct 4, 2021

(Not a Temporal Champion but) I'm in agreement with Philip here - the spec isn't written this way (though, frankly that seems a bit odd to me too, though I suppose for JS itself it doesn't really care about reassignment in the way that developers do for e.g. readability of the code), but given that it is I think it makes sense to leave the proposal repo as-is.

@12wrigja 12wrigja force-pushed the fix_param_reassignments branch 3 times, most recently from 395e826 to 0ecdc3f Compare October 5, 2021 19:03
@12wrigja 12wrigja force-pushed the fix_param_reassignments branch from 0ecdc3f to e53546a Compare October 5, 2021 19:47
@12wrigja
Copy link
Contributor Author

12wrigja commented Oct 5, 2021

Ok - I've fixed up the rest of the files besides ecmascript, and adopted the pattern that Justin suggested (which lead to some much nicer diffs!). PTAL.

@12wrigja 12wrigja requested a review from justingrant October 5, 2021 20:10
Copy link
Contributor

@justingrant justingrant left a comment

Choose a reason for hiding this comment

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

Looks great. This PR will make adding types to parameters much easier. Let's go ahead and merge this ASAP when you're ready, and I'll rebase the ecmascript changes on top.

Copy link
Contributor

@ptomato ptomato left a comment

Choose a reason for hiding this comment

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

I probably won't have time to review this in detail but spot-checking looks good.

@12wrigja 12wrigja merged commit 53f32e0 into js-temporal:main Oct 7, 2021
@12wrigja
Copy link
Contributor Author

12wrigja commented Oct 7, 2021

@justingrant sounds great. I've just "finished" (tests all pass) integrating JSBI into Temporal (see #77), and I want to rebase that ontop of your ecmascript changes and have fixed the lint suppression for ecmascript.ts before I send that for review.

justingrant added a commit to justingrant/temporal-polyfill that referenced this pull request Oct 7, 2021
Finishing what js-temporal#72 started. Previous commits avoided mutation of params
only where the types changed. This commit adds eslint support for
preventing param mutation and makes changes that don't change the
underlying type. I split into a separate commit in case we want to make
this a new PR.
justingrant added a commit to justingrant/temporal-polyfill that referenced this pull request Oct 7, 2021
Finishing what js-temporal#72 started. Previous commits avoided mutation of params
only where the types changed. This commit adds eslint support for
preventing param mutation and makes changes that don't change the
underlying type. I split into a separate commit in case we want to make
this a new PR.
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.

3 participants