fix(generators): Make scrub_ public (#7940)

Fixes #2156.

In PRs #7602, #7616, #7646, #7647 and #7654 the @protected
access modifier on scrub_ on the CodeGenerator subclasses
was not transcribed to the new typescript signature.  I was
going to re-add it, but this breaks some of the procedure
block generator functions which rely on it, and then
@BeksOmega pointed out that this might be one of the
CodeGenerator API functions which we had already decided
should be public—and lo and behold I found #2156.

Per discussion amongst team, I am not renaming it to
scrub at this time.
This commit is contained in:
Christopher Allen
2024-03-15 23:01:46 +01:00
committed by GitHub
parent b6b57215a8
commit a6208d78b7
3 changed files with 1 additions and 7 deletions

View File

@@ -578,11 +578,7 @@ export class CodeGenerator {
* @param _opt_thisOnly True to generate code for only this statement.
* @returns Code with comments and subsequent blocks added.
*/
protected scrub_(
_block: Block,
code: string,
_opt_thisOnly?: boolean,
): string {
scrub_(_block: Block, code: string, _opt_thisOnly?: boolean): string {
// Optionally override
return code;
}

View File

@@ -251,7 +251,6 @@ export class JavascriptGenerator extends CodeGenerator {
* @param code The JavaScript code created for this block.
* @param thisOnly True to generate code for only this statement.
* @returns JavaScript code with comments and subsequent blocks added.
* @protected
*/
scrub_(block: Block, code: string, thisOnly = false): string {
let commentCode = '';

View File

@@ -276,7 +276,6 @@ export class PythonGenerator extends CodeGenerator {
* @param code The Python code created for this block.
* @param thisOnly True to generate code for only this statement.
* @returns Python code with comments and subsequent blocks added.
*/
scrub_(block: Block, code: string, thisOnly = false): string {
let commentCode = '';