Skip to content

Commit 0deea17

Browse files
committed
fix grammar
1 parent 02b4869 commit 0deea17

7 files changed

Lines changed: 109 additions & 109 deletions

File tree

main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ let mainWindow
1313

1414
function createWindow () {
1515
// Create the browser window.
16-
mainWindow = new BrowserWindow({backgroundColor: '#000000', alwaysOnTop: true, thickFrame: true, fullscreen: true, kiosk: true, frame: false})
16+
mainWindow = new BrowserWindow({ backgroundColor: '#000000', alwaysOnTop: true, thickFrame: true, fullscreen: true, kiosk: true, frame: false })
1717

1818
// and load the index.html of the app.
1919
mainWindow.loadURL(url.format({

src/Character.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ class Character {
3939
this.mesh.position.x = this.coordinate.x
4040
this.mesh.position.y = this.coordinate.y
4141

42-
for (let i of this.eases) {
43-
let t = this.time - i[2] - 5
42+
for (const i of this.eases) {
43+
const t = this.time - i[2] - 5
4444

4545
this.velocity.x += i[0] / (0.1 * t * t + 1)
4646
this.velocity.y += i[1] / (0.1 * t * t + 1)

src/Footprints.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ http://opensource.org/licenses/mit-license.php
88
const THREE = require('THREE')
99
const Globals = require('./Globals')
1010

11-
let MAX_POINTS = 100
11+
const MAX_POINTS = 100
1212

1313
function shuffle (array) {
1414
let n = array.length
@@ -47,16 +47,16 @@ class Footprints {
4747
this.points.position.x = Globals.character.coordinate.x
4848
this.points.position.y = Globals.character.coordinate.y
4949

50-
let position = this.points_geometry.attributes.position.array
51-
let color = this.points_geometry.attributes.color.array
50+
const position = this.points_geometry.attributes.position.array
51+
const color = this.points_geometry.attributes.color.array
5252

5353
let posIndex = 0
5454
let colIndex = 0
5555

5656
for (let i = 0; i < this.coordinates_and_colors.length; i++) {
57-
let x = this.coordinates_and_colors[i][0]
58-
let y = this.coordinates_and_colors[i][1]
59-
let c = this.coordinates_and_colors[i][2] // the color of footprint
57+
const x = this.coordinates_and_colors[i][0]
58+
const y = this.coordinates_and_colors[i][1]
59+
const c = this.coordinates_and_colors[i][2] // the color of footprint
6060

6161
position[posIndex++] = x - Globals.character.coordinate.x
6262
position[posIndex++] = y - Globals.character.coordinate.y

src/MacMemory.js

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -9,31 +9,31 @@ const ref = require('ref')
99
const ffi = require('ffi')
1010
const Struct = require('ref-struct')
1111

12-
let RegionInfo = Struct({
13-
'protection': 'uint32',
14-
'max_protection': 'uint32',
15-
'inheritance': 'uint32',
16-
'shared': 'uint32',
17-
'reserved': 'uint32',
18-
'offset': 'ulonglong',
19-
'behavior': 'uint32',
20-
'user_wired_count': 'ushort'
12+
const RegionInfo = Struct({
13+
protection: 'uint32',
14+
max_protection: 'uint32',
15+
inheritance: 'uint32',
16+
shared: 'uint32',
17+
reserved: 'uint32',
18+
offset: 'ulonglong',
19+
behavior: 'uint32',
20+
user_wired_count: 'ushort'
2121
})
2222

23-
let RegionInfoPtr = ref.refType(RegionInfo)
23+
const RegionInfoPtr = ref.refType(RegionInfo)
2424

25-
let libc = ffi.Library('libc', {
26-
'mach_task_self': ['uint', []],
27-
'task_for_pid': ['int', ['uint', 'int', '*uint']],
28-
'mach_vm_region': ['int', ['uint', '*ulong', '*ulong', 'int', RegionInfoPtr, '*uint32', '*uint32']],
29-
'mach_vm_read': ['int', ['uint', 'ulonglong', 'ulonglong', '*void', '*uint32']]
25+
const libc = ffi.Library('libc', {
26+
mach_task_self: ['uint', []],
27+
task_for_pid: ['int', ['uint', 'int', '*uint']],
28+
mach_vm_region: ['int', ['uint', '*ulong', '*ulong', 'int', RegionInfoPtr, '*uint32', '*uint32']],
29+
mach_vm_read: ['int', ['uint', 'ulonglong', 'ulonglong', '*void', '*uint32']]
3030
})
3131

3232
class Memory {
3333
constructor (pid) {
34-
let taskRef = ref.alloc('uint', 0)
35-
let mytask = libc.mach_task_self()
36-
let ret = libc.task_for_pid(mytask, pid, taskRef)
34+
const taskRef = ref.alloc('uint', 0)
35+
const mytask = libc.mach_task_self()
36+
const ret = libc.task_for_pid(mytask, pid, taskRef)
3737
if (ret !== 0) {
3838
throw new Error('task_for_pid error ' + ret)
3939
}
@@ -42,15 +42,15 @@ class Memory {
4242
}
4343

4444
getRegions () {
45-
let regions = []
46-
let address = ref.alloc('ulong', 0)
47-
let mapsize = ref.alloc('ulong', 0)
48-
let name = ref.alloc('uint32', 0)
49-
let count = ref.alloc('uint32', RegionInfo.size / 4)
50-
let info = new RegionInfo()
45+
const regions = []
46+
const address = ref.alloc('ulong', 0)
47+
const mapsize = ref.alloc('ulong', 0)
48+
const name = ref.alloc('uint32', 0)
49+
const count = ref.alloc('uint32', RegionInfo.size / 4)
50+
const info = new RegionInfo()
5151

5252
while (true) {
53-
let ret = libc.mach_vm_region(this.task, address, mapsize, 9, info.ref(), count, name)
53+
const ret = libc.mach_vm_region(this.task, address, mapsize, 9, info.ref(), count, name)
5454
if (ret === 1) {
5555
break
5656
}
@@ -67,19 +67,19 @@ class Memory {
6767
}
6868

6969
read (address, length) {
70-
let dataref = ref.alloc('*void')
71-
let cnt = ref.alloc('uint32', 0)
70+
const dataref = ref.alloc('*void')
71+
const cnt = ref.alloc('uint32', 0)
7272

73-
let ret = libc.mach_vm_read(this.task, address, length, dataref, cnt)
73+
const ret = libc.mach_vm_read(this.task, address, length, dataref, cnt)
7474
if (ret !== 0) {
7575
throw new Error('mach_vm_read error ' + ret)
7676
}
7777
return dataref.readPointer(0, length)
7878
}
7979

8080
readAsync (address, length) {
81-
let detaref = ref.alloc('*void')
82-
let cnt = ref.alloc('uint32', 0)
81+
const detaref = ref.alloc('*void')
82+
const cnt = ref.alloc('uint32', 0)
8383

8484
return new Promise((resolve, reject) => {
8585
libc.mach_vm_read.async(this.task, address, length, detaref, cnt, (err, ret) => {

src/ProcessSelect.js

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ const suji = require('./suji.json')
1212
const Globals = require('./Globals')
1313
const Memory = require('./Memory')
1414

15-
let width = 90
16-
let height = 90
17-
let intervalX = 150
18-
let intervalY = 150
19-
let font = new THREE.Font(suji)
15+
const width = 90
16+
const height = 90
17+
const intervalX = 150
18+
const intervalY = 150
19+
const font = new THREE.Font(suji)
2020

2121
class ProcessSelect {
2222
constructor () {
@@ -43,9 +43,9 @@ class ProcessSelect {
4343

4444
// create overwrap block
4545
{
46-
let geometry = new THREE.PlaneGeometry(width - 2, height - 2, 1, 1)
47-
let material = new THREE.MeshBasicMaterial({ color: 0xff0000 })
48-
let mesh = new THREE.Mesh(geometry, material)
46+
const geometry = new THREE.PlaneGeometry(width - 2, height - 2, 1, 1)
47+
const material = new THREE.MeshBasicMaterial({ color: 0xff0000 })
48+
const mesh = new THREE.Mesh(geometry, material)
4949
mesh.visible = false
5050
mesh.position.z = 1
5151
Globals.scene.add(mesh)
@@ -57,14 +57,14 @@ class ProcessSelect {
5757
this.blocks = []
5858
this.labels = []
5959
for (let i = 0; i < this.pids.length; i++) {
60-
let x = (i % this.cols - this.cols / 2 + 0.5) * intervalX
61-
let y = (Math.floor(i / this.cols) - Math.floor(this.pids.length / this.cols)) * intervalY
60+
const x = (i % this.cols - this.cols / 2 + 0.5) * intervalX
61+
const y = (Math.floor(i / this.cols) - Math.floor(this.pids.length / this.cols)) * intervalY
6262

6363
// block
6464
{
65-
let geometry = new THREE.PlaneGeometry(width, height, 1, 1)
66-
let material = new THREE.MeshBasicMaterial({ color: 0xffffff })
67-
let mesh = new THREE.Mesh(geometry, material)
65+
const geometry = new THREE.PlaneGeometry(width, height, 1, 1)
66+
const material = new THREE.MeshBasicMaterial({ color: 0xffffff })
67+
const mesh = new THREE.Mesh(geometry, material)
6868

6969
mesh.position.x = x
7070
mesh.position.y = y
@@ -76,12 +76,12 @@ class ProcessSelect {
7676

7777
// label
7878
{
79-
let geometry = new THREE.TextGeometry(this.pids[i].toString(), {
79+
const geometry = new THREE.TextGeometry(this.pids[i].toString(), {
8080
font: font,
8181
size: 10
8282
})
83-
let material = new THREE.MeshBasicMaterial({ color: 0x052344 })
84-
let mesh = new THREE.Mesh(geometry, material)
83+
const material = new THREE.MeshBasicMaterial({ color: 0x052344 })
84+
const mesh = new THREE.Mesh(geometry, material)
8585
mesh.position.x = x - width / 2 + 5
8686
mesh.position.y = y - height / 2 + 5
8787
mesh.position.z = 2
@@ -103,13 +103,13 @@ class ProcessSelect {
103103
this.overwrap.geometry.dispose()
104104
this.overwrap.material.dispose()
105105

106-
for (let m of this.blocks) {
106+
for (const m of this.blocks) {
107107
Globals.scene.remove(m)
108108
m.geometry.dispose()
109109
m.material.dispose()
110110
}
111111

112-
for (let m of this.labels) {
112+
for (const m of this.labels) {
113113
Globals.scene.remove(m)
114114
m.geometry.dispose()
115115
m.material.dispose()
@@ -123,7 +123,7 @@ class ProcessSelect {
123123
// After selecting
124124
if (this.progress >= 1) {
125125
// fade blocks
126-
for (let m of this.blocks) {
126+
for (const m of this.blocks) {
127127
m.material.opacity -= 0.015
128128
m.material.transparent = true
129129
}
@@ -133,10 +133,10 @@ class ProcessSelect {
133133
}
134134

135135
// decorate block
136-
let overwrap = this.overwrap
136+
const overwrap = this.overwrap
137137

138138
if (this.index !== null) {
139-
let mesh = this.blocks[this.index]
139+
const mesh = this.blocks[this.index]
140140

141141
overwrap.position.x = mesh.position.x
142142
overwrap.position.y = mesh.position.y

src/ProcessView.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const Memory = require('./Memory')
1111
const Globals = require('./Globals')
1212

1313
// mathematical modulo
14-
let mod = function (n, m) {
14+
const mod = function (n, m) {
1515
return ((n % m) + m) % m
1616
}
1717

@@ -31,7 +31,7 @@ function shuffle (array) {
3131
return array
3232
}
3333

34-
let MAX_POINTS = 2000
34+
const MAX_POINTS = 2000
3535

3636
class ProcessView {
3737
constructor (pid) {
@@ -42,7 +42,7 @@ class ProcessView {
4242

4343
this.mem = new Memory(pid)
4444

45-
for (let region of shuffle(this.mem.getRegions())) {
45+
for (const region of shuffle(this.mem.getRegions())) {
4646
this.region = region
4747
this.world_size = this.region[1]
4848
this.world_width = this.world_height = Math.floor(Math.sqrt(this.world_size))
@@ -81,9 +81,9 @@ class ProcessView {
8181
y = mod(y, this.world_height)
8282
try {
8383
if (x + l > this.world_width) {
84-
let leftlength = this.world_width - x
85-
let leftdata = this.mem.read(this.getAddress(x, y), leftlength)
86-
let rightdata = this.mem.read(this.getAddress(0, y), l - leftlength)
84+
const leftlength = this.world_width - x
85+
const leftdata = this.mem.read(this.getAddress(x, y), leftlength)
86+
const rightdata = this.mem.read(this.getAddress(0, y), l - leftlength)
8787
return Array.from(leftdata).concat(Array.from(rightdata))
8888
}
8989
return this.mem.read(this.getAddress(x, y), l)
@@ -93,26 +93,26 @@ class ProcessView {
9393
}
9494

9595
update () {
96-
let stairX = Math.floor(Globals.character.coordinate.x / this.tilesize)
97-
let stairY = Math.floor(Globals.character.coordinate.y / this.tilesize)
96+
const stairX = Math.floor(Globals.character.coordinate.x / this.tilesize)
97+
const stairY = Math.floor(Globals.character.coordinate.y / this.tilesize)
9898

9999
this.world_points.position.x = stairX * this.tilesize
100100
this.world_points.position.y = stairY * this.tilesize
101101

102-
let charaX = stairX + this.world_offset_x
103-
let charaY = stairY + this.world_offset_y
102+
const charaX = stairX + this.world_offset_x
103+
const charaY = stairY + this.world_offset_y
104104

105-
let position = this.world_geometry.attributes.position.array
106-
let color = this.world_geometry.attributes.color.array
105+
const position = this.world_geometry.attributes.position.array
106+
const color = this.world_geometry.attributes.color.array
107107

108108
let posIndex = 0
109109
let colIndex = 0
110110
let vertIndex = 0
111111

112112
for (let j = -this.rows; j < this.rows + 3; j++) {
113-
let data = this.getByteSync(charaX, charaY + j, 2 * this.cols + 5)
113+
const data = this.getByteSync(charaX, charaY + j, 2 * this.cols + 5)
114114
for (let i = -this.cols - 1; i < this.cols + 3; i++) {
115-
let col = data[i + this.cols + 1] / 255
115+
const col = data[i + this.cols + 1] / 255
116116

117117
if (col !== 0) {
118118
position[posIndex++] = i * this.tilesize

0 commit comments

Comments
 (0)