Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: lib/messaging.js

Issue 29371763: Issue 4795 - Use modern JavaScript syntax (Closed)
Patch Set: Addressed feedback, used destructuring Created Jan. 17, 2017, 7:39 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/io.js ('k') | lib/notificationHelper.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/messaging.js
diff --git a/lib/messaging.js b/lib/messaging.js
index 8cb24de383f32a0a7995339e5863a533687b1e68..5159ce6366dae02381f89274c1df52caad0d8d5b 100644
--- a/lib/messaging.js
+++ b/lib/messaging.js
@@ -34,7 +34,7 @@ function Port()
};
Port.prototype = {
- _onMessage: function(message, sender, sendResponse)
+ _onMessage(message, sender, sendResponse)
{
let async = false;
let callbacks = this._eventEmitter.listeners(message.type);
@@ -81,7 +81,7 @@ Port.prototype = {
* @param {string} name
* @param {Port~messageCallback} callback
*/
- on: function(name, callback)
+ on(name, callback)
{
this._eventEmitter.on(name, callback);
},
@@ -92,7 +92,7 @@ Port.prototype = {
* @param {string} name
* @param {Port~messageCallback} callback
*/
- off: function(name, callback)
+ off(name, callback)
{
this._eventEmitter.off(name, callback);
},
@@ -100,7 +100,7 @@ Port.prototype = {
/**
* Disables the port and makes it stop listening to incoming messages.
*/
- disconnect: function()
+ disconnect()
{
ext.onMessage.removeListener(this._onMessage);
}
« no previous file with comments | « lib/io.js ('k') | lib/notificationHelper.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld