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

Removing namespace declarations for deprecated and unused namespaces. #1796

Merged
merged 1 commit into from
Apr 18, 2018

Conversation

AnmAtAnm
Copy link
Contributor

The basics

  • I branched from develop
  • My pull request is against develop
  • My code follows the style guide

The details

Resolves

No reported issue.

Proposed Changes

Removing the empty namespace objects that use to contain the original block colour constants.

Reason for Changes

These namespaces use to contain the original block hue constants, but were deprecated (via comment, except for procedures) over a year ago. With the removal of those constants, the declarations were creating empty, unused objects.

References to old block constants were failing silently because the empty object existed.

Test Coverage

Rebuilt compressed files and ran graph demo, which referred to the old constants (#1790).

With this change, the demo now throws:

index.html:225 Uncaught TypeError: Cannot read property 'HUE' of undefined
    at Blockly.BlockSvg.init (index.html:225)
    at Blockly.BlockSvg.Blockly.Block (blockly_compressed.js:1324)
    at new Blockly.BlockSvg (blockly_compressed.js:1377)
    at Blockly.WorkspaceSvg.newBlock (blockly_compressed.js:1231)
    at Object.Blockly.Xml.domToBlockHeadless_ (blockly_compressed.js:1202)
    at Object.Blockly.Xml.domToBlock (blockly_compressed.js:1199)
    at Object.Blockly.Xml.domToWorkspace (blockly_compressed.js:1195)
    at Graph.init (index.html:345)

Tested on:

  • Desktop Chrome

Additional Information

These namespaces use to contain the original block hue constants,
but were deprecated (via comment, except for procedures) over a year
ago. With the removal of those constants, the declarations were
creating empty, unused objects.
@AnmAtAnm AnmAtAnm merged commit 75459ab into google:develop Apr 18, 2018
@NeilFraser
Copy link
Contributor

These namespaces are depended on in Blockly Games. Happy to change them...

@AnmAtAnm AnmAtAnm deleted the rm-constants-namespaces branch April 20, 2018 14:41
AnmAtAnm added a commit to AnmAtAnm/blockly that referenced this pull request Apr 20, 2018
AnmAtAnm added a commit that referenced this pull request Apr 20, 2018
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.

3 participants