diff --git a/core/blocks.ts b/core/blocks.ts index aecf6eb69..cb3348c74 100644 --- a/core/blocks.ts +++ b/core/blocks.ts @@ -14,7 +14,7 @@ goog.declareModuleId('Blockly.blocks'); /** - * A block definition. For now this very lose, but it can potentially + * A block definition. For now this very loose, but it can potentially * be refined e.g. by replacing this typedef with a class definition. */ export type BlockDefinition = AnyDuringMigration; diff --git a/core/icon.ts b/core/icon.ts index 8cf0d6872..83051610a 100644 --- a/core/icon.ts +++ b/core/icon.ts @@ -179,14 +179,14 @@ export abstract class Icon { // No-op on base class. /** - * Show or hide the icon. + * Show or hide the bubble. * - * @param _visible True if the icon should be visible. + * @param _visible True if the bubble should be visible. */ setVisible(_visible: boolean) {} /** - * Returns the block this icon is attached to. + * @returns The block this icon is attached to. */ protected getBlock(): BlockSvg { if (!this.block_) { diff --git a/scripts/gulpfiles/build_tasks.js b/scripts/gulpfiles/build_tasks.js index 9e8ab31ae..5538abc92 100644 --- a/scripts/gulpfiles/build_tasks.js +++ b/scripts/gulpfiles/build_tasks.js @@ -168,7 +168,7 @@ function stripApacheLicense() { // Closure Compiler preserves dozens of Apache licences in the Blockly code. // Remove these if they belong to Google or MIT. // MIT's permission to do this is logged in Blockly issue #2412. - return gulp.replace(new RegExp(licenseRegex, "g"), '\n\n\n\n'); + return gulp.replace(new RegExp(licenseRegex, 'g'), '\n\n\n\n'); // Replace with the same number of lines so that source-maps are not affected. } @@ -387,7 +387,7 @@ function generateMessages(done) { --input_file ${path.join('msg', 'messages.js')} \ --output_dir ${path.join('msg', 'json')} \ --quiet`; - execSync(jsToJsonCmd, { stdio: 'inherit' }); + execSync(jsToJsonCmd, {stdio: 'inherit'}); console.log(` Regenerated several flies in msg/json/. Now run @@ -591,7 +591,7 @@ function getChunkOptions() { /** * RegExp that globally matches path.sep (i.e., "/" or "\"). */ -const pathSepRegExp = new RegExp(path.sep.replace(/\\/, '\\\\'), "g"); +const pathSepRegExp = new RegExp(path.sep.replace(/\\/, '\\\\'), 'g'); /** * Helper method for calling the Closure Compiler, establishing diff --git a/tests/generators/webdriver.js b/tests/generators/webdriver.js index 71cb75991..202850746 100644 --- a/tests/generators/webdriver.js +++ b/tests/generators/webdriver.js @@ -42,22 +42,23 @@ async function runGeneratorsInBrowser(outputDir) { var options = { capabilities: { browserName: 'chrome', + 'goog:chromeOptions': { + args: ['--allow-file-access-from-files'], + }, }, logLevel: 'warn', services: ['selenium-standalone'] }; + // Run in headless mode on Github Actions. if (process.env.CI) { - options.capabilities['goog:chromeOptions'] = { - args: ['--headless', '--no-sandbox', '--disable-dev-shm-usage', '--allow-file-access-from-files'] - }; + options.capabilities['goog:chromeOptions'].args.push( + '--headless', '--no-sandbox', '--disable-dev-shm-usage',); } else { // --disable-gpu is needed to prevent Chrome from hanging on Linux with // NVIDIA drivers older than v295.20. See // https://github.com/google/blockly/issues/5345 for details. - options.capabilities['goog:chromeOptions'] = { - args: ['--allow-file-access-from-files', '--disable-gpu'] - }; + options.capabilities['goog:chromeOptions'].args.push('--disable-gpu'); } var url = 'file://' + __dirname + '/index.html'; diff --git a/tests/mocha/webdriver.js b/tests/mocha/webdriver.js index 0fba49f87..e7eb99bc7 100644 --- a/tests/mocha/webdriver.js +++ b/tests/mocha/webdriver.js @@ -21,27 +21,25 @@ async function runMochaTestsInBrowser() { const options = { capabilities: { browserName: 'chrome', + 'goog:chromeOptions': { + args: ['--allow-file-access-from-files'], + }, }, services: [ ['selenium-standalone'], ], logLevel: 'warn', }; + // Run in headless mode on Github Actions. if (process.env.CI) { - options.capabilities['goog:chromeOptions'] = { - args: [ - '--headless', '--no-sandbox', '--disable-dev-shm-usage', - '--allow-file-access-from-files', - ], - }; + options.capabilities['goog:chromeOptions'].args.push( + '--headless', '--no-sandbox', '--disable-dev-shm-usage',); } else { // --disable-gpu is needed to prevent Chrome from hanging on Linux with // NVIDIA drivers older than v295.20. See // https://github.com/google/blockly/issues/5345 for details. - options.capabilities['goog:chromeOptions'] = { - args: ['--allow-file-access-from-files', '--disable-gpu'], - }; + options.capabilities['goog:chromeOptions'].args.push('--disable-gpu'); } const url = 'file://' + posixPath(__dirname) + '/index.html';