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

Migrate CoffeeScript to JavaScript #1441

Merged
merged 92 commits into from
Jan 6, 2024
Merged

Migrate CoffeeScript to JavaScript #1441

merged 92 commits into from
Jan 6, 2024

Conversation

simon04
Copy link
Contributor

@simon04 simon04 commented Dec 23, 2020

I'm migrating one after another CoffeeScript file to JavaScript using https://decaffeinate-project.org/repl/.

Fixes #1197.

@JuanVqz
Copy link
Contributor

JuanVqz commented Oct 21, 2022

do you want help with this? how are you converting coffee files to javascript?

@simon04
Copy link
Contributor Author

simon04 commented Oct 22, 2022

do you want help with this?

Help is welcome, I'm not actively working on this at the moment.

how are you converting coffee files to javascript?

See #1441 (comment)

return (
file &&
file.indexOf("devdocs") !== -1 &&
file.indexOf(".js") === file.length - 3

Check failure

Code scanning / CodeQL

Incorrect suffix check

This suffix check is missing a length comparison to correctly handle indexOf returning -1.
Comment on lines 207 to 240
path = path
.replace(/\/\(/g, "(?:/")
.replace(
/(\/)?(\.)?:(\w+)(?:(\(.*?\)))?(\?)?/g,
function (_, slash = "", format = "", key, capture, optional) {
var str;
keys.push({
name: key,
optional: !!optional,
});
str = optional ? "" : slash;
str += "(?:";
if (optional) {
str += slash;
}
str += format;
str += capture || (format ? "([^/.]+?)" : "([^/]+?)");
str += ")";
if (optional) {
str += optional;
}
return str;
}
)
.replace(/([\/.])/g, "\\$1")

Check failure

Code scanning / CodeQL

Incomplete string escaping or encoding

This does not escape backslash characters in the input.
@simon04 simon04 marked this pull request as ready for review January 6, 2024 16:54
@simon04 simon04 requested a review from a team as a code owner January 6, 2024 16:54
@simon04
Copy link
Contributor Author

simon04 commented Jan 6, 2024

Migration seems to be successful. Let's give it a try. I'll keep an eye on https://devdocs.sentry.io/issues/ to spot and fix potential bugs...

@simon04 simon04 merged commit 92b0098 into main Jan 6, 2024
1 check passed
@simon04 simon04 deleted the decaffeinate branch January 6, 2024 16:57
@ojeytonwilliams
Copy link
Contributor

Sentry seems pretty calm. Nice work, @simon04!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Migration from CoffeeScript
3 participants