Skip to content

Commit 5bee5ac

Browse files
committed
Fixed scoping issue in exit
1 parent 1b17f2b commit 5bee5ac

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/processes/process_system.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -260,9 +260,9 @@ class ProcessSystem {
260260
let process = null;
261261

262262
if(two){
263-
let pid = one;
264-
let reason = two;
265-
let process = this.pids.get(this.pidof(pid));
263+
pid = one;
264+
reason = two;
265+
process = this.pids.get(this.pidof(pid));
266266

267267
if((process && process.is_trapping_exits()) || reason === States.KILL || reason === States.NORMAL){
268268
this.mailboxes.get(process.pid).deliver(new ErlangTypes.Tuple(States.EXIT, this.pid(), reason ));
@@ -271,9 +271,10 @@ class ProcessSystem {
271271
}
272272

273273
}else{
274-
let pid = this.current_process.pid;
275-
let reason = one;
276-
let process = this.current_process;
274+
pid = this.current_process.pid;
275+
reason = one;
276+
process = this.current_process;
277+
277278
process.signal(reason);
278279
}
279280

0 commit comments

Comments
 (0)