🎨 Implement JS Standard Code Style 7
Updates Standard Code Style to 7 (latest major) and ensures that code is conform. * camelCase is now enforced * No assignments in return statements
This commit is contained in:
parent
b86ded3b54
commit
bef6748c06
4 changed files with 14 additions and 11 deletions
|
@ -89,7 +89,9 @@ MenuItem = (function () {
|
||||||
if (defaultValue == null) {
|
if (defaultValue == null) {
|
||||||
defaultValue = null
|
defaultValue = null
|
||||||
}
|
}
|
||||||
return this[name] != null ? this[name] : this[name] = defaultValue
|
this[name] != null ? this[name] : this[name] = defaultValue
|
||||||
|
|
||||||
|
return this[name]
|
||||||
}
|
}
|
||||||
|
|
||||||
MenuItem.prototype.overrideReadOnlyProperty = function (name, defaultValue) {
|
MenuItem.prototype.overrideReadOnlyProperty = function (name, defaultValue) {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
(function () {
|
(function () {
|
||||||
const asar = process.binding('atom_common_asar')
|
const asar = process.binding('atom_common_asar')
|
||||||
const child_process = require('child_process')
|
const childProcess = require('child_process')
|
||||||
const path = require('path')
|
const path = require('path')
|
||||||
const util = require('util')
|
const util = require('util')
|
||||||
|
|
||||||
|
@ -591,13 +591,13 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
// Executing a command string containing a path to an asar
|
// Executing a command string containing a path to an asar
|
||||||
// archive confuses `child_process.execFile`, which is internally
|
// archive confuses `childProcess.execFile`, which is internally
|
||||||
// called by `child_process.{exec,execSync}`, causing
|
// called by `childProcess.{exec,execSync}`, causing
|
||||||
// Electron to consider the full command as a single path
|
// Electron to consider the full command as a single path
|
||||||
// to an archive.
|
// to an archive.
|
||||||
[ 'exec', 'execSync' ].forEach(function (functionName) {
|
[ 'exec', 'execSync' ].forEach(function (functionName) {
|
||||||
var old = child_process[functionName]
|
var old = childProcess[functionName]
|
||||||
child_process[functionName] = function () {
|
childProcess[functionName] = function () {
|
||||||
var processNoAsarOriginalValue = process.noAsar
|
var processNoAsarOriginalValue = process.noAsar
|
||||||
process.noAsar = true
|
process.noAsar = true
|
||||||
var result = old.apply(this, arguments)
|
var result = old.apply(this, arguments)
|
||||||
|
@ -607,10 +607,10 @@
|
||||||
})
|
})
|
||||||
|
|
||||||
overrideAPI(fs, 'open')
|
overrideAPI(fs, 'open')
|
||||||
overrideAPI(child_process, 'execFile')
|
overrideAPI(childProcess, 'execFile')
|
||||||
overrideAPISync(process, 'dlopen', 1)
|
overrideAPISync(process, 'dlopen', 1)
|
||||||
overrideAPISync(require('module')._extensions, '.node', 1)
|
overrideAPISync(require('module')._extensions, '.node', 1)
|
||||||
overrideAPISync(fs, 'openSync')
|
overrideAPISync(fs, 'openSync')
|
||||||
return overrideAPISync(child_process, 'execFileSync')
|
return overrideAPISync(childProcess, 'execFileSync')
|
||||||
}
|
}
|
||||||
})()
|
})()
|
||||||
|
|
|
@ -15,8 +15,9 @@ var BrowserWindowProxy = (function () {
|
||||||
BrowserWindowProxy.proxies = {}
|
BrowserWindowProxy.proxies = {}
|
||||||
|
|
||||||
BrowserWindowProxy.getOrCreate = function (guestId) {
|
BrowserWindowProxy.getOrCreate = function (guestId) {
|
||||||
var base
|
var base = this.proxies
|
||||||
return (base = this.proxies)[guestId] != null ? base[guestId] : base[guestId] = new BrowserWindowProxy(guestId)
|
base[guestId] != null ? base[guestId] : base[guestId] = new BrowserWindowProxy(guestId)
|
||||||
|
return base[guestId]
|
||||||
}
|
}
|
||||||
|
|
||||||
BrowserWindowProxy.remove = function (guestId) {
|
BrowserWindowProxy.remove = function (guestId) {
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"asar": "^0.11.0",
|
"asar": "^0.11.0",
|
||||||
"request": "*",
|
"request": "*",
|
||||||
"standard": "^6.0.8"
|
"standard": "^7.1.0"
|
||||||
},
|
},
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
"runas": "^3.0.0"
|
"runas": "^3.0.0"
|
||||||
|
|
Loading…
Reference in a new issue