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

fix: reuse the 'bumpObjects' module in inject.js #6121

Merged
merged 1 commit into from
May 6, 2022

Conversation

RomarQ
Copy link
Contributor

@RomarQ RomarQ commented Apr 27, 2022

The basics

  • I branched from develop
  • My pull request is against develop
  • My code follows the style guide
  • I ran npm run format and npm run lint

The details

Proposed Changes

The changes include a small improvement that reuses the imported module bumpObjects instead of loading it again with goog.module.get.

Reason for Changes

bumpObjects is imported here:

const bumpObjects = goog.require('Blockly.bumpObjects');

then used here:

blockly/core/inject.js

Lines 190 to 191 in 63ca83b

mainWorkspace.addChangeListener(
bumpObjects.bumpIntoBoundsHandler(mainWorkspace));

and loaded again here:

blockly/core/inject.js

Lines 222 to 223 in 63ca83b

goog.module.get('Blockly.bumpObjects')
.bumpTopObjectsIntoBounds(mainWorkspace);

goog.module.get is unnecessary.

Test Coverage

No tests have been modified.

Documentation

The API has not changed.

@RomarQ RomarQ requested a review from a team as a code owner April 27, 2022 23:34
@google-cla
Copy link

google-cla bot commented Apr 27, 2022

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

For more information, open the CLA check for this pull request.

@BeksOmega BeksOmega requested review from BeksOmega and removed request for rachel-fenichel May 5, 2022 17:20
Copy link
Collaborator

@BeksOmega BeksOmega left a comment

Choose a reason for hiding this comment

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

Thanks for the fix! LGTM =)

@BeksOmega BeksOmega merged commit df8349c into google:develop May 6, 2022
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.

None yet

3 participants