Clean up get/set accessor definitions (#5488)

* Use Object.defineProperties instead of .defineProperty when
  installing get and set accessors for previously-mutable exports.

* Add entries to renamings.js where feasible (i.e., for static rather
  than instance properties).

(Don't do blockly.js yet, to avoid merge conflicts.)
This commit is contained in:
Christopher Allen
2021-09-17 19:30:21 +01:00
committed by GitHub
parent 28fadf8c15
commit dbf10cf167
5 changed files with 61 additions and 25 deletions

View File

@@ -86,6 +86,27 @@ const renamings = {
// Blockly.common.getMainWorkspace().hideChaff(). See PR #5460.
},
},
'Blockly.ContextMenu': {
exports: {
currentBlock: {get: 'getCurrentBlock', set: 'setCurrentBlock'},
},
},
'Blockly.Events': {
exports: {
recordUndo: {get: 'getRecordUndo', set: 'setRecordUndo'},
},
},
'Blockly.Tooltip': {
exports: {
DIV: {get: 'getDiv', set: 'setDiv'},
visible: {get: 'isVisible'},
},
},
'Blockly.WidgetDiv': {
exports: {
DIV: {get: 'getDiv'},
},
},
'Blockly.utils': {
exports: {
genUid: {module: 'Blockly.utils.idGenerator'},