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: Undo accidental whitespace change Created Jan. 16, 2017, 2:57 p.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
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);
}

Powered by Google App Engine
This is Rietveld