Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update signals.js #181

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions dev/lib/signals.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
* @return {*} Value returned by the listener.
*/
execute : function (paramsArr) {
var handlerReturn, params;
let handlerReturn, params;
if (this.active && !!this._listener) {
params = this.params? this.params.concat(paramsArr) : paramsArr;
handlerReturn = this._listener.apply(this.context, params);
Expand Down Expand Up @@ -215,7 +215,7 @@
*/
_registerListener : function (listener, isOnce, listenerContext, priority) {

var prevIndex = this._indexOfListener(listener, listenerContext),
let prevIndex = this._indexOfListener(listener, listenerContext),
binding;

if (prevIndex !== -1) {
Expand All @@ -241,7 +241,7 @@
*/
_addBinding : function (binding) {
//simplified insertion sort
var n = this._bindings.length;
let n = this._bindings.length;
do { --n; } while (this._bindings[n] && binding._priority <= this._bindings[n]._priority);
this._bindings.splice(n + 1, 0, binding);
},
Expand All @@ -252,7 +252,7 @@
* @private
*/
_indexOfListener : function (listener, context) {
var n = this._bindings.length,
let n = this._bindings.length,
cur;
while (n--) {
cur = this._bindings[n];
Expand Down Expand Up @@ -306,7 +306,7 @@
remove : function (listener, context) {
validateListener(listener, 'remove');

var i = this._indexOfListener(listener, context);
let i = this._indexOfListener(listener, context);
if (i !== -1) {
this._bindings[i]._destroy(); //no reason to a SignalBinding exist if it isn't attached to a signal
this._bindings.splice(i, 1);
Expand All @@ -318,7 +318,7 @@
* Remove all listeners from the Signal.
*/
removeAll : function () {
var n = this._bindings.length;
let n = this._bindings.length;
while (n--) {
this._bindings[n]._destroy();
}
Expand Down Expand Up @@ -350,7 +350,7 @@
return;
}

var paramsArr = Array.prototype.slice.call(arguments),
let paramsArr = Array.prototype.slice.call(arguments),
n = this._bindings.length,
bindings;

Expand Down Expand Up @@ -407,7 +407,7 @@
* @namespace
* @name signals
*/
var signals = Signal;
let signals = Signal;

/**
* Custom event broadcaster
Expand Down