Skip to content

Change from == to === in code generators #5678

@jschanker

Description

@jschanker

Describe the bug

In the conversion from == to === in PR #5599, some strings of generated code were changed as well:
E.g., for checking if a number is prime:
https://github.com/google/blockly/blob/49c99377540a7bfd5ef612cb38663d754dedb195/generators/javascript/math.js#L161

Or for checking if a number is even: https://github.com/google/blockly/blob/49c99377540a7bfd5ef612cb38663d754dedb195/generators/javascript/math.js#L183

Expected behavior

I'm not sure if this change is intended or not because while using === is the new preferred style, it breaks backward compatibility.

Additional context

My students were in the process of correcting a bug in operator precedence and had based their changes on the original repository with ==. Once it changed to === some generator tests failed (https://github.com/RichDoherty/blockly/pull/10/checks#step:8:97).

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions