From 1e9f97bc8fc4ceb4eb5f1f0a18f66e30342c4ceb Mon Sep 17 00:00:00 2001 From: Guy Fraser Date: Sat, 25 Jun 2016 02:11:17 +0100 Subject: [PATCH] debugger: use arrow function for lexical `this` Refs #7414 --- lib/_debug_agent.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/_debug_agent.js b/lib/_debug_agent.js index cb4684f0eddfac..61983f17c31c96 100644 --- a/lib/_debug_agent.js +++ b/lib/_debug_agent.js @@ -50,9 +50,8 @@ function Agent() { this.binding = process._debugAPI; assert(this.binding, 'Debugger agent running without bindings!'); - var self = this; - this.binding.onmessage = function(msg) { - self.clients.forEach(function(client) { + this.binding.onmessage = (msg) => { + this.clients.forEach((client) => { client.send({}, msg); }); };