Skip to content

Method Fixes #1990

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

Closed
wants to merge 1 commit into from
Closed

Method Fixes #1990

wants to merge 1 commit into from

Conversation

CubesterYT
Copy link
Member

Self explanatory.

I want a proper in depth review (Looking at you, SharkPool), so I can make sure I didn't miss anything or nothing is broken.

@github-actions github-actions bot added the pr: change existing extension Pull requests that change an existing extension label Feb 28, 2025
? Math.round(totalSeconds % 60)
.toString()
.padStart(2, "0")
? Scratch.Cast.toString(Math.round(totalSeconds % 60)).padStart(
Copy link
Member

Choose a reason for hiding this comment

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

Changing toString() to Cast.toString() here has no value and if anything harms readability. You already know Math.round() is returning a number. Hope this isn't how the rest of the pull request looks.

Copy link
Member

@GarboMuffin GarboMuffin Feb 28, 2025

Choose a reason for hiding this comment

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

Conceptually Scratch.Cast would be where any quirks in the anything-to-string conversion in Scratch-the-programming-language would live though it happens to be exactly the same as the default toString(). It doesn't need to be the same though.

Here, and many other places, you aren't dealing with a value from a Scratch project but rather some intermediate value you already know is a number. It's not benefiting at all to use Cast. Just adding noise and overhead and making the code less portable if someone wants to take it outside of an extension.

@@ -698,8 +700,8 @@
}

toCase(args, util) {
const string = args.STRING.toString();
const textCase = args.TEXTCASE.toString();
const string = Scratch.Cast.toString(args.STRING);
Copy link
Member

Choose a reason for hiding this comment

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

most of the changes in this extension do make sense though

@CubesterYT
Copy link
Member Author

Closed to be superseded by Miyo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: change existing extension Pull requests that change an existing extension
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants