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

Changed block.js to update to ES6 syntax #3032

Closed
wants to merge 1 commit into from

Conversation

alyssara
Copy link

I updated some for loops and function definitions to ES6+ syntax.

@alyssara
Copy link
Author

Related to issue #2629

offScreen(boundary) {
return !this.trash && boundary.offScreen(this.container.x, this.container.y);
}
//changed to arrow
Copy link
Member

Choose a reason for hiding this comment

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

No need to insert these comments.. they are implicit in the PR and not useful to someone reading the code later.

this.docks.push([obj[1][i][0], obj[1][i][1], "anyin"]);
}
} this.docks.push([obj[1][i][0], obj[1][i][1], "anyin"]);
Copy link
Member

Choose a reason for hiding this comment

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

what is this about?

@@ -758,18 +760,21 @@ class Block {

switch (this.name) {
case "nameddoArg":
for (let i = 1; i < obj[1].length - 1; i++) {
//CHANGED
for (let i of obj[1].length - 1) {
Copy link
Member

Choose a reason for hiding this comment

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

does this work? i starts at 1, not 0.

for (let i = 1; i < obj[1].length; i++) {
this.docks.push([obj[1][i][0], obj[1][i][1], "anyin"]);
//CHANGEd
for (let i of obj[1].length) {
Copy link
Member

Choose a reason for hiding this comment

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

i starts at 1


for (let i = 1; i < that.protoblock.staticLabels.length; i++) {
//CHANGED
for (let i = 1 of that.protoblock.staticLabels.length) {
Copy link
Member

Choose a reason for hiding this comment

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

is this correct?


for (let i = 1; i < that.protoblock.staticLabels.length; i++) {
//CHANGED
for (let i of that.protoblock.staticLabels.length) {
Copy link
Member

Choose a reason for hiding this comment

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

i starts at 1


for (let i = 1; i < this.protoblock.staticLabels.length; i++) {
//CHANGED
for (let i of this.protoblock.staticLabels.length) {
Copy link
Member

Choose a reason for hiding this comment

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

i starts at 1

isNoHitBlock() {
return NOHIT.indexOf(this.name) !== -1;
}
//Changed to arrow
Copy link
Member

Choose a reason for hiding this comment

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

Not that it impacts the code, but changing the order of these functions makes it harder to review.

@walterbender
Copy link
Member

Sorry to take so long reviewing this... I somehow overlooked it.

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.

2 participants