chore: cleanup unusued variables + enable linting (#38898)
This commit is contained in:
parent
e900f6ecc3
commit
ef6569b7d3
36 changed files with 31 additions and 89 deletions
|
@ -28,12 +28,6 @@
|
||||||
"sourceType": "module"
|
"sourceType": "module"
|
||||||
},
|
},
|
||||||
"overrides": [
|
"overrides": [
|
||||||
{
|
|
||||||
"files": "*.js",
|
|
||||||
"rules": {
|
|
||||||
"@typescript-eslint/no-unused-vars": "off"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"files": "*.ts",
|
"files": "*.ts",
|
||||||
"rules": {
|
"rules": {
|
||||||
|
|
|
@ -50,7 +50,7 @@ async function downloadWithRetry (url, directory) {
|
||||||
return await downloadFile(downloadURL, directory);
|
return await downloadFile(downloadURL, directory);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
lastError = err;
|
lastError = err;
|
||||||
await new Promise((resolve, reject) => setTimeout(resolve, 30000));
|
await new Promise(resolve => setTimeout(resolve, 30000));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
throw lastError;
|
throw lastError;
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
const fs = require('node:fs');
|
const fs = require('node:fs');
|
||||||
const path = require('node:path');
|
|
||||||
const semver = require('semver');
|
const semver = require('semver');
|
||||||
|
|
||||||
const outputPath = process.argv[2];
|
const outputPath = process.argv[2];
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
/* eslint-disable camelcase */
|
/* eslint-disable camelcase */
|
||||||
const { BlobServiceClient } = require('@azure/storage-blob');
|
const { BlobServiceClient } = require('@azure/storage-blob');
|
||||||
const fs = require('node:fs');
|
|
||||||
const path = require('node:path');
|
const path = require('node:path');
|
||||||
|
|
||||||
const blobServiceClient = BlobServiceClient.fromConnectionString(process.env.ELECTRON_ARTIFACTS_BLOB_STORAGE);
|
const blobServiceClient = BlobServiceClient.fromConnectionString(process.env.ELECTRON_ARTIFACTS_BLOB_STORAGE);
|
||||||
|
|
|
@ -8,6 +8,7 @@ const ELECTRON_DIR = path.resolve(__dirname, '..', '..');
|
||||||
const SRC_DIR = path.resolve(ELECTRON_DIR, '..');
|
const SRC_DIR = path.resolve(ELECTRON_DIR, '..');
|
||||||
|
|
||||||
require('colors');
|
require('colors');
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||||
const pass = '✓'.green;
|
const pass = '✓'.green;
|
||||||
const fail = '✗'.red;
|
const fail = '✗'.red;
|
||||||
|
|
||||||
|
@ -129,7 +130,7 @@ function chunkFilenames (filenames, offset = 0) {
|
||||||
* @returns {Promise<string[]>}
|
* @returns {Promise<string[]>}
|
||||||
*/
|
*/
|
||||||
async function findMatchingFiles (top, test) {
|
async function findMatchingFiles (top, test) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise(resolve => {
|
||||||
const matches = [];
|
const matches = [];
|
||||||
klaw(top, {
|
klaw(top, {
|
||||||
filter: f => path.basename(f) !== '.bin'
|
filter: f => path.basename(f) !== '.bin'
|
||||||
|
|
|
@ -272,7 +272,7 @@ function parseCommandLine () {
|
||||||
const opts = minimist(process.argv.slice(2), {
|
const opts = minimist(process.argv.slice(2), {
|
||||||
boolean: ['c++', 'objc', 'javascript', 'python', 'gn', 'patches', 'help', 'changed', 'fix', 'verbose', 'only'],
|
boolean: ['c++', 'objc', 'javascript', 'python', 'gn', 'patches', 'help', 'changed', 'fix', 'verbose', 'only'],
|
||||||
alias: { 'c++': ['cc', 'cpp', 'cxx'], javascript: ['js', 'es'], python: 'py', changed: 'c', help: 'h', verbose: 'v' },
|
alias: { 'c++': ['cc', 'cpp', 'cxx'], javascript: ['js', 'es'], python: 'py', changed: 'c', help: 'h', verbose: 'v' },
|
||||||
unknown: arg => { help = true; }
|
unknown: () => { help = true; }
|
||||||
});
|
});
|
||||||
if (help || opts.help) {
|
if (help || opts.help) {
|
||||||
console.log('Usage: script/lint.js [--cc] [--js] [--py] [-c|--changed] [-h|--help] [-v|--verbose] [--fix] [--only -- file1 file2]');
|
console.log('Usage: script/lint.js [--cc] [--js] [--py] [-c|--changed] [-h|--help] [-v|--verbose] [--fix] [--only -- file1 file2]');
|
||||||
|
|
|
@ -2,7 +2,6 @@ if (!process.env.CI) require('dotenv-safe').load();
|
||||||
|
|
||||||
const assert = require('node:assert');
|
const assert = require('node:assert');
|
||||||
const got = require('got');
|
const got = require('got');
|
||||||
const { Octokit } = require('@octokit/rest');
|
|
||||||
|
|
||||||
const BUILD_APPVEYOR_URL = 'https://ci.appveyor.com/api/builds';
|
const BUILD_APPVEYOR_URL = 'https://ci.appveyor.com/api/builds';
|
||||||
const CIRCLECI_PIPELINE_URL = 'https://circleci.com/api/v2/project/gh/electron/electron/pipeline';
|
const CIRCLECI_PIPELINE_URL = 'https://circleci.com/api/v2/project/gh/electron/electron/pipeline';
|
||||||
|
|
|
@ -256,7 +256,7 @@ async function runRetryable (fn, maxRetries) {
|
||||||
try {
|
try {
|
||||||
return await fn();
|
return await fn();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
await new Promise((resolve, reject) => setTimeout(resolve, CHECK_INTERVAL));
|
await new Promise(resolve => setTimeout(resolve, CHECK_INTERVAL));
|
||||||
lastError = error;
|
lastError = error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -173,7 +173,7 @@ async function verifyNewVersion () {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function promptForVersion (version) {
|
async function promptForVersion (version) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise(resolve => {
|
||||||
const rl = readline.createInterface({
|
const rl = readline.createInterface({
|
||||||
input: process.stdin,
|
input: process.stdin,
|
||||||
output: process.stdout
|
output: process.stdout
|
||||||
|
|
|
@ -2,7 +2,6 @@ const temp = require('temp');
|
||||||
const fs = require('node:fs');
|
const fs = require('node:fs');
|
||||||
const path = require('node:path');
|
const path = require('node:path');
|
||||||
const childProcess = require('node:child_process');
|
const childProcess = require('node:child_process');
|
||||||
const got = require('got');
|
|
||||||
const semver = require('semver');
|
const semver = require('semver');
|
||||||
|
|
||||||
const { getCurrentBranch, ELECTRON_DIR } = require('../lib/utils');
|
const { getCurrentBranch, ELECTRON_DIR } = require('../lib/utils');
|
||||||
|
|
|
@ -5,9 +5,6 @@ const args = require('minimist')(process.argv.slice(2), {
|
||||||
string: ['tag', 'releaseID'],
|
string: ['tag', 'releaseID'],
|
||||||
default: { releaseID: '' }
|
default: { releaseID: '' }
|
||||||
});
|
});
|
||||||
const { execSync } = require('node:child_process');
|
|
||||||
const { GitProcess } = require('dugite');
|
|
||||||
const { getCurrentBranch, ELECTRON_DIR } = require('../lib/utils.js');
|
|
||||||
const { Octokit } = require('@octokit/rest');
|
const { Octokit } = require('@octokit/rest');
|
||||||
|
|
||||||
const octokit = new Octokit({
|
const octokit = new Octokit({
|
||||||
|
|
|
@ -15,7 +15,6 @@ const got = require('got');
|
||||||
const path = require('node:path');
|
const path = require('node:path');
|
||||||
const semver = require('semver');
|
const semver = require('semver');
|
||||||
const temp = require('temp').track();
|
const temp = require('temp').track();
|
||||||
const { URL } = require('node:url');
|
|
||||||
const { BlobServiceClient } = require('@azure/storage-blob');
|
const { BlobServiceClient } = require('@azure/storage-blob');
|
||||||
const { Octokit } = require('@octokit/rest');
|
const { Octokit } = require('@octokit/rest');
|
||||||
|
|
||||||
|
@ -299,7 +298,7 @@ async function uploadShasumFile (filePath, fileName, releaseId) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function saveShaSumFile (checksums, fileName) {
|
function saveShaSumFile (checksums, fileName) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise(resolve => {
|
||||||
temp.open(fileName, (err, info) => {
|
temp.open(fileName, (err, info) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
console.error(`${fail} Could not create ${fileName} file`);
|
console.error(`${fail} Could not create ${fileName} file`);
|
||||||
|
@ -372,18 +371,6 @@ async function makeRelease (releaseToValidate) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function makeTempDir () {
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
temp.mkdir('electron-publish', (err, dirPath) => {
|
|
||||||
if (err) {
|
|
||||||
reject(err);
|
|
||||||
} else {
|
|
||||||
resolve(dirPath);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
const SHASUM_256_FILENAME = 'SHASUMS256.txt';
|
const SHASUM_256_FILENAME = 'SHASUMS256.txt';
|
||||||
const SHASUM_1_FILENAME = 'SHASUMS.txt';
|
const SHASUM_1_FILENAME = 'SHASUMS.txt';
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ function parseCommandLine () {
|
||||||
string: ['bump', 'version'],
|
string: ['bump', 'version'],
|
||||||
boolean: ['dryRun', 'help'],
|
boolean: ['dryRun', 'help'],
|
||||||
alias: { version: ['v'] },
|
alias: { version: ['v'] },
|
||||||
unknown: arg => { help = true; }
|
unknown: () => { help = true; }
|
||||||
});
|
});
|
||||||
if (help || opts.help || !opts.bump) {
|
if (help || opts.help || !opts.bump) {
|
||||||
console.log(`
|
console.log(`
|
||||||
|
@ -33,14 +33,6 @@ async function main () {
|
||||||
const currentVersion = getElectronVersion();
|
const currentVersion = getElectronVersion();
|
||||||
const version = await nextVersion(opts.bump, currentVersion);
|
const version = await nextVersion(opts.bump, currentVersion);
|
||||||
|
|
||||||
const parsed = semver.parse(version);
|
|
||||||
const components = {
|
|
||||||
major: parsed.major,
|
|
||||||
minor: parsed.minor,
|
|
||||||
patch: parsed.patch,
|
|
||||||
pre: parsed.prerelease
|
|
||||||
};
|
|
||||||
|
|
||||||
// print would-be new version and exit early
|
// print would-be new version and exit early
|
||||||
if (opts.dryRun) {
|
if (opts.dryRun) {
|
||||||
console.log(`new version number would be: ${version}\n`);
|
console.log(`new version number would be: ${version}\n`);
|
||||||
|
@ -97,18 +89,6 @@ async function nextVersion (bumpType, version) {
|
||||||
return version;
|
return version;
|
||||||
}
|
}
|
||||||
|
|
||||||
function isMajorStable (bump, currentVersion) {
|
|
||||||
if (versionUtils.isBeta(currentVersion) && (bump === 'stable')) return true;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
function isMajorNightly (version, currentVersion) {
|
|
||||||
const parsed = semver.parse(version);
|
|
||||||
const current = semver.parse(currentVersion);
|
|
||||||
if (versionUtils.isNightly(currentVersion) && (parsed.major > current.major)) return true;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (require.main === module) {
|
if (require.main === module) {
|
||||||
main().catch((error) => {
|
main().catch((error) => {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
|
|
|
@ -1,13 +1,8 @@
|
||||||
const path = require('node:path');
|
|
||||||
const fs = require('node:fs');
|
|
||||||
const semver = require('semver');
|
const semver = require('semver');
|
||||||
const { GitProcess } = require('dugite');
|
const { GitProcess } = require('dugite');
|
||||||
const { promisify } = require('node:util');
|
|
||||||
|
|
||||||
const { ELECTRON_DIR } = require('../lib/utils');
|
const { ELECTRON_DIR } = require('../lib/utils');
|
||||||
|
|
||||||
const readFile = promisify(fs.readFile);
|
|
||||||
|
|
||||||
const preType = {
|
const preType = {
|
||||||
NONE: 'none',
|
NONE: 'none',
|
||||||
PARTIAL: 'partial',
|
PARTIAL: 'partial',
|
||||||
|
|
|
@ -183,14 +183,6 @@ async function runTestUsingElectron (specDir, testName) {
|
||||||
console.log(`${pass} Electron ${testName} process tests passed.`);
|
console.log(`${pass} Electron ${testName} process tests passed.`);
|
||||||
}
|
}
|
||||||
|
|
||||||
const specFilter = (file) => {
|
|
||||||
if (!/-spec\.[tj]s$/.test(file)) {
|
|
||||||
return false;
|
|
||||||
} else {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
async function runNativeElectronTests () {
|
async function runNativeElectronTests () {
|
||||||
let testTargets = require('./native-test-targets.json');
|
let testTargets = require('./native-test-targets.json');
|
||||||
const outDir = `out/${utils.getOutDir()}`;
|
const outDir = `out/${utils.getOutDir()}`;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const { contextBridge, ipcRenderer } = require('electron');
|
const { contextBridge } = require('electron');
|
||||||
|
|
||||||
contextBridge.exposeInMainWorld('str', 'some-text');
|
contextBridge.exposeInMainWorld('str', 'some-text');
|
||||||
contextBridge.exposeInMainWorld('obj', { prop: 'obj-prop' });
|
contextBridge.exposeInMainWorld('obj', { prop: 'obj-prop' });
|
||||||
|
|
2
spec/fixtures/api/new-window-preload.js
vendored
2
spec/fixtures/api/new-window-preload.js
vendored
|
@ -1,4 +1,4 @@
|
||||||
const { ipcRenderer, webFrame } = require('electron');
|
const { ipcRenderer } = require('electron');
|
||||||
|
|
||||||
ipcRenderer.send('answer', {
|
ipcRenderer.send('answer', {
|
||||||
argv: process.argv
|
argv: process.argv
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const { app, safeStorage, ipcMain } = require('electron');
|
const { app, safeStorage } = require('electron');
|
||||||
const { promises: fs } = require('node:fs');
|
const { promises: fs } = require('node:fs');
|
||||||
const path = require('node:path');
|
const path = require('node:path');
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const { app, safeStorage, ipcMain } = require('electron');
|
const { app, safeStorage } = require('electron');
|
||||||
const { promises: fs } = require('node:fs');
|
const { promises: fs } = require('node:fs');
|
||||||
const path = require('node:path');
|
const path = require('node:path');
|
||||||
|
|
||||||
|
@ -7,6 +7,6 @@ const writeFile = fs.writeFile;
|
||||||
|
|
||||||
app.whenReady().then(async () => {
|
app.whenReady().then(async () => {
|
||||||
const encrypted = safeStorage.encryptString('plaintext');
|
const encrypted = safeStorage.encryptString('plaintext');
|
||||||
const encryptedString = await writeFile(pathToEncryptedString, encrypted);
|
await writeFile(pathToEncryptedString, encrypted);
|
||||||
app.quit();
|
app.quit();
|
||||||
});
|
});
|
||||||
|
|
2
spec/fixtures/api/service-workers/sw-logs.js
vendored
2
spec/fixtures/api/service-workers/sw-logs.js
vendored
|
@ -1,4 +1,4 @@
|
||||||
self.addEventListener('install', function (event) {
|
self.addEventListener('install', function () {
|
||||||
console.log('log log');
|
console.log('log log');
|
||||||
console.info('info log');
|
console.info('info log');
|
||||||
console.warn('warn log');
|
console.warn('warn log');
|
||||||
|
|
2
spec/fixtures/api/service-workers/sw.js
vendored
2
spec/fixtures/api/service-workers/sw.js
vendored
|
@ -1,3 +1,3 @@
|
||||||
self.addEventListener('install', function (event) {
|
self.addEventListener('install', function () {
|
||||||
console.log('Installed');
|
console.log('Installed');
|
||||||
});
|
});
|
||||||
|
|
2
spec/fixtures/api/singleton/main.js
vendored
2
spec/fixtures/api/singleton/main.js
vendored
|
@ -8,7 +8,7 @@ const gotTheLock = app.requestSingleInstanceLock();
|
||||||
|
|
||||||
app.on('second-instance', (event, args, workingDirectory) => {
|
app.on('second-instance', (event, args, workingDirectory) => {
|
||||||
setImmediate(() => {
|
setImmediate(() => {
|
||||||
console.log(JSON.stringify(args));
|
console.log(JSON.stringify(args), workingDirectory);
|
||||||
app.exit(0);
|
app.exit(0);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
3
spec/fixtures/apps/crash/node-extra-args.js
vendored
3
spec/fixtures/apps/crash/node-extra-args.js
vendored
|
@ -1,6 +1,3 @@
|
||||||
const path = require('node:path');
|
|
||||||
const childProcess = require('node:child_process');
|
|
||||||
|
|
||||||
process.on('message', function () {
|
process.on('message', function () {
|
||||||
process.send(process.argv);
|
process.send(process.argv);
|
||||||
});
|
});
|
||||||
|
|
2
spec/fixtures/apps/libuv-hang/renderer.js
vendored
2
spec/fixtures/apps/libuv-hang/renderer.js
vendored
|
@ -1,5 +1,3 @@
|
||||||
const count = localStorage.getItem('count');
|
|
||||||
|
|
||||||
const { run, ipcRenderer } = window.api;
|
const { run, ipcRenderer } = window.api;
|
||||||
|
|
||||||
run().then(async () => {
|
run().then(async () => {
|
||||||
|
|
2
spec/fixtures/apps/remote-control/main.js
vendored
2
spec/fixtures/apps/remote-control/main.js
vendored
|
@ -1,7 +1,7 @@
|
||||||
const { app } = require('electron');
|
const { app } = require('electron');
|
||||||
const http = require('node:http');
|
const http = require('node:http');
|
||||||
const v8 = require('node:v8');
|
const v8 = require('node:v8');
|
||||||
// eslint-disable-next-line camelcase
|
// eslint-disable-next-line camelcase,@typescript-eslint/no-unused-vars
|
||||||
const promises_1 = require('node:timers/promises');
|
const promises_1 = require('node:timers/promises');
|
||||||
|
|
||||||
if (app.commandLine.hasSwitch('boot-eval')) {
|
if (app.commandLine.hasSwitch('boot-eval')) {
|
||||||
|
|
1
spec/fixtures/apps/self-module-paths/main.js
vendored
1
spec/fixtures/apps/self-module-paths/main.js
vendored
|
@ -1,6 +1,5 @@
|
||||||
// Modules to control application life and create native browser window
|
// Modules to control application life and create native browser window
|
||||||
const { app, BrowserWindow, ipcMain } = require('electron');
|
const { app, BrowserWindow, ipcMain } = require('electron');
|
||||||
const path = require('node:path');
|
|
||||||
|
|
||||||
function createWindow () {
|
function createWindow () {
|
||||||
const mainWindow = new BrowserWindow({
|
const mainWindow = new BrowserWindow({
|
||||||
|
|
2
spec/fixtures/chromium/other-window.js
vendored
2
spec/fixtures/chromium/other-window.js
vendored
|
@ -4,7 +4,7 @@ const ints = (...args) => args.map(a => parseInt(a, 10));
|
||||||
|
|
||||||
const [x, y, width, height] = ints(...process.argv.slice(2));
|
const [x, y, width, height] = ints(...process.argv.slice(2));
|
||||||
|
|
||||||
let w;
|
let w; // eslint-disable-line @typescript-eslint/no-unused-vars
|
||||||
|
|
||||||
app.whenReady().then(() => {
|
app.whenReady().then(() => {
|
||||||
w = new BrowserWindow({
|
w = new BrowserWindow({
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const { app, BrowserWindow, ipcMain } = require('electron');
|
const { app, BrowserWindow } = require('electron');
|
||||||
const path = require('node:path');
|
const path = require('node:path');
|
||||||
|
|
||||||
app.whenReady().then(() => {
|
app.whenReady().then(() => {
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
/* global registerPaint */
|
/* global registerPaint */
|
||||||
|
|
||||||
class CheckerboardPainter {
|
class CheckerboardPainter {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||||
paint (ctx, geom, properties) {
|
paint (ctx, geom, properties) {
|
||||||
const colors = ['red', 'green', 'blue'];
|
const colors = ['red', 'green', 'blue'];
|
||||||
const size = 32;
|
const size = 32;
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
/* global chrome */
|
/* global chrome */
|
||||||
|
|
||||||
chrome.webRequest.onBeforeRequest.addListener(
|
chrome.webRequest.onBeforeRequest.addListener(
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||||
(details) => {
|
(details) => {
|
||||||
return { cancel: true };
|
return { cancel: true };
|
||||||
},
|
},
|
||||||
|
|
|
@ -2,6 +2,6 @@
|
||||||
window.completionPromise = new Promise((resolve) => {
|
window.completionPromise = new Promise((resolve) => {
|
||||||
window.completionPromiseResolve = resolve;
|
window.completionPromiseResolve = resolve;
|
||||||
});
|
});
|
||||||
chrome.runtime.sendMessage({ some: 'message' }, (response) => {
|
chrome.runtime.sendMessage({ some: 'message' }, () => {
|
||||||
window.completionPromiseResolve(chrome.extension.getBackgroundPage().receivedMessage);
|
window.completionPromiseResolve(chrome.extension.getBackgroundPage().receivedMessage);
|
||||||
});
|
});
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
window.completionPromise = new Promise((resolve) => {
|
window.completionPromise = new Promise((resolve) => {
|
||||||
window.completionPromiseResolve = resolve;
|
window.completionPromiseResolve = resolve;
|
||||||
});
|
});
|
||||||
chrome.runtime.sendMessage({ some: 'message' }, (response) => {
|
chrome.runtime.sendMessage({ some: 'message' }, () => {
|
||||||
chrome.runtime.getBackgroundPage((bgPage) => {
|
chrome.runtime.getBackgroundPage((bgPage) => {
|
||||||
window.completionPromiseResolve(bgPage.receivedMessage);
|
window.completionPromiseResolve(bgPage.receivedMessage);
|
||||||
});
|
});
|
||||||
|
|
2
spec/fixtures/module/preload-context.js
vendored
2
spec/fixtures/module/preload-context.js
vendored
|
@ -1,4 +1,4 @@
|
||||||
var test = 'test'; // eslint-disable-line no-var
|
var test = 'test'; // eslint-disable-line no-var,@typescript-eslint/no-unused-vars
|
||||||
|
|
||||||
const types = {
|
const types = {
|
||||||
require: typeof require,
|
require: typeof require,
|
||||||
|
|
1
spec/fixtures/module/preload-sandbox.js
vendored
1
spec/fixtures/module/preload-sandbox.js
vendored
|
@ -58,6 +58,7 @@
|
||||||
ipcRenderer.on('touch-the-opener', () => {
|
ipcRenderer.on('touch-the-opener', () => {
|
||||||
let errorMessage = null;
|
let errorMessage = null;
|
||||||
try {
|
try {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||||
const openerDoc = opener.document;
|
const openerDoc = opener.document;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
errorMessage = error.message;
|
errorMessage = error.message;
|
||||||
|
|
3
spec/fixtures/testsnap.js
vendored
3
spec/fixtures/testsnap.js
vendored
|
@ -1,3 +1,4 @@
|
||||||
// taken from https://chromium.googlesource.com/v8/v8.git/+/HEAD/test/cctest/test-serialize.cc#1127
|
// taken from https://chromium.googlesource.com/v8/v8.git/+/HEAD/test/cctest/test-serialize.cc
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||||
function f () { return g() * 2; }
|
function f () { return g() * 2; }
|
||||||
function g () { return 43; }
|
function g () { return 43; }
|
||||||
|
|
|
@ -394,8 +394,10 @@ function parseWebP (riff) {
|
||||||
const height = tmp & 0x3FFF;
|
const height = tmp & 0x3FFF;
|
||||||
const verticalScale = tmp >> 14;
|
const verticalScale = tmp >> 14;
|
||||||
return {
|
return {
|
||||||
width: width,
|
width,
|
||||||
height: height,
|
height,
|
||||||
|
horizontalScale,
|
||||||
|
verticalScale,
|
||||||
data: VP8,
|
data: VP8,
|
||||||
riff: riff
|
riff: riff
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue