From 1dfee3a722a6f542700a5d980440e6c091418bcd Mon Sep 17 00:00:00 2001 From: Rachel Fenichel Date: Fri, 23 Jul 2021 16:39:40 -0700 Subject: [PATCH] Make defs private and add nullability --- core/renderers/common/constants.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/core/renderers/common/constants.js b/core/renderers/common/constants.js index 6847aea22..5e5ecb747 100644 --- a/core/renderers/common/constants.js +++ b/core/renderers/common/constants.js @@ -403,10 +403,10 @@ const ConstantProvider = function() { /** * The defs tag that contains all filters and patterns for this Blockly * instance. - * @type {SVGElement} + * @type {?SVGElement} * @private */ - this.defs = null; + this.defs_ = null; /** * The ID of the emboss filter, or the empty string if no filter is set. @@ -985,7 +985,7 @@ ConstantProvider.prototype.createDom = function(svg, tagName, selector) { ... filters go here ... */ - this.defs = dom.createSvgElement(Svg.DEFS, {}, svg); + this.defs_ = dom.createSvgElement(Svg.DEFS, {}, svg); /* @@ -1002,7 +1002,7 @@ ConstantProvider.prototype.createDom = function(svg, tagName, selector) { */ const embossFilter = dom.createSvgElement( Svg.FILTER, {'id': 'blocklyEmbossFilter' + this.randomIdentifier}, - this.defs); + this.defs_); dom.createSvgElement( Svg.FEGAUSSIANBLUR, {'in': 'SourceAlpha', 'stdDeviation': 1, 'result': 'blur'}, embossFilter); @@ -1055,7 +1055,7 @@ ConstantProvider.prototype.createDom = function(svg, tagName, selector) { 'width': 10, 'height': 10 }, - this.defs); + this.defs_); dom.createSvgElement( Svg.RECT, {'width': 10, 'height': 10, 'fill': '#aaa'}, disabledPattern); dom.createSvgElement( @@ -1083,7 +1083,7 @@ ConstantProvider.prototype.createDebugFilter = function() { y: '-30%', x: '-40%' }, - this.defs); + this.defs_); // Set all gaussian blur pixels to 1 opacity before applying flood const debugComponentTransfer = dom.createSvgElement( Svg.FECOMPONENTTRANSFER, {'result': 'outBlur'}, debugFilter);