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

Remove CalendarToString and TimeZoneToString #1303

Merged
merged 2 commits into from
Jan 20, 2021
Merged

Conversation

ptomato
Copy link
Collaborator

@ptomato ptomato commented Jan 18, 2021

See: #1294 (but does not close the discussion)

Also remove %Temporal.Calendar.prototype.toString% intrinsic. These are
not needed because toString() is a required method of the Calendar
protocol, so there should always be a toString() there to call.

See: #1294
Also remove %Temporal.TimeZone.prototype.toString% intrinsic. Similarly to
the previous commit, these are not needed because toString() is a required
method of the TimeZone protocol, so there should always be a toString()
there to call.

See: #1294
@codecov
Copy link

codecov bot commented Jan 18, 2021

Codecov Report

Merging #1303 (388d401) into main (1177a9a) will increase coverage by 0.00%.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1303   +/-   ##
=======================================
  Coverage   95.77%   95.77%           
=======================================
  Files          19       19           
  Lines        9419     9405   -14     
  Branches     1445     1443    -2     
=======================================
- Hits         9021     9008   -13     
+ Misses        392      391    -1     
  Partials        6        6           
Flag Coverage Δ
test262 56.05% <ø> (-0.10%) ⬇️
tests 91.83% <ø> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
lib/timezone.mjs 94.23% <0.00%> (-0.03%) ⬇️
lib/calendar.mjs 95.73% <0.00%> (-0.02%) ⬇️
lib/ecmascript.mjs 95.86% <0.00%> (+0.01%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1177a9a...e6f467a. Read the comment docs.

Copy link
Collaborator

@Ms2ger Ms2ger left a comment

Choose a reason for hiding this comment

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

Fair enough.

@@ -879,7 +867,7 @@ <h1>Temporal.Calendar.prototype.toJSON ( )</h1>
</p>
<emu-alg>
1. Let _calendar_ be the *this* value.
1. Return ? CalendarToString(_calendar_).
1. Return ? ToString(_calendar_).
Copy link
Member

Choose a reason for hiding this comment

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

a reasonable alternative would be to Call %Temporal.Calendar.toString%, but this way plays better with subclassing i suppose.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This way does an additional observable Get(calendar, @@toPrimitive) but I think that's OK?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, either a Symbol.toPrimitive or a toString lookup would be required to invoke subclass code.

@ptomato ptomato merged commit 6ac8f53 into main Jan 20, 2021
@ptomato ptomato deleted the 1294-rm-calendartostring branch January 20, 2021 17:12
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