Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'release-0.5.2'

  • Loading branch information...
commit d5a63c155e20edf1077d7e0a224acd7be072f495 2 parents 7365bf6 + 2a5c9e2
@millermedeiros authored
Showing with 2,444 additions and 1,001 deletions.
  1. +1 −1  .gitignore
  2. +5 −0 .project
  3. +32 −4 CHANGELOG.markdown
  4. +4 −3 README.markdown
  5. +64 −20 build.xml
  6. +2 −2 dev/build/build.number
  7. +9 −2 dev/build/build.properties
  8. +23 −0 dev/build/jslint4java/LICENCE.txt
  9. +42 −0 dev/build/jslint4java/README.markdown
  10. BIN  dev/build/jslint4java/jslint4java-1.4.6.jar
  11. +5 −0 dev/build/yuitest-coverage/LICENSE
  12. BIN  dev/build/yuitest-coverage/yuitest-coverage-0.5.5.jar
  13. BIN  dev/build/yuitest-coverage/yuitest-coverage-report-0.5.5.jar
  14. +45 −41 dev/src/Signal.js
  15. +18 −11 dev/src/SignalBinding.js
  16. +0 −8 dev/src/intro.js
  17. +0 −1  dev/src/outro.js
  18. +19 −10 dev/src/signals.js
  19. +1 −0  dev/tests/coverage/coverage.json
  20. +442 −0 dev/tests/coverage/js-signals.inst.js
  21. +915 −0 dev/tests/coverage/report/C_MillerPersonalopen_source_projectsjs_signalsdistjs_signals.js.html
  22. +107 −0 dev/tests/coverage/report/index.html
  23. +19 −0 dev/tests/instrumented.html
  24. +10 −5 dev/tests/src/01.js
  25. +1 −3 dist/docs/files.html
  26. +1 −12 dist/docs/index.html
  27. +2 −22 dist/docs/symbolindex.html
  28. +44 −3 dist/docs/symbols/_global_.html
  29. +26 −15 dist/docs/symbols/signals.Signal.html
  30. +15 −16 dist/docs/symbols/signals.SignalBinding.html
  31. +0 −247 dist/docs/symbols/signals.html
  32. +382 −374 dist/docs/symbols/src/C__Miller_Personal_open_source_projects_js-signals_dist_js-signals.js.html
  33. +204 −195 dist/js-signals.js
  34. +6 −6 dist/js-signals.min.js
View
2  .gitignore
@@ -1,6 +1,6 @@
.tmp*
.project
-.settings
+.settings/
.DS_Store?
ehthumbs.db
View
5 .project
@@ -5,6 +5,11 @@
<projects>
</projects>
<buildSpec>
+ <buildCommand>
+ <name>com.aptana.ide.core.unifiedBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
</buildSpec>
<natures>
<nature>com.aptana.projects.webnature</nature>
View
36 CHANGELOG.markdown
@@ -2,6 +2,34 @@
+## v0.5.2 (2011/02/18) ##
+
+### Other ###
+
+ - changed to a module pattern.
+ - added YUI test coverage.
+ - improved build and src files structure.
+ - simplified `remove`, `removeAll`, `add`.
+ - improved error messages.
+
+
+
+## v0.5.1 (2011/01/30) ##
+
+### API changes ###
+
+ - made `SignalBinding` constructor private. (issue #15)
+ - changed params order on `SignalBinding` constructor.
+ - removed `signals.isDef()`. (issue #14)
+
+### Other ###
+
+ - added JSLint to the build process. (issue #12)
+ - validated source code using JSLint. (issue #13)
+ - improved docs.
+
+
+
## v0.5 (2010/12/03) ##
### API changes ###
@@ -11,12 +39,12 @@
- `Signal.dispose()` (issue #6)
- `signals.VERSION`
- `signals.isDef()`
-
+
- Removed:
- - `SignalBinding.listener` (issue #3)
-
+ - `SignalBinding.listener` (issue #3)
+
- Renamed:
- - `SignalBinding.listenerScope` -> `SignalBinding.context` (issue #4)
+ - `SignalBinding.listenerScope` -> `SignalBinding.context` (issue #4)
### Fixes ###
View
7 README.markdown
@@ -6,9 +6,10 @@ Custom event/messaging system for JavaScript inspired by [AS3-Signals](https://g
## Links ##
- * [JS-Signals Project Page](http://millermedeiros.github.com/js-signals/)
- * [JS-Signals Wiki](http://github.com/millermedeiros/js-signals/wiki/)
- * [JS-Signals Documentation](http://millermedeiros.github.com/js-signals/docs)
+ * [Project Page](http://millermedeiros.github.com/js-signals/)
+ * [Wiki](http://github.com/millermedeiros/js-signals/wiki/)
+ * [Documentation](http://millermedeiros.github.com/js-signals/docs)
+ * [Changelog](http://github.com/millermedeiros/js-signals/blob/master/CHANGELOG.markdown)
## License ##
View
84 build.xml
@@ -16,12 +16,7 @@
</delete>
</target>
- <target name="-purgeDocs">
- <delete dir="${docs.dir}" />
- <mkdir dir="${docs.dir}"/>
- </target>
-
- <target name="build" depends="-purgeJsDeploy">
+ <target name="compile" depends="-purgeJsDeploy">
<echo message="Building ${dist.name}..." />
<buildnumber file="${build.dir}/build.number"/>
@@ -30,25 +25,35 @@
<format property="build.date" pattern="MM/dd/yyyy hh:mm aa" unit="hour"/>
</tstamp>
- <concat destfile="${dist.dir}/${dist.name}" fixlastline="yes" eol="unix">
- <filelist dir="${src.dir}">
- <file name="intro.js" />
- <file name="signals.js" />
- <file name="Signal.js" />
- <file name="SignalBinding.js" />
- <file name="outro.js" />
- </filelist>
- </concat>
+ <copy file="${src.dir}/signals.js" tofile="${dist.dir}/${dist.name}" />
+ <loadfile property="SignalBinding.js" srcFile="${src.dir}/SignalBinding.js"/>
+ <loadfile property="Signal.js" srcFile="${src.dir}/Signal.js"/>
<replace file="${dist.dir}/${dist.name}">
<replacefilter token="::VERSION_NUMBER::" value="${version.number}" />
<replacefilter token="::BUILD_NUMBER::" value="${build.number}" />
<replacefilter token="::BUILD_DATE::" value="${build.date}" />
+ <replacefilter token="//::SIGNAL_BINDING_JS:://" value="${SignalBinding.js}" />
+ <replacefilter token="//::SIGNAL_JS:://" value="${Signal.js}" />
</replace>
<echo message="${dist.name} built." />
</target>
+ <target name="lint">
+ <echo message="JSLinting ${dist.name}..."/>
+
+ <apply executable="java">
+ <filelist dir="${dist.dir}">
+ <file name="${dist.name}"/>
+ </filelist>
+ <arg line="-jar"/>
+ <arg path="${jslint.jar}"/>
+ </apply>
+
+ <echo message="JSLinted ${dist.name}."/>
+ </target>
+
<target name="minify">
<echo message="Building ${dist.min.name}..." />
@@ -59,7 +64,7 @@
<arg line="-jar" />
<arg path="${yuicompressor.jar}" />
<arg value="--charset" />
- <arg value="ANSI" />
+ <arg value="UTF8" />
<arg value="-v" />
<arg value="-o" />
<targetfile />
@@ -68,8 +73,13 @@
<echo message="${dist.min.name} built." />
</target>
-
- <target name="generateDoc">
+
+ <target name="-purgeDocs">
+ <delete dir="${docs.dir}" />
+ <mkdir dir="${docs.dir}"/>
+ </target>
+
+ <target name="generateDocs" depends="-purgeDocs">
<echo message="Generating documentation" />
<apply executable="java" parallel="false" verbose="true">
<fileset dir="${dist.dir}">
@@ -84,11 +94,45 @@
<echo message="Documentation generated" />
</target>
- <target name="compile" depends="build, minify">
+ <target name="-purgeCoverage">
+ <delete dir="${coverage.dir}" />
+ <mkdir dir="${coverage.dir}"/>
+ <mkdir dir="${coverage-report.dir}"/>
+ </target>
+
+ <target name="instrument" depends="-purgeCoverage">
+ <echo message="Instrumenting ${dist.name}..."/>
+
+ <exec executable="java">
+ <arg line="-jar"/>
+ <arg path="${yuitest-coverage.jar}"/>
+ <arg value="-o"/>
+ <arg path="${coverage.dir}/${dist.inst.name}"/>
+ <arg path="${dist.dir}/${dist.name}"/>
+ </exec>
+
+ <echo message="${dist.name} instrumented."/>
+ </target>
+
+ <target name="coverageReport">
+ <echo message="Gerating test coverage report..."/>
+
+ <exec executable="java">
+ <arg line="-jar"/>
+ <arg path="${yuitest-coverage-report.jar}"/>
+ <arg value="-o" />
+ <arg path="${coverage-report.dir}"/>
+ <arg path="${coverage.json}"/>
+ </exec>
+
+ <echo message="Test coverage report generated."/>
+ </target>
+
+ <target name="build" depends="compile, lint, minify">
<echo message="Build Complete." />
</target>
- <target name="all" depends="compile, generateDoc">
+ <target name="all" depends="build, generateDocs">
<echo message="Build Complete." />
</target>
View
4 dev/build/build.number
@@ -1,3 +1,3 @@
#Build Number for ANT. Do not edit!
-#Fri Dec 03 17:27:32 EST 2010
-build.number=101
+#Fri Feb 18 19:22:48 EST 2011
+build.number=139
View
11 dev/build/build.properties
@@ -3,9 +3,16 @@ src.dir = ${dev.dir}/src
build.dir = ${dev.dir}/build
dist.dir = dist
docs.dir = ${dist.dir}/docs
+coverage.dir = ${dev.dir}/tests/coverage
+coverage-report.dir = ${coverage.dir}/report
jsdoc-toolkit.dir = ${build.dir}/jsdoc-toolkit
yuicompressor.jar = ${build.dir}/yuicompressor/yuicompressor-2.4.2.jar
+jslint.jar = ${build.dir}/jslint4java/jslint4java-1.4.6.jar
+yuitest-coverage.jar = ${build.dir}/yuitest-coverage/yuitest-coverage-0.5.5.jar
+yuitest-coverage-report.jar = ${build.dir}/yuitest-coverage/yuitest-coverage-report-0.5.5.jar
product.name = js-signals
-version.number = 0.5
+version.number = 0.5.2
dist.name = ${product.name}.js
-dist.min.name = ${product.name}.min.js
+dist.min.name = ${product.name}.min.js
+dist.inst.name = ${product.name}.inst.js
+coverage.json = ${coverage.dir}/coverage.json
View
23 dev/build/jslint4java/LICENCE.txt
@@ -0,0 +1,23 @@
+Copyright (C) 2007 by Dominic Mitchell
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
View
42 dev/build/jslint4java/README.markdown
@@ -0,0 +1,42 @@
+jslint for java <http://code.google.com/p/jslint4java/>
+=======================================================
+
+This is a java wrapper around the fabulous tool by Douglas Crockford, jslint
+(See <http://jslint.com/>). It provides a simple interface for detecting
+potential problems in JavaScript code.
+
+You can run it on the command line:
+
+ % java -jar jslint4java-1.4.6.jar application.js
+ jslint:application.js:11:9:Line breaking error ')'.
+ jslint:application.js:11:10:Missing semicolon.
+
+There are a multitude of options; try `--help` for more details.
+
+The output is colon separated fields. The fields are:
+
+ * "jslint"
+ * the file name
+ * the line number (starting at zero)
+ * the character number (starting at zero)
+ * the problem that was found
+
+You may also use the jar as an ant task. The quickest way to get started is
+to drop it in `~/.ant/lib`. See `docs/ant.html` for more details.
+
+**NB:** The packaged jar file includes a builtin version of rhino (a JavaScript
+engine). If this causes trouble, you can download a standalone version
+through the maven repository.
+
+If you wish to use jslint4java from within Java, please use a maven dependency:
+
+ <dependency>
+ <groupId>com.googlecode.jslint4java</groupId>
+ <artifactId>jslint4java</artifactId>
+ <version>1.4.6</version>
+ </dependency>
+
+If you have any comments or queries, please send them to dom [at] happygiraffe.net.
+
+This software is licenced under the BSD licence (see LICENCE.txt).
+
View
BIN  dev/build/jslint4java/jslint4java-1.4.6.jar
Binary file not shown
View
5 dev/build/yuitest-coverage/LICENSE
@@ -0,0 +1,5 @@
+YUI Test
+Author: Nicholas C. Zakas <nzakas@yahoo-inc.com>
+Copyright (c) 2009, Yahoo! Inc. All rights reserved.
+All source code licensed under the BSD License:
+ http://developer.yahoo.net/yui/license.txt
View
BIN  dev/build/yuitest-coverage/yuitest-coverage-0.5.5.jar
Binary file not shown
View
BIN  dev/build/yuitest-coverage/yuitest-coverage-report-0.5.5.jar
Binary file not shown
View
86 dev/src/Signal.js
@@ -1,19 +1,21 @@
-
+
+ // Signal --------------------------------------------------------
+ //================================================================
+
/**
- * Signal - custom event broadcaster
+ * Custom event broadcaster
* <br />- inspired by Robert Penner's AS3 Signals.
* @author Miller Medeiros
* @constructor
*/
signals.Signal = function(){
/**
- * @type Array.<signals.SignalBinding>
+ * @type Array.<SignalBinding>
* @private
*/
this._bindings = [];
};
-
signals.Signal.prototype = {
/**
@@ -32,12 +34,14 @@
* @param {Function} listener
* @param {boolean} isOnce
* @param {Object} [scope]
- * @return {signals.SignalBinding}
+ * @return {SignalBinding}
* @private
*/
_registerListener : function(listener, isOnce, scope){
- if(!signals.isDef(listener)) throw new Error('listener is a required param of add() and addOnce().');
+ if(typeof listener !== 'function'){
+ throw new Error('listener is a required param of add() and addOnce() and should be a Function.');
+ }
var prevIndex = this._indexOfListener(listener),
binding;
@@ -48,30 +52,24 @@
throw new Error('You cannot add'+ (isOnce? '' : 'Once') +'() then add'+ (!isOnce? '' : 'Once') +'() the same listener without removing the relationship first.');
}
} else {
- binding = new signals.SignalBinding(listener, isOnce, scope, this);
- this._addBinding(binding);
+ binding = new SignalBinding(this, listener, isOnce, scope);
+ this._bindings.push(binding);
}
return binding;
},
/**
- * @param {signals.SignalBinding} binding
- * @private
- */
- _addBinding : function(binding){
- this._bindings.push(binding);
- },
-
- /**
* @param {Function} listener
- * @return {int}
+ * @return {number}
* @private
*/
_indexOfListener : function(listener){
var n = this._bindings.length;
while(n--){
- if(this._bindings[n]._listener === listener) return n;
+ if(this._bindings[n]._listener === listener){
+ return n;
+ }
}
return -1;
},
@@ -80,7 +78,7 @@
* Add a listener to the signal.
* @param {Function} listener Signal handler function.
* @param {Object} [scope] Context on which listener will be executed (object that should represent the `this` variable inside listener function).
- * @return {signals.SignalBinding} An Object representing the binding between the Signal and listener.
+ * @return {SignalBinding} An Object representing the binding between the Signal and listener.
*/
add : function(listener, scope){
return this._registerListener(listener, false, scope);
@@ -90,30 +88,27 @@
* Add listener to the signal that should be removed after first execution (will be executed only once).
* @param {Function} listener Signal handler function.
* @param {Object} [scope] Context on which listener will be executed (object that should represent the `this` variable inside listener function).
- * @return {signals.SignalBinding} An Object representing the binding between the Signal and listener.
+ * @return {SignalBinding} An Object representing the binding between the Signal and listener.
*/
addOnce : function(listener, scope){
return this._registerListener(listener, true, scope);
},
/**
- * @private
- */
- _removeByIndex : function(i){
- this._bindings[i]._destroy(); //no reason to a SignalBinding exist if it isn't attached to a signal
- this._bindings.splice(i, 1);
- },
-
- /**
* Remove a single listener from the dispatch queue.
* @param {Function} listener Handler function that should be removed.
* @return {Function} Listener handler function.
*/
remove : function(listener){
- if(!signals.isDef(listener)) throw new Error('listener is a required param of remove().');
+ if(typeof listener !== 'function'){
+ throw new Error('listener is a required param of remove() and should be a Function.');
+ }
var i = this._indexOfListener(listener);
- if(i !== -1) this._removeByIndex(i);
+ 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);
+ }
return listener;
},
@@ -123,20 +118,23 @@
removeAll : function(){
var n = this._bindings.length;
while(n--){
- this._removeByIndex(n);
+ this._bindings[n]._destroy();
}
+ this._bindings.length = 0;
},
/**
- * @return {uint} Number of listeners attached to the Signal.
+ * @return {number} Number of listeners attached to the Signal.
*/
getNumListeners : function(){
return this._bindings.length;
},
/**
- * Disable Signal, will block dispatch to listeners until `enable()` is called.
+ * Disable Signal. Block dispatch to listeners until `enable()` is called.
+ * <p><strong>IMPORTANT:</strong> If this method is called during a dispatch it will only have effect on the next dispatch, if you want to stop the propagation of a signal use `halt()` instead.</p>
* @see signals.Signal.prototype.enable
+ * @see signals.Signal.prototype.halt
*/
disable : function(){
this._isEnabled = false;
@@ -159,7 +157,8 @@
/**
* Stop propagation of the event, blocking the dispatch to next listeners on the queue.
- * - should be called only during signal dispatch, calling it before/after dispatch won't affect signal broadcast.
+ * <p><strong>IMPORTANT:</strong> should be called only during signal dispatch, calling it before/after dispatch won't affect signal broadcast.</p>
+ * @see signals.Signal.prototype.disable
*/
halt : function(){
this._shouldPropagate = false;
@@ -170,23 +169,28 @@
* @param {...*} [params] Parameters that should be passed to each handler.
*/
dispatch : function(params){
- if(! this._isEnabled) return;
+ if(! this._isEnabled){
+ return;
+ }
var paramsArr = Array.prototype.slice.call(arguments),
bindings = this._bindings.slice(), //clone array in case add/remove items during dispatch
- i = 0,
- cur;
+ i,
+ n = this._bindings.length;
this._shouldPropagate = true; //in case `halt` was called before dispatch or during the previous dispatch.
- while(cur = bindings[i++]){
- if(cur.execute(paramsArr) === false || !this._shouldPropagate) break; //execute all callbacks until end of the list or until a callback returns `false` or stops propagation
+ for(i=0; i<n; i++){
+ //execute all callbacks until end of the list or until a callback returns `false` or stops propagation
+ if(bindings[i].execute(paramsArr) === false || !this._shouldPropagate){
+ break;
+ }
}
},
/**
- * Remove binding from signal and destroy any reference to external Objects (destroy Signal object).
- * <br /> - calling methods on the signal instance after calling dispose will throw errors.
+ * Remove all bindings from signal and destroy any reference to external objects (destroy Signal object).
+ * <p><strong>IMPORTANT:</strong> calling any method on the signal instance after calling dispose will throw errors.</p>
*/
dispose : function(){
this.removeAll();
View
29 dev/src/SignalBinding.js
@@ -1,16 +1,20 @@
+ // SignalBinding -------------------------------------------------
+ //================================================================
+
/**
* Object that represents a binding between a Signal and a listener function.
- * <br />- <strong>Constructor shouldn't be called by regular user, used internally.</strong>
+ * <br />- <strong>This is an internall constructor and shouldn't be called by regular user.</strong>
* <br />- inspired by Joa Ebert AS3 SignalBinding and Robert Penner's Slot classes.
* @author Miller Medeiros
* @constructor
+ * @name signals.SignalBinding
+ * @param {signals.Signal} signal Reference to Signal object that listener is currently bound to.
* @param {Function} listener Handler function bound to the signal.
* @param {boolean} isOnce If binding should be executed just once.
- * @param {?Object} listenerContext Context on which listener will be executed (object that should represent the `this` variable inside listener function).
- * @param {signals.Signal} signal Reference to Signal object that listener is currently bound to.
+ * @param {Object} [listenerContext] Context on which listener will be executed (object that should represent the `this` variable inside listener function).
*/
- signals.SignalBinding = function(listener, isOnce, listenerContext, signal){
+ function SignalBinding(signal, listener, isOnce, listenerContext){
/**
* Handler function bound to the signal.
@@ -28,7 +32,9 @@
/**
* Context on which listener will be executed (object that should represent the `this` variable inside listener function).
- * @type Object
+ * @memberOf signals.SignalBinding.prototype
+ * @name context
+ * @type {Object|undefined}
*/
this.context = listenerContext;
@@ -38,10 +44,9 @@
* @private
*/
this._signal = signal;
- };
-
+ }
- signals.SignalBinding.prototype = {
+ SignalBinding.prototype = /** @lends signals.SignalBinding.prototype */ {
/**
* @type boolean
@@ -59,7 +64,9 @@
var r;
if(this._isEnabled){
r = this._listener.apply(this.context, paramsArr);
- if(this._isOnce) this.detach();
+ if(this._isOnce){
+ this.detach();
+ }
}
return r; //avoid warnings on some editors
},
@@ -82,7 +89,7 @@
/**
* Remove binding from signal and destroy any reference to external Objects (destroy SignalBinding object).
- * <br /> - calling methods on the binding instance after calling dispose will throw errors.
+ * <p><strong>IMPORTANT:</strong> calling methods on the binding instance after calling dispose will throw errors.</p>
*/
dispose : function(){
this.detach();
@@ -137,4 +144,4 @@
return '[SignalBinding isOnce: '+ this._isOnce +', isEnabled: '+ this._isEnabled +']';
}
- };
+ };
View
8 dev/src/intro.js
@@ -1,8 +0,0 @@
-/*!!
- * JS Signals <https://github.com/millermedeiros/js-signals>
- * Released under the MIT license (http://www.opensource.org/licenses/mit-license.php)
- * @author Miller Medeiros <http://millermedeiros.com>
- * @version ::VERSION_NUMBER::
- * @build ::BUILD_NUMBER:: ::BUILD_DATE::
- */
-(function(){
View
1  dev/src/outro.js
@@ -1 +0,0 @@
-}());
View
29 dev/src/signals.js
@@ -1,21 +1,30 @@
-
+/*jslint onevar:true, undef:true, newcap:true, regexp:true, bitwise:true, maxerr:50, indent:4, white:false, nomen:false, plusplus:false */
+
+/*!!
+ * JS Signals <http://millermedeiros.github.com/js-signals/>
+ * Released under the MIT license <http://www.opensource.org/licenses/mit-license.php>
+ * @author Miller Medeiros <http://millermedeiros.com/>
+ * @version ::VERSION_NUMBER::
+ * @build ::BUILD_NUMBER:: (::BUILD_DATE::)
+ */
+var signals = (function(){
+
/**
* @namespace Signals Namespace - Custom event/messaging system based on AS3 Signals
* @name signals
*/
- var signals = window.signals = {};
-
+ var signals = {};
+
/**
* Signals Version Number
* @type string
* @const
*/
signals.VERSION = '::VERSION_NUMBER::';
+
+//::SIGNAL_BINDING_JS:://
+//::SIGNAL_JS:://
+
+ return signals;
- /**
- * @param {*} param Parameter to check.
- * @return {boolean} `true` if parameter is different than `undefined`.
- */
- signals.isDef = function(param){
- return typeof param !== 'undefined';
- };
+}());
View
1  dev/tests/coverage/coverage.json
@@ -0,0 +1 @@
+{"C:MillerPersonalopen_source_projectsjs-signalsdistjs-signals.js":{"lines":{"10":1,"16":1,"23":1,"41":1,"48":118,"55":118,"63":118,"70":118,"73":1,"88":83,"89":83,"90":82,"91":82,"92":23,"95":83,"104":25,"111":8,"119":1,"120":1,"128":59,"129":59,"130":59,"131":59,"139":1,"147":1,"154":3,"161":16,"168":0,"182":1,"187":72,"190":1,"213":127,"214":2,"217":125,"220":124,"221":6,"222":6,"223":2,"226":118,"227":118,"230":122,"239":167,"240":165,"241":126,"242":41,"245":124,"255":79,"265":48,"274":43,"275":1,"278":42,"279":41,"280":35,"281":35,"283":41,"290":8,"291":8,"292":23,"294":8,"301":40,"311":1,"319":1,"326":6,"335":2,"343":69,"344":1,"347":68,"352":67,"354":67,"356":83,"357":2,"367":4,"368":4,"375":0,"380":1},"functions":{"SignalBinding:41":118,"execute:87":83,"detach:103":25,"getListener:110":8,"dispose:118":1,"_destroy:127":59,"disable:138":1,"enable:146":1,"isEnabled:153":3,"isOnce:160":16,"toString:167":0,"Signal:182":72,"_registerListener:211":127,"_indexOfListener:238":167,"add:254":79,"addOnce:264":48,"remove:273":43,"removeAll:289":8,"getNumListeners:300":40,"disable:310":1,"enable:318":1,"isEnabled:325":6,"halt:334":2,"dispatch:342":69,"dispose:366":4,"toString:374":0,"(anonymous 1):10":1},"coveredLines":75,"calledLines":73,"coveredFunctions":27,"calledFunctions":25,"path":"C:\\Miller\\Personal\\open_source_projects\\js-signals\\dist\\js-signals.js","code":["/*jslint onevar:true, undef:true, newcap:true, regexp:true, bitwise:true, maxerr:50, indent:4, white:false, nomen:false, plusplus:false */","","/*!!"," * JS Signals <http://millermedeiros.github.com/js-signals/>"," * Released under the MIT license <http://www.opensource.org/licenses/mit-license.php>"," * @author Miller Medeiros <http://millermedeiros.com/>"," * @version 0.5.2"," * @build 138 (02/18/2011 07:22 PM)"," */","var signals = (function(){","","\u0009/**","\u0009 * @namespace Signals Namespace - Custom event/messaging system based on AS3 Signals","\u0009 * @name signals","\u0009 */","\u0009var signals = {};","","\u0009/**","\u0009 * Signals Version Number","\u0009 * @type string","\u0009 * @const","\u0009 */","\u0009signals.VERSION = '0.5.2';","","\u0009","\u0009// SignalBinding -------------------------------------------------","\u0009//================================================================","\u0009","\u0009/**","\u0009 * Object that represents a binding between a Signal and a listener function.","\u0009 * <br />- <strong>This is an internall constructor and shouldn't be called by regular user.</strong>","\u0009 * <br />- inspired by Joa Ebert AS3 SignalBinding and Robert Penner's Slot classes.","\u0009 * @author Miller Medeiros","\u0009 * @constructor","\u0009 * @name signals.SignalBinding","\u0009 * @param {signals.Signal} signal\u0009Reference to Signal object that listener is currently bound to.","\u0009 * @param {Function} listener\u0009Handler function bound to the signal.","\u0009 * @param {boolean} isOnce\u0009If binding should be executed just once.","\u0009 * @param {Object} [listenerContext]\u0009Context on which listener will be executed (object that should represent the `this` variable inside listener function).","\u0009 */","\u0009 function SignalBinding(signal, listener, isOnce, listenerContext){","\u0009\u0009","\u0009\u0009/**","\u0009\u0009 * Handler function bound to the signal.","\u0009\u0009 * @type Function","\u0009\u0009 * @private","\u0009\u0009 */","\u0009\u0009this._listener = listener;","\u0009\u0009","\u0009\u0009/**","\u0009\u0009 * If binding should be executed just once.","\u0009\u0009 * @type boolean","\u0009\u0009 * @private","\u0009\u0009 */","\u0009\u0009this._isOnce = isOnce;","\u0009\u0009","\u0009\u0009/**","\u0009\u0009 * Context on which listener will be executed (object that should represent the `this` variable inside listener function).","\u0009\u0009 * @memberOf signals.SignalBinding.prototype","\u0009\u0009 * @name context","\u0009\u0009 * @type {Object|undefined}","\u0009\u0009 */","\u0009\u0009this.context = listenerContext;","\u0009\u0009","\u0009\u0009/**","\u0009\u0009 * Reference to Signal object that listener is currently bound to.","\u0009\u0009 * @type signals.Signal","\u0009\u0009 * @private","\u0009\u0009 */","\u0009\u0009this._signal = signal;","\u0009}","\u0009","\u0009SignalBinding.prototype = /** @lends signals.SignalBinding.prototype */ {","\u0009\u0009","\u0009\u0009/**","\u0009\u0009 * @type boolean","\u0009\u0009 * @private","\u0009\u0009 */","\u0009\u0009_isEnabled : true,","\u0009\u0009","\u0009\u0009/**","\u0009\u0009 * Call listener passing arbitrary parameters.","\u0009\u0009 * <p>If binding was added using `Signal.addOnce()` it will be automatically removed from signal dispatch queue, this method is used internally for the signal dispatch.</p> ","\u0009\u0009 * @param {Array} [paramsArr]\u0009Array of parameters that should be passed to the listener","\u0009\u0009 * @return {*} Value returned by the listener.","\u0009\u0009 */","\u0009\u0009execute : function(paramsArr){","\u0009\u0009\u0009var r;","\u0009\u0009\u0009if(this._isEnabled){","\u0009\u0009\u0009\u0009r = this._listener.apply(this.context, paramsArr);","\u0009\u0009\u0009\u0009if(this._isOnce){","\u0009\u0009\u0009\u0009\u0009this.detach();","\u0009\u0009\u0009\u0009}","\u0009\u0009\u0009}","\u0009\u0009\u0009return r; //avoid warnings on some editors","\u0009\u0009},","\u0009\u0009","\u0009\u0009/**","\u0009\u0009 * Detach binding from signal.","\u0009\u0009 * - alias to: mySignal.remove(myBinding.getListener());","\u0009\u0009 * @return {Function} Handler function bound to the signal.","\u0009\u0009 */","\u0009\u0009detach : function(){","\u0009\u0009\u0009return this._signal.remove(this._listener);","\u0009\u0009},","\u0009\u0009","\u0009\u0009/**","\u0009\u0009 * @return {Function} Handler function bound to the signal.","\u0009\u0009 */","\u0009\u0009getListener : function(){","\u0009\u0009\u0009return this._listener;","\u0009\u0009},","\u0009\u0009","\u0009\u0009/**","\u0009\u0009 * Remove binding from signal and destroy any reference to external Objects (destroy SignalBinding object).","\u0009\u0009 * <p><strong>IMPORTANT:</strong> calling methods on the binding instance after calling dispose will throw errors.</p>","\u0009\u0009 */","\u0009\u0009dispose : function(){","\u0009\u0009\u0009this.detach();","\u0009\u0009\u0009this._destroy();","\u0009\u0009},","\u0009\u0009","\u0009\u0009/**","\u0009\u0009 * Delete all instance properties","\u0009\u0009 * @private","\u0009\u0009 */","\u0009\u0009_destroy : function(){","\u0009\u0009\u0009delete this._signal;","\u0009\u0009\u0009delete this._isOnce;","\u0009\u0009\u0009delete this._listener;","\u0009\u0009\u0009delete this.context;","\u0009\u0009},","\u0009\u0009","\u0009\u0009/**","\u0009\u0009 * Disable SignalBinding, block listener execution. Listener will only be executed after calling `enable()`. ","\u0009\u0009 * @see signals.SignalBinding.enable()","\u0009\u0009 */","\u0009\u0009disable : function(){","\u0009\u0009\u0009this._isEnabled = false;","\u0009\u0009},","\u0009\u0009","\u0009\u0009/**","\u0009\u0009 * Enable SignalBinding. Enable listener execution.","\u0009\u0009 * @see signals.SignalBinding.disable()","\u0009\u0009 */","\u0009\u0009enable : function(){","\u0009\u0009\u0009this._isEnabled = true;","\u0009\u0009},","\u0009\u0009","\u0009\u0009/**","\u0009\u0009 * @return {boolean} If SignalBinding is currently paused and won't execute listener during dispatch.","\u0009\u0009 */","\u0009\u0009isEnabled : function(){","\u0009\u0009\u0009return this._isEnabled;","\u0009\u0009},","\u0009\u0009","\u0009\u0009/**","\u0009\u0009 * @return {boolean} If SignalBinding will only be executed once.","\u0009\u0009 */","\u0009\u0009isOnce : function(){","\u0009\u0009\u0009return this._isOnce;","\u0009\u0009},","\u0009\u0009","\u0009\u0009/**","\u0009\u0009 * @return {string} String representation of the object.","\u0009\u0009 */","\u0009\u0009toString : function(){","\u0009\u0009\u0009return '[SignalBinding isOnce: '+ this._isOnce +', isEnabled: '+ this._isEnabled +']';","\u0009\u0009}","\u0009\u0009","\u0009};","\u0009","\u0009// Signal --------------------------------------------------------","\u0009//================================================================","\u0009","\u0009/**","\u0009 * Custom event broadcaster","\u0009 * <br />- inspired by Robert Penner's AS3 Signals.","\u0009 * @author Miller Medeiros","\u0009 * @constructor","\u0009 */","\u0009signals.Signal = function(){","\u0009\u0009/**","\u0009\u0009 * @type Array.<SignalBinding>","\u0009\u0009 * @private","\u0009\u0009 */","\u0009\u0009this._bindings = [];","\u0009};","\u0009","\u0009signals.Signal.prototype = {","\u0009\u0009","\u0009\u0009/**","\u0009\u0009 * @type boolean","\u0009\u0009 * @private","\u0009\u0009 */","\u0009\u0009_shouldPropagate : true,","\u0009\u0009","\u0009\u0009/**","\u0009\u0009 * @type boolean","\u0009\u0009 * @private","\u0009\u0009 */","\u0009\u0009_isEnabled : true,","\u0009\u0009","\u0009\u0009/**","\u0009\u0009 * @param {Function} listener","\u0009\u0009 * @param {boolean} isOnce","\u0009\u0009 * @param {Object} [scope]","\u0009\u0009 * @return {SignalBinding}","\u0009\u0009 * @private","\u0009\u0009 */","\u0009\u0009_registerListener : function(listener, isOnce, scope){","\u0009\u0009\u0009","\u0009\u0009\u0009if(typeof listener !== 'function'){","\u0009\u0009\u0009\u0009throw new Error('listener is a required param of add() and addOnce() and should be a Function.');","\u0009\u0009\u0009}","\u0009\u0009\u0009","\u0009\u0009\u0009var prevIndex = this._indexOfListener(listener),","\u0009\u0009\u0009\u0009binding;","\u0009\u0009\u0009","\u0009\u0009\u0009if(prevIndex !== -1){ //avoid creating a new Binding for same listener if already added to list","\u0009\u0009\u0009\u0009binding = this._bindings[prevIndex];","\u0009\u0009\u0009\u0009if(binding.isOnce() !== isOnce){","\u0009\u0009\u0009\u0009\u0009throw new Error('You cannot add'+ (isOnce? '' : 'Once') +'() then add'+ (!isOnce? '' : 'Once') +'() the same listener without removing the relationship first.');","\u0009\u0009\u0009\u0009}","\u0009\u0009\u0009} else {","\u0009\u0009\u0009\u0009binding = new SignalBinding(this, listener, isOnce, scope);","\u0009\u0009\u0009\u0009this._bindings.push(binding);","\u0009\u0009\u0009}","\u0009\u0009\u0009","\u0009\u0009\u0009return binding;","\u0009\u0009},","\u0009\u0009","\u0009\u0009/**","\u0009\u0009 * @param {Function} listener","\u0009\u0009 * @return {number}","\u0009\u0009 * @private","\u0009\u0009 */","\u0009\u0009_indexOfListener : function(listener){","\u0009\u0009\u0009var n = this._bindings.length;","\u0009\u0009\u0009while(n--){","\u0009\u0009\u0009\u0009if(this._bindings[n]._listener === listener){","\u0009\u0009\u0009\u0009\u0009return n;","\u0009\u0009\u0009\u0009}","\u0009\u0009\u0009}","\u0009\u0009\u0009return -1;","\u0009\u0009},","\u0009\u0009","\u0009\u0009/**","\u0009\u0009 * Add a listener to the signal.","\u0009\u0009 * @param {Function} listener\u0009Signal handler function.","\u0009\u0009 * @param {Object} [scope]\u0009Context on which listener will be executed (object that should represent the `this` variable inside listener function).","\u0009\u0009 * @return {SignalBinding} An Object representing the binding between the Signal and listener.","\u0009\u0009 */","\u0009\u0009add : function(listener, scope){","\u0009\u0009\u0009return this._registerListener(listener, false, scope);","\u0009\u0009},","\u0009\u0009","\u0009\u0009/**","\u0009\u0009 * Add listener to the signal that should be removed after first execution (will be executed only once).","\u0009\u0009 * @param {Function} listener\u0009Signal handler function.","\u0009\u0009 * @param {Object} [scope]\u0009Context on which listener will be executed (object that should represent the `this` variable inside listener function).","\u0009\u0009 * @return {SignalBinding} An Object representing the binding between the Signal and listener.","\u0009\u0009 */","\u0009\u0009addOnce : function(listener, scope){","\u0009\u0009\u0009return this._registerListener(listener, true, scope);","\u0009\u0009},","\u0009\u0009","\u0009\u0009/**","\u0009\u0009 * Remove a single listener from the dispatch queue.","\u0009\u0009 * @param {Function} listener\u0009Handler function that should be removed.","\u0009\u0009 * @return {Function} Listener handler function.","\u0009\u0009 */","\u0009\u0009remove : function(listener){","\u0009\u0009\u0009if(typeof listener !== 'function'){","\u0009\u0009\u0009\u0009throw new Error('listener is a required param of remove() and should be a Function.');","\u0009\u0009\u0009}","\u0009\u0009\u0009","\u0009\u0009\u0009var i = this._indexOfListener(listener);","\u0009\u0009\u0009if(i !== -1){","\u0009\u0009\u0009\u0009this._bindings[i]._destroy(); //no reason to a SignalBinding exist if it isn't attached to a signal","\u0009\u0009\u0009\u0009this._bindings.splice(i, 1);","\u0009\u0009\u0009}","\u0009\u0009\u0009return listener;","\u0009\u0009},","\u0009\u0009","\u0009\u0009/**","\u0009\u0009 * Remove all listeners from the Signal.","\u0009\u0009 */","\u0009\u0009removeAll : function(){","\u0009\u0009\u0009var n = this._bindings.length;","\u0009\u0009\u0009while(n--){","\u0009\u0009\u0009\u0009this._bindings[n]._destroy();","\u0009\u0009\u0009}","\u0009\u0009\u0009this._bindings.length = 0;","\u0009\u0009},","\u0009\u0009","\u0009\u0009/**","\u0009\u0009 * @return {number} Number of listeners attached to the Signal.","\u0009\u0009 */","\u0009\u0009getNumListeners : function(){","\u0009\u0009\u0009return this._bindings.length;","\u0009\u0009},","\u0009\u0009","\u0009\u0009/**","\u0009\u0009 * Disable Signal. Block dispatch to listeners until `enable()` is called.","\u0009\u0009 * <p><strong>IMPORTANT:</strong> If this method is called during a dispatch it will only have effect on the next dispatch, if you want to stop the propagation of a signal use `halt()` instead.</p>","\u0009\u0009 * @see signals.Signal.prototype.enable","\u0009\u0009 * @see signals.Signal.prototype.halt","\u0009\u0009 */","\u0009\u0009disable : function(){","\u0009\u0009\u0009this._isEnabled = false;","\u0009\u0009},","\u0009\u0009","\u0009\u0009/**","\u0009\u0009 * Enable broadcast to listeners.","\u0009\u0009 * @see signals.Signal.prototype.disable","\u0009\u0009 */","\u0009\u0009enable : function(){","\u0009\u0009\u0009this._isEnabled = true;","\u0009\u0009}, ","\u0009\u0009","\u0009\u0009/**","\u0009\u0009 * @return {boolean} If Signal is currently enabled and will broadcast message to listeners.","\u0009\u0009 */","\u0009\u0009isEnabled : function(){","\u0009\u0009\u0009return this._isEnabled;","\u0009\u0009},","\u0009\u0009","\u0009\u0009/**","\u0009\u0009 * Stop propagation of the event, blocking the dispatch to next listeners on the queue.","\u0009\u0009 * <p><strong>IMPORTANT:</strong> should be called only during signal dispatch, calling it before/after dispatch won't affect signal broadcast.</p>","\u0009\u0009 * @see signals.Signal.prototype.disable ","\u0009\u0009 */","\u0009\u0009halt : function(){","\u0009\u0009\u0009this._shouldPropagate = false;","\u0009\u0009},","\u0009\u0009","\u0009\u0009/**","\u0009\u0009 * Dispatch/Broadcast Signal to all listeners added to the queue. ","\u0009\u0009 * @param {...*} [params]\u0009Parameters that should be passed to each handler.","\u0009\u0009 */","\u0009\u0009dispatch : function(params){","\u0009\u0009\u0009if(! this._isEnabled){","\u0009\u0009\u0009\u0009return;","\u0009\u0009\u0009}","\u0009\u0009\u0009","\u0009\u0009\u0009var paramsArr = Array.prototype.slice.call(arguments),","\u0009\u0009\u0009\u0009bindings = this._bindings.slice(), //clone array in case add/remove items during dispatch","\u0009\u0009\u0009\u0009i,","\u0009\u0009\u0009\u0009n = this._bindings.length;","\u0009\u0009\u0009","\u0009\u0009\u0009this._shouldPropagate = true; //in case `halt` was called before dispatch or during the previous dispatch.","\u0009\u0009\u0009\u0009\u0009\u0009","\u0009\u0009\u0009for(i=0; i<n; i++){","\u0009\u0009\u0009\u0009//execute all callbacks until end of the list or until a callback returns `false` or stops propagation","\u0009\u0009\u0009\u0009if(bindings[i].execute(paramsArr) === false || !this._shouldPropagate){","\u0009\u0009\u0009\u0009\u0009break;","\u0009\u0009\u0009\u0009}","\u0009\u0009\u0009}","\u0009\u0009},","\u0009\u0009","\u0009\u0009/**","\u0009\u0009 * Remove all bindings from signal and destroy any reference to external objects (destroy Signal object).","\u0009\u0009 * <p><strong>IMPORTANT:</strong> calling any method on the signal instance after calling dispose will throw errors.</p>","\u0009\u0009 */","\u0009\u0009dispose : function(){","\u0009\u0009\u0009this.removeAll();","\u0009\u0009\u0009delete this._bindings;","\u0009\u0009},","\u0009\u0009","\u0009\u0009/**","\u0009\u0009 * @return {string} String representation of the object.","\u0009\u0009 */","\u0009\u0009toString : function(){","\u0009\u0009\u0009return '[Signal isEnabled: '+ this._isEnabled +' numListeners: '+ this.getNumListeners() +']';","\u0009\u0009}","\u0009\u0009","\u0009};","","\u0009return signals;","\u0009","}());"]}}
View
442 dev/tests/coverage/js-signals.inst.js
@@ -0,0 +1,442 @@
+if (typeof _yuitest_coverage == "undefined"){
+ _yuitest_coverage = {};
+ _yuitest_coverline = function(src, line){
+ var coverage = _yuitest_coverage[src];
+ if (!coverage.lines[line]){
+ coverage.calledLines++;
+ }
+ coverage.lines[line]++;
+ };
+ _yuitest_coverfunc = function(src, name, line){
+ var coverage = _yuitest_coverage[src],
+ funcId = name + ":" + line;
+ if (!coverage.functions[funcId]){
+ coverage.calledFunctions++;
+ }
+ coverage.functions[funcId]++;
+ };
+}
+_yuitest_coverage["C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js"] = {
+ lines: {},
+ functions: {},
+ coveredLines: 0,
+ calledLines: 0,
+ coveredFunctions: 0,
+ calledFunctions: 0,
+ path: "C:\\Miller\\Personal\\open_source_projects\\js-signals\\dist\\js-signals.js",
+ code: []
+};
+_yuitest_coverage["C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js"].code=["/*jslint onevar:true, undef:true, newcap:true, regexp:true, bitwise:true, maxerr:50, indent:4, white:false, nomen:false, plusplus:false */","","/*!!"," * JS Signals <http://millermedeiros.github.com/js-signals/>"," * Released under the MIT license <http://www.opensource.org/licenses/mit-license.php>"," * @author Miller Medeiros <http://millermedeiros.com/>"," * @version 0.5.2"," * @build 138 (02/18/2011 07:22 PM)"," */","var signals = (function(){",""," /**"," * @namespace Signals Namespace - Custom event/messaging system based on AS3 Signals"," * @name signals"," */"," var signals = {};",""," /**"," * Signals Version Number"," * @type string"," * @const"," */"," signals.VERSION = '0.5.2';",""," "," // SignalBinding -------------------------------------------------"," //================================================================"," "," /**"," * Object that represents a binding between a Signal and a listener function."," * <br />- <strong>This is an internall constructor and shouldn't be called by regular user.</strong>"," * <br />- inspired by Joa Ebert AS3 SignalBinding and Robert Penner's Slot classes."," * @author Miller Medeiros"," * @constructor"," * @name signals.SignalBinding"," * @param {signals.Signal} signal Reference to Signal object that listener is currently bound to."," * @param {Function} listener Handler function bound to the signal."," * @param {boolean} isOnce If binding should be executed just once."," * @param {Object} [listenerContext] Context on which listener will be executed (object that should represent the `this` variable inside listener function)."," */"," function SignalBinding(signal, listener, isOnce, listenerContext){"," "," /**"," * Handler function bound to the signal."," * @type Function"," * @private"," */"," this._listener = listener;"," "," /**"," * If binding should be executed just once."," * @type boolean"," * @private"," */"," this._isOnce = isOnce;"," "," /**"," * Context on which listener will be executed (object that should represent the `this` variable inside listener function)."," * @memberOf signals.SignalBinding.prototype"," * @name context"," * @type {Object|undefined}"," */"," this.context = listenerContext;"," "," /**"," * Reference to Signal object that listener is currently bound to."," * @type signals.Signal"," * @private"," */"," this._signal = signal;"," }"," "," SignalBinding.prototype = /** @lends signals.SignalBinding.prototype */ {"," "," /**"," * @type boolean"," * @private"," */"," _isEnabled : true,"," "," /**"," * Call listener passing arbitrary parameters."," * <p>If binding was added using `Signal.addOnce()` it will be automatically removed from signal dispatch queue, this method is used internally for the signal dispatch.</p> "," * @param {Array} [paramsArr] Array of parameters that should be passed to the listener"," * @return {*} Value returned by the listener."," */"," execute : function(paramsArr){"," var r;"," if(this._isEnabled){"," r = this._listener.apply(this.context, paramsArr);"," if(this._isOnce){"," this.detach();"," }"," }"," return r; //avoid warnings on some editors"," },"," "," /**"," * Detach binding from signal."," * - alias to: mySignal.remove(myBinding.getListener());"," * @return {Function} Handler function bound to the signal."," */"," detach : function(){"," return this._signal.remove(this._listener);"," },"," "," /**"," * @return {Function} Handler function bound to the signal."," */"," getListener : function(){"," return this._listener;"," },"," "," /**"," * Remove binding from signal and destroy any reference to external Objects (destroy SignalBinding object)."," * <p><strong>IMPORTANT:</strong> calling methods on the binding instance after calling dispose will throw errors.</p>"," */"," dispose : function(){"," this.detach();"," this._destroy();"," },"," "," /**"," * Delete all instance properties"," * @private"," */"," _destroy : function(){"," delete this._signal;"," delete this._isOnce;"," delete this._listener;"," delete this.context;"," },"," "," /**"," * Disable SignalBinding, block listener execution. Listener will only be executed after calling `enable()`. "," * @see signals.SignalBinding.enable()"," */"," disable : function(){"," this._isEnabled = false;"," },"," "," /**"," * Enable SignalBinding. Enable listener execution."," * @see signals.SignalBinding.disable()"," */"," enable : function(){"," this._isEnabled = true;"," },"," "," /**"," * @return {boolean} If SignalBinding is currently paused and won't execute listener during dispatch."," */"," isEnabled : function(){"," return this._isEnabled;"," },"," "," /**"," * @return {boolean} If SignalBinding will only be executed once."," */"," isOnce : function(){"," return this._isOnce;"," },"," "," /**"," * @return {string} String representation of the object."," */"," toString : function(){"," return '[SignalBinding isOnce: '+ this._isOnce +', isEnabled: '+ this._isEnabled +']';"," }"," "," };"," "," // Signal --------------------------------------------------------"," //================================================================"," "," /**"," * Custom event broadcaster"," * <br />- inspired by Robert Penner's AS3 Signals."," * @author Miller Medeiros"," * @constructor"," */"," signals.Signal = function(){"," /**"," * @type Array.<SignalBinding>"," * @private"," */"," this._bindings = [];"," };"," "," signals.Signal.prototype = {"," "," /**"," * @type boolean"," * @private"," */"," _shouldPropagate : true,"," "," /**"," * @type boolean"," * @private"," */"," _isEnabled : true,"," "," /**"," * @param {Function} listener"," * @param {boolean} isOnce"," * @param {Object} [scope]"," * @return {SignalBinding}"," * @private"," */"," _registerListener : function(listener, isOnce, scope){"," "," if(typeof listener !== 'function'){"," throw new Error('listener is a required param of add() and addOnce() and should be a Function.');"," }"," "," var prevIndex = this._indexOfListener(listener),"," binding;"," "," if(prevIndex !== -1){ //avoid creating a new Binding for same listener if already added to list"," binding = this._bindings[prevIndex];"," if(binding.isOnce() !== isOnce){"," throw new Error('You cannot add'+ (isOnce? '' : 'Once') +'() then add'+ (!isOnce? '' : 'Once') +'() the same listener without removing the relationship first.');"," }"," } else {"," binding = new SignalBinding(this, listener, isOnce, scope);"," this._bindings.push(binding);"," }"," "," return binding;"," },"," "," /**"," * @param {Function} listener"," * @return {number}"," * @private"," */"," _indexOfListener : function(listener){"," var n = this._bindings.length;"," while(n--){"," if(this._bindings[n]._listener === listener){"," return n;"," }"," }"," return -1;"," },"," "," /**"," * Add a listener to the signal."," * @param {Function} listener Signal handler function."," * @param {Object} [scope] Context on which listener will be executed (object that should represent the `this` variable inside listener function)."," * @return {SignalBinding} An Object representing the binding between the Signal and listener."," */"," add : function(listener, scope){"," return this._registerListener(listener, false, scope);"," },"," "," /**"," * Add listener to the signal that should be removed after first execution (will be executed only once)."," * @param {Function} listener Signal handler function."," * @param {Object} [scope] Context on which listener will be executed (object that should represent the `this` variable inside listener function)."," * @return {SignalBinding} An Object representing the binding between the Signal and listener."," */"," addOnce : function(listener, scope){"," return this._registerListener(listener, true, scope);"," },"," "," /**"," * Remove a single listener from the dispatch queue."," * @param {Function} listener Handler function that should be removed."," * @return {Function} Listener handler function."," */"," remove : function(listener){"," if(typeof listener !== 'function'){"," throw new Error('listener is a required param of remove() and should be a Function.');"," }"," "," var i = this._indexOfListener(listener);"," 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);"," }"," return listener;"," },"," "," /**"," * Remove all listeners from the Signal."," */"," removeAll : function(){"," var n = this._bindings.length;"," while(n--){"," this._bindings[n]._destroy();"," }"," this._bindings.length = 0;"," },"," "," /**"," * @return {number} Number of listeners attached to the Signal."," */"," getNumListeners : function(){"," return this._bindings.length;"," },"," "," /**"," * Disable Signal. Block dispatch to listeners until `enable()` is called."," * <p><strong>IMPORTANT:</strong> If this method is called during a dispatch it will only have effect on the next dispatch, if you want to stop the propagation of a signal use `halt()` instead.</p>"," * @see signals.Signal.prototype.enable"," * @see signals.Signal.prototype.halt"," */"," disable : function(){"," this._isEnabled = false;"," },"," "," /**"," * Enable broadcast to listeners."," * @see signals.Signal.prototype.disable"," */"," enable : function(){"," this._isEnabled = true;"," }, "," "," /**"," * @return {boolean} If Signal is currently enabled and will broadcast message to listeners."," */"," isEnabled : function(){"," return this._isEnabled;"," },"," "," /**"," * Stop propagation of the event, blocking the dispatch to next listeners on the queue."," * <p><strong>IMPORTANT:</strong> should be called only during signal dispatch, calling it before/after dispatch won't affect signal broadcast.</p>"," * @see signals.Signal.prototype.disable "," */"," halt : function(){"," this._shouldPropagate = false;"," },"," "," /**"," * Dispatch/Broadcast Signal to all listeners added to the queue. "," * @param {...*} [params] Parameters that should be passed to each handler."," */"," dispatch : function(params){"," if(! this._isEnabled){"," return;"," }"," "," var paramsArr = Array.prototype.slice.call(arguments),"," bindings = this._bindings.slice(), //clone array in case add/remove items during dispatch"," i,"," n = this._bindings.length;"," "," this._shouldPropagate = true; //in case `halt` was called before dispatch or during the previous dispatch."," "," for(i=0; i<n; i++){"," //execute all callbacks until end of the list or until a callback returns `false` or stops propagation"," if(bindings[i].execute(paramsArr) === false || !this._shouldPropagate){"," break;"," }"," }"," },"," "," /**"," * Remove all bindings from signal and destroy any reference to external objects (destroy Signal object)."," * <p><strong>IMPORTANT:</strong> calling any method on the signal instance after calling dispose will throw errors.</p>"," */"," dispose : function(){"," this.removeAll();"," delete this._bindings;"," },"," "," /**"," * @return {string} String representation of the object."," */"," toString : function(){"," return '[Signal isEnabled: '+ this._isEnabled +' numListeners: '+ this.getNumListeners() +']';"," }"," "," };",""," return signals;"," ","}());"];
+/*jslint onevar:true, undef:true, newcap:true, regexp:true, bitwise:true, maxerr:50, indent:4, white:false, nomen:false, plusplus:false */
+
+/*!!
+ * JS Signals <http://millermedeiros.github.com/js-signals/>
+ * Released under the MIT license <http://www.opensource.org/licenses/mit-license.php>
+ * @author Miller Medeiros <http://millermedeiros.com/>
+ * @version 0.5.2
+ * @build 138 (02/18/2011 07:22 PM)
+ */
+_yuitest_coverage["C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js"].lines = {"10":0,"16":0,"23":0,"41":0,"48":0,"55":0,"63":0,"70":0,"73":0,"88":0,"89":0,"90":0,"91":0,"92":0,"95":0,"104":0,"111":0,"119":0,"120":0,"128":0,"129":0,"130":0,"131":0,"139":0,"147":0,"154":0,"161":0,"168":0,"182":0,"187":0,"190":0,"213":0,"214":0,"217":0,"220":0,"221":0,"222":0,"223":0,"226":0,"227":0,"230":0,"239":0,"240":0,"241":0,"242":0,"245":0,"255":0,"265":0,"274":0,"275":0,"278":0,"279":0,"280":0,"281":0,"283":0,"290":0,"291":0,"292":0,"294":0,"301":0,"311":0,"319":0,"326":0,"335":0,"343":0,"344":0,"347":0,"352":0,"354":0,"356":0,"357":0,"367":0,"368":0,"375":0,"380":0};
+_yuitest_coverage["C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js"].functions = {"SignalBinding:41":0,"execute:87":0,"detach:103":0,"getListener:110":0,"dispose:118":0,"_destroy:127":0,"disable:138":0,"enable:146":0,"isEnabled:153":0,"isOnce:160":0,"toString:167":0,"Signal:182":0,"_registerListener:211":0,"_indexOfListener:238":0,"add:254":0,"addOnce:264":0,"remove:273":0,"removeAll:289":0,"getNumListeners:300":0,"disable:310":0,"enable:318":0,"isEnabled:325":0,"halt:334":0,"dispatch:342":0,"dispose:366":0,"toString:374":0,"(anonymous 1):10":0};
+_yuitest_coverage["C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js"].coveredLines = 75;
+_yuitest_coverage["C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js"].coveredFunctions = 27;
+_yuitest_coverline("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", 10); var signals = (function(){
+
+ /**
+ * @namespace Signals Namespace - Custom event/messaging system based on AS3 Signals
+ * @name signals
+ */
+ _yuitest_coverfunc("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", "(anonymous 1)", 10);
+_yuitest_coverline("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", 16); var signals = {};
+
+ /**
+ * Signals Version Number
+ * @type string
+ * @const
+ */
+ _yuitest_coverline("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", 23); signals.VERSION = '0.5.2';
+
+
+ // SignalBinding -------------------------------------------------
+ //================================================================
+
+ /**
+ * Object that represents a binding between a Signal and a listener function.
+ * <br />- <strong>This is an internall constructor and shouldn't be called by regular user.</strong>
+ * <br />- inspired by Joa Ebert AS3 SignalBinding and Robert Penner's Slot classes.
+ * @author Miller Medeiros
+ * @constructor
+ * @name signals.SignalBinding
+ * @param {signals.Signal} signal Reference to Signal object that listener is currently bound to.
+ * @param {Function} listener Handler function bound to the signal.
+ * @param {boolean} isOnce If binding should be executed just once.
+ * @param {Object} [listenerContext] Context on which listener will be executed (object that should represent the `this` variable inside listener function).
+ */
+ _yuitest_coverline("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", 41); function SignalBinding(signal, listener, isOnce, listenerContext){
+
+ /**
+ * Handler function bound to the signal.
+ * @type Function
+ * @private
+ */
+ _yuitest_coverfunc("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", "SignalBinding", 41);
+_yuitest_coverline("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", 48); this._listener = listener;
+
+ /**
+ * If binding should be executed just once.
+ * @type boolean
+ * @private
+ */
+ _yuitest_coverline("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", 55); this._isOnce = isOnce;
+
+ /**
+ * Context on which listener will be executed (object that should represent the `this` variable inside listener function).
+ * @memberOf signals.SignalBinding.prototype
+ * @name context
+ * @type {Object|undefined}
+ */
+ _yuitest_coverline("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", 63); this.context = listenerContext;
+
+ /**
+ * Reference to Signal object that listener is currently bound to.
+ * @type signals.Signal
+ * @private
+ */
+ _yuitest_coverline("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", 70); this._signal = signal;
+ }
+
+ _yuitest_coverline("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", 73); SignalBinding.prototype = /** @lends signals.SignalBinding.prototype */ {
+
+ /**
+ * @type boolean
+ * @private
+ */
+ _isEnabled : true,
+
+ /**
+ * Call listener passing arbitrary parameters.
+ * <p>If binding was added using `Signal.addOnce()` it will be automatically removed from signal dispatch queue, this method is used internally for the signal dispatch.</p>
+ * @param {Array} [paramsArr] Array of parameters that should be passed to the listener
+ * @return {*} Value returned by the listener.
+ */
+ execute : function(paramsArr){
+ _yuitest_coverfunc("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", "execute", 87);
+_yuitest_coverline("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", 88); var r;
+ _yuitest_coverline("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", 89); if(this._isEnabled){
+ _yuitest_coverline("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", 90); r = this._listener.apply(this.context, paramsArr);
+ _yuitest_coverline("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", 91); if(this._isOnce){
+ _yuitest_coverline("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", 92); this.detach();
+ }
+ }
+ _yuitest_coverline("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", 95); return r; //avoid warnings on some editors
+ },
+
+ /**
+ * Detach binding from signal.
+ * - alias to: mySignal.remove(myBinding.getListener());
+ * @return {Function} Handler function bound to the signal.
+ */
+ detach : function(){
+ _yuitest_coverfunc("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", "detach", 103);
+_yuitest_coverline("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", 104); return this._signal.remove(this._listener);
+ },
+
+ /**
+ * @return {Function} Handler function bound to the signal.
+ */
+ getListener : function(){
+ _yuitest_coverfunc("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", "getListener", 110);
+_yuitest_coverline("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", 111); return this._listener;
+ },
+
+ /**
+ * Remove binding from signal and destroy any reference to external Objects (destroy SignalBinding object).
+ * <p><strong>IMPORTANT:</strong> calling methods on the binding instance after calling dispose will throw errors.</p>
+ */
+ dispose : function(){
+ _yuitest_coverfunc("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", "dispose", 118);
+_yuitest_coverline("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", 119); this.detach();
+ _yuitest_coverline("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", 120); this._destroy();
+ },
+
+ /**
+ * Delete all instance properties
+ * @private
+ */
+ _destroy : function(){
+ _yuitest_coverfunc("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", "_destroy", 127);
+_yuitest_coverline("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", 128); delete this._signal;
+ _yuitest_coverline("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", 129); delete this._isOnce;
+ _yuitest_coverline("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", 130); delete this._listener;
+ _yuitest_coverline("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", 131); delete this.context;
+ },
+
+ /**
+ * Disable SignalBinding, block listener execution. Listener will only be executed after calling `enable()`.
+ * @see signals.SignalBinding.enable()
+ */
+ disable : function(){
+ _yuitest_coverfunc("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", "disable", 138);
+_yuitest_coverline("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", 139); this._isEnabled = false;
+ },
+
+ /**
+ * Enable SignalBinding. Enable listener execution.
+ * @see signals.SignalBinding.disable()
+ */
+ enable : function(){
+ _yuitest_coverfunc("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", "enable", 146);
+_yuitest_coverline("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", 147); this._isEnabled = true;
+ },
+
+ /**
+ * @return {boolean} If SignalBinding is currently paused and won't execute listener during dispatch.
+ */
+ isEnabled : function(){
+ _yuitest_coverfunc("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", "isEnabled", 153);
+_yuitest_coverline("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", 154); return this._isEnabled;
+ },
+
+ /**
+ * @return {boolean} If SignalBinding will only be executed once.
+ */
+ isOnce : function(){
+ _yuitest_coverfunc("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", "isOnce", 160);
+_yuitest_coverline("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", 161); return this._isOnce;
+ },
+
+ /**
+ * @return {string} String representation of the object.
+ */
+ toString : function(){
+ _yuitest_coverfunc("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", "toString", 167);
+_yuitest_coverline("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", 168); return '[SignalBinding isOnce: '+ this._isOnce +', isEnabled: '+ this._isEnabled +']';
+ }
+
+ };
+
+ // Signal --------------------------------------------------------
+ //================================================================
+
+ /**
+ * Custom event broadcaster
+ * <br />- inspired by Robert Penner's AS3 Signals.
+ * @author Miller Medeiros
+ * @constructor
+ */
+ _yuitest_coverline("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", 182); signals.Signal = function(){
+ /**
+ * @type Array.<SignalBinding>
+ * @private
+ */
+ _yuitest_coverfunc("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", "Signal", 182);
+_yuitest_coverline("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", 187); this._bindings = [];
+ };
+
+ _yuitest_coverline("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", 190); signals.Signal.prototype = {
+
+ /**
+ * @type boolean
+ * @private
+ */
+ _shouldPropagate : true,
+
+ /**
+ * @type boolean
+ * @private
+ */
+ _isEnabled : true,
+
+ /**
+ * @param {Function} listener
+ * @param {boolean} isOnce
+ * @param {Object} [scope]
+ * @return {SignalBinding}
+ * @private
+ */
+ _registerListener : function(listener, isOnce, scope){
+
+ _yuitest_coverfunc("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", "_registerListener", 211);
+_yuitest_coverline("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", 213); if(typeof listener !== 'function'){
+ _yuitest_coverline("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", 214); throw new Error('listener is a required param of add() and addOnce() and should be a Function.');
+ }
+
+ _yuitest_coverline("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", 217); var prevIndex = this._indexOfListener(listener),
+ binding;
+
+ _yuitest_coverline("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", 220); if(prevIndex !== -1){ //avoid creating a new Binding for same listener if already added to list
+ _yuitest_coverline("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", 221); binding = this._bindings[prevIndex];
+ _yuitest_coverline("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", 222); if(binding.isOnce() !== isOnce){
+ _yuitest_coverline("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", 223); throw new Error('You cannot add'+ (isOnce? '' : 'Once') +'() then add'+ (!isOnce? '' : 'Once') +'() the same listener without removing the relationship first.');
+ }
+ } else {
+ _yuitest_coverline("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", 226); binding = new SignalBinding(this, listener, isOnce, scope);
+ _yuitest_coverline("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", 227); this._bindings.push(binding);
+ }
+
+ _yuitest_coverline("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", 230); return binding;
+ },
+
+ /**
+ * @param {Function} listener
+ * @return {number}
+ * @private
+ */
+ _indexOfListener : function(listener){
+ _yuitest_coverfunc("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", "_indexOfListener", 238);
+_yuitest_coverline("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", 239); var n = this._bindings.length;
+ _yuitest_coverline("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", 240); while(n--){
+ _yuitest_coverline("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", 241); if(this._bindings[n]._listener === listener){
+ _yuitest_coverline("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", 242); return n;
+ }
+ }
+ _yuitest_coverline("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", 245); return -1;
+ },
+
+ /**
+ * Add a listener to the signal.
+ * @param {Function} listener Signal handler function.
+ * @param {Object} [scope] Context on which listener will be executed (object that should represent the `this` variable inside listener function).
+ * @return {SignalBinding} An Object representing the binding between the Signal and listener.
+ */
+ add : function(listener, scope){
+ _yuitest_coverfunc("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", "add", 254);
+_yuitest_coverline("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", 255); return this._registerListener(listener, false, scope);
+ },
+
+ /**
+ * Add listener to the signal that should be removed after first execution (will be executed only once).
+ * @param {Function} listener Signal handler function.
+ * @param {Object} [scope] Context on which listener will be executed (object that should represent the `this` variable inside listener function).
+ * @return {SignalBinding} An Object representing the binding between the Signal and listener.
+ */
+ addOnce : function(listener, scope){
+ _yuitest_coverfunc("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", "addOnce", 264);
+_yuitest_coverline("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", 265); return this._registerListener(listener, true, scope);
+ },
+
+ /**
+ * Remove a single listener from the dispatch queue.
+ * @param {Function} listener Handler function that should be removed.
+ * @return {Function} Listener handler function.
+ */
+ remove : function(listener){
+ _yuitest_coverfunc("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", "remove", 273);
+_yuitest_coverline("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", 274); if(typeof listener !== 'function'){
+ _yuitest_coverline("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", 275); throw new Error('listener is a required param of remove() and should be a Function.');
+ }
+
+ _yuitest_coverline("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", 278); var i = this._indexOfListener(listener);
+ _yuitest_coverline("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", 279); if(i !== -1){
+ _yuitest_coverline("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", 280); this._bindings[i]._destroy(); //no reason to a SignalBinding exist if it isn't attached to a signal
+ _yuitest_coverline("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", 281); this._bindings.splice(i, 1);
+ }
+ _yuitest_coverline("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", 283); return listener;
+ },
+
+ /**
+ * Remove all listeners from the Signal.
+ */
+ removeAll : function(){
+ _yuitest_coverfunc("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", "removeAll", 289);
+_yuitest_coverline("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", 290); var n = this._bindings.length;
+ _yuitest_coverline("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", 291); while(n--){
+ _yuitest_coverline("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", 292); this._bindings[n]._destroy();
+ }
+ _yuitest_coverline("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", 294); this._bindings.length = 0;
+ },
+
+ /**
+ * @return {number} Number of listeners attached to the Signal.
+ */
+ getNumListeners : function(){
+ _yuitest_coverfunc("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", "getNumListeners", 300);
+_yuitest_coverline("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", 301); return this._bindings.length;
+ },
+
+ /**
+ * Disable Signal. Block dispatch to listeners until `enable()` is called.
+ * <p><strong>IMPORTANT:</strong> If this method is called during a dispatch it will only have effect on the next dispatch, if you want to stop the propagation of a signal use `halt()` instead.</p>
+ * @see signals.Signal.prototype.enable
+ * @see signals.Signal.prototype.halt
+ */
+ disable : function(){
+ _yuitest_coverfunc("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", "disable", 310);
+_yuitest_coverline("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", 311); this._isEnabled = false;
+ },
+
+ /**
+ * Enable broadcast to listeners.
+ * @see signals.Signal.prototype.disable
+ */
+ enable : function(){
+ _yuitest_coverfunc("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", "enable", 318);
+_yuitest_coverline("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", 319); this._isEnabled = true;
+ },
+
+ /**
+ * @return {boolean} If Signal is currently enabled and will broadcast message to listeners.
+ */
+ isEnabled : function(){
+ _yuitest_coverfunc("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", "isEnabled", 325);
+_yuitest_coverline("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", 326); return this._isEnabled;
+ },
+
+ /**
+ * Stop propagation of the event, blocking the dispatch to next listeners on the queue.
+ * <p><strong>IMPORTANT:</strong> should be called only during signal dispatch, calling it before/after dispatch won't affect signal broadcast.</p>
+ * @see signals.Signal.prototype.disable
+ */
+ halt : function(){
+ _yuitest_coverfunc("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", "halt", 334);
+_yuitest_coverline("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", 335); this._shouldPropagate = false;
+ },
+
+ /**
+ * Dispatch/Broadcast Signal to all listeners added to the queue.
+ * @param {...*} [params] Parameters that should be passed to each handler.
+ */
+ dispatch : function(params){
+ _yuitest_coverfunc("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", "dispatch", 342);
+_yuitest_coverline("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", 343); if(! this._isEnabled){
+ _yuitest_coverline("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", 344); return;
+ }
+
+ _yuitest_coverline("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", 347); var paramsArr = Array.prototype.slice.call(arguments),
+ bindings = this._bindings.slice(), //clone array in case add/remove items during dispatch
+ i,
+ n = this._bindings.length;
+
+ _yuitest_coverline("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", 352); this._shouldPropagate = true; //in case `halt` was called before dispatch or during the previous dispatch.
+
+ _yuitest_coverline("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", 354); for(i=0; i<n; i++){
+ //execute all callbacks until end of the list or until a callback returns `false` or stops propagation
+ _yuitest_coverline("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", 356); if(bindings[i].execute(paramsArr) === false || !this._shouldPropagate){
+ _yuitest_coverline("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", 357); break;
+ }
+ }
+ },
+
+ /**
+ * Remove all bindings from signal and destroy any reference to external objects (destroy Signal object).
+ * <p><strong>IMPORTANT:</strong> calling any method on the signal instance after calling dispose will throw errors.</p>
+ */
+ dispose : function(){
+ _yuitest_coverfunc("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", "dispose", 366);
+_yuitest_coverline("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", 367); this.removeAll();
+ _yuitest_coverline("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", 368); delete this._bindings;
+ },
+
+ /**
+ * @return {string} String representation of the object.
+ */
+ toString : function(){
+ _yuitest_coverfunc("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", "toString", 374);
+_yuitest_coverline("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", 375); return '[Signal isEnabled: '+ this._isEnabled +' numListeners: '+ this.getNumListeners() +']';
+ }
+
+ };
+
+ _yuitest_coverline("C:\Miller\Personal\open_source_projects\js-signals\dist\js-signals.js", 380); return signals;
+
+}());
View
915 dev/tests/coverage/report/C_MillerPersonalopen_source_projectsjs_signalsdistjs_signals.js.html
@@ -0,0 +1,915 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+<html lang="en-US">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <title>C:MillerPersonalopen_source_projectsjs-signalsdistjs-signals.js Report</title>
+ <style type="text/css">
+/*
+Copyright (c) 2009, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 3.0.0
+build: 1549
+*/
+html{color:#000;background:#FFF;}body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td{margin:0;padding:0;}table{border-collapse:collapse;border-spacing:0;}fieldset,img{border:0;}address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal;}li{list-style:none;}caption,th{text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}q:before,q:after{content:'';}abbr,acronym{border:0;font-variant:normal;}sup{vertical-align:text-top;}sub{vertical-align:text-bottom;}input,textarea,select{font-family:inherit;font-size:inherit;font-weight:inherit;}input,textarea,select{*font-size:100%;}legend{color:#000;}
+body{font:13px/1.231 arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small;}select,input,button,textarea{font:99% arial,helvetica,clean,sans-serif;}table{font-size:inherit;font:100%;}pre,code,kbd,samp,tt{font-family:monospace;*font-size:108%;line-height:100%;}
+h1{font-size:138.5%;}h2{font-size:123.1%;}h3{font-size:108%;}h1,h2,h3{margin:1em 0;}h1,h2,h3,h4,h5,h6,strong{font-weight:bold;}
+ </style>
+ <style type="text/css">
+
+ .page {
+ width: 63em;
+ margin: 0 auto;
+ }
+
+ .page .ft {
+ font-size: 85%;
+ margin-bottom: 1.5em;
+ padding-top: 0.3em;
+ border-top: 1px solid #d8d8d8;
+ }
+
+ .file-summary {
+ background: #f0f0f0;
+ border: 1px solid #d8d8d8;
+ margin-bottom: 1em;
+ }
+
+ .file-summary .category {
+ width: 10em;
+ border-right: 1px solid #d8d8d8;
+ }
+
+ .file-summary .results {
+ width: 4em;
+ text-align: center;
+ }
+
+ .file-summary td,
+ .file-summary th {
+ padding: 0.2em;
+ }
+
+ .file-summary td {
+ text-align: right;
+ }
+
+ .file-summary thead th {
+ font-weight: bold;
+ border-bottom: 1px solid #d8d8d8;
+ }
+
+ .source-code-sec {
+ overflow: auto;
+ border: 1px solid #d8d8d8;
+ margin-bottom: 1em;
+ }
+
+ .source-code {
+ width: 100%;
+ font-family: monospace;
+ }
+
+ .source-code .line-number {
+ text-align: right;
+ background: #f0f0f0;
+ border-right: 1px solid #d8d8d8;
+ width: 3em;
+ padding: 0 0.2em;
+ }
+
+ .source-code .line-calls {
+ text-align: right;
+ border-right: 1px solid #d8d8d8;
+ width: 3em;
+ padding: 0 0.2em;
+ }
+
+ .source-code .not-called {
+ background: #f99;
+ }
+
+ .source-code .called {
+ background: #9f9;
+ }
+ </style>
+</head>
+<body>
+ <div class="page">
+
+ <div class="hd">
+ <!-- title -->
+ <h1>C:MillerPersonalopen_source_projectsjs-signalsdistjs-signals.js Report</h1>
+ <h2>Date Generated: Fri Feb 18 19:26:40 EST 2011</h2>
+ </div>
+
+ <div class="bd">
+
+ <!-- summary table -->
+ <table class="file-summary">
+ <col class="category"></col>
+ <thead>
+ <tr>
+ <th>Category</th>
+ <th class="results">Called</th>
+ <th class="results">Total</th>
+ <th class="results">Coverage</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <th>Lines</th>
+ <td class="results">73</td>
+ <td class="results">75</td>
+ <td class="results">97.33%</td>
+ </tr>
+ <tr>
+ <th>Functions</th>
+ <td class="results">25</td>
+ <td class="results">27</td>
+ <td class="results">92.59%</td>
+ </tr>
+ </tbody>
+ </table>
+
+ <!-- source code --->
+ <div class="source-code-sec">
+ <table class="source-code">
+ <tr class="uncovered">
+ <td class="line-number">1</td><td class="line-calls">&nbsp;</td><td class="line-code">/*jslint&nbsp;onevar:true,&nbsp;undef:true,&nbsp;newcap:true,&nbsp;regexp:true,&nbsp;bitwise:true,&nbsp;maxerr:50,&nbsp;indent:4,&nbsp;white:false,&nbsp;nomen:false,&nbsp;plusplus:false&nbsp;*/</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">2</td><td class="line-calls">&nbsp;</td><td class="line-code"></td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">3</td><td class="line-calls">&nbsp;</td><td class="line-code">/*!!</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">4</td><td class="line-calls">&nbsp;</td><td class="line-code">&nbsp;*&nbsp;JS&nbsp;Signals&nbsp;&lt;http://millermedeiros.github.com/js-signals/&gt;</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">5</td><td class="line-calls">&nbsp;</td><td class="line-code">&nbsp;*&nbsp;Released&nbsp;under&nbsp;the&nbsp;MIT&nbsp;license&nbsp;&lt;http://www.opensource.org/licenses/mit-license.php&gt;</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">6</td><td class="line-calls">&nbsp;</td><td class="line-code">&nbsp;*&nbsp;@author&nbsp;Miller&nbsp;Medeiros&nbsp;&lt;http://millermedeiros.com/&gt;</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">7</td><td class="line-calls">&nbsp;</td><td class="line-code">&nbsp;*&nbsp;@version&nbsp;0.5.2</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">8</td><td class="line-calls">&nbsp;</td><td class="line-code">&nbsp;*&nbsp;@build&nbsp;138&nbsp;(02/18/2011&nbsp;07:22&nbsp;PM)</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">9</td><td class="line-calls">&nbsp;</td><td class="line-code">&nbsp;*/</td>
+ </tr> <tr class="called">
+ <td class="line-number">10</td><td class="line-calls">1</td><td class="line-code">var&nbsp;signals&nbsp;=&nbsp;(function(){</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">11</td><td class="line-calls">&nbsp;</td><td class="line-code"></td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">12</td><td class="line-calls">&nbsp;</td><td class="line-code"> /**</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">13</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;@namespace&nbsp;Signals&nbsp;Namespace&nbsp;-&nbsp;Custom&nbsp;event/messaging&nbsp;system&nbsp;based&nbsp;on&nbsp;AS3&nbsp;Signals</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">14</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;@name&nbsp;signals</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">15</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*/</td>
+ </tr> <tr class="called">
+ <td class="line-number">16</td><td class="line-calls">1</td><td class="line-code"> var&nbsp;signals&nbsp;=&nbsp;{};</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">17</td><td class="line-calls">&nbsp;</td><td class="line-code"></td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">18</td><td class="line-calls">&nbsp;</td><td class="line-code"> /**</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">19</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;Signals&nbsp;Version&nbsp;Number</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">20</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;@type&nbsp;string</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">21</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;@const</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">22</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*/</td>
+ </tr> <tr class="called">
+ <td class="line-number">23</td><td class="line-calls">1</td><td class="line-code"> signals.VERSION&nbsp;=&nbsp;'0.5.2';</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">24</td><td class="line-calls">&nbsp;</td><td class="line-code"></td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">25</td><td class="line-calls">&nbsp;</td><td class="line-code"> </td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">26</td><td class="line-calls">&nbsp;</td><td class="line-code"> //&nbsp;SignalBinding&nbsp;-------------------------------------------------</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">27</td><td class="line-calls">&nbsp;</td><td class="line-code"> //================================================================</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">28</td><td class="line-calls">&nbsp;</td><td class="line-code"> </td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">29</td><td class="line-calls">&nbsp;</td><td class="line-code"> /**</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">30</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;Object&nbsp;that&nbsp;represents&nbsp;a&nbsp;binding&nbsp;between&nbsp;a&nbsp;Signal&nbsp;and&nbsp;a&nbsp;listener&nbsp;function.</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">31</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;&lt;br&nbsp;/&gt;-&nbsp;&lt;strong&gt;This&nbsp;is&nbsp;an&nbsp;internall&nbsp;constructor&nbsp;and&nbsp;shouldn't&nbsp;be&nbsp;called&nbsp;by&nbsp;regular&nbsp;user.&lt;/strong&gt;</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">32</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;&lt;br&nbsp;/&gt;-&nbsp;inspired&nbsp;by&nbsp;Joa&nbsp;Ebert&nbsp;AS3&nbsp;SignalBinding&nbsp;and&nbsp;Robert&nbsp;Penner's&nbsp;Slot&nbsp;classes.</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">33</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;@author&nbsp;Miller&nbsp;Medeiros</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">34</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;@constructor</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">35</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;@name&nbsp;signals.SignalBinding</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">36</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;@param&nbsp;{signals.Signal}&nbsp;signal Reference&nbsp;to&nbsp;Signal&nbsp;object&nbsp;that&nbsp;listener&nbsp;is&nbsp;currently&nbsp;bound&nbsp;to.</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">37</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;@param&nbsp;{Function}&nbsp;listener Handler&nbsp;function&nbsp;bound&nbsp;to&nbsp;the&nbsp;signal.</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">38</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;@param&nbsp;{boolean}&nbsp;isOnce If&nbsp;binding&nbsp;should&nbsp;be&nbsp;executed&nbsp;just&nbsp;once.</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">39</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;@param&nbsp;{Object}&nbsp;[listenerContext] Context&nbsp;on&nbsp;which&nbsp;listener&nbsp;will&nbsp;be&nbsp;executed&nbsp;(object&nbsp;that&nbsp;should&nbsp;represent&nbsp;the&nbsp;`this`&nbsp;variable&nbsp;inside&nbsp;listener&nbsp;function).</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">40</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*/</td>
+ </tr> <tr class="called">
+ <td class="line-number">41</td><td class="line-calls">1</td><td class="line-code"> &nbsp;function&nbsp;SignalBinding(signal,&nbsp;listener,&nbsp;isOnce,&nbsp;listenerContext){</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">42</td><td class="line-calls">&nbsp;</td><td class="line-code"> </td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">43</td><td class="line-calls">&nbsp;</td><td class="line-code"> /**</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">44</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;Handler&nbsp;function&nbsp;bound&nbsp;to&nbsp;the&nbsp;signal.</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">45</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;@type&nbsp;Function</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">46</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;@private</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">47</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*/</td>
+ </tr> <tr class="called">
+ <td class="line-number">48</td><td class="line-calls">118</td><td class="line-code"> this._listener&nbsp;=&nbsp;listener;</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">49</td><td class="line-calls">&nbsp;</td><td class="line-code"> </td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">50</td><td class="line-calls">&nbsp;</td><td class="line-code"> /**</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">51</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;If&nbsp;binding&nbsp;should&nbsp;be&nbsp;executed&nbsp;just&nbsp;once.</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">52</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;@type&nbsp;boolean</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">53</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;@private</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">54</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*/</td>
+ </tr> <tr class="called">
+ <td class="line-number">55</td><td class="line-calls">118</td><td class="line-code"> this._isOnce&nbsp;=&nbsp;isOnce;</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">56</td><td class="line-calls">&nbsp;</td><td class="line-code"> </td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">57</td><td class="line-calls">&nbsp;</td><td class="line-code"> /**</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">58</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;Context&nbsp;on&nbsp;which&nbsp;listener&nbsp;will&nbsp;be&nbsp;executed&nbsp;(object&nbsp;that&nbsp;should&nbsp;represent&nbsp;the&nbsp;`this`&nbsp;variable&nbsp;inside&nbsp;listener&nbsp;function).</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">59</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;@memberOf&nbsp;signals.SignalBinding.prototype</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">60</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;@name&nbsp;context</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">61</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;@type&nbsp;{Object|undefined}</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">62</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*/</td>
+ </tr> <tr class="called">
+ <td class="line-number">63</td><td class="line-calls">118</td><td class="line-code"> this.context&nbsp;=&nbsp;listenerContext;</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">64</td><td class="line-calls">&nbsp;</td><td class="line-code"> </td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">65</td><td class="line-calls">&nbsp;</td><td class="line-code"> /**</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">66</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;Reference&nbsp;to&nbsp;Signal&nbsp;object&nbsp;that&nbsp;listener&nbsp;is&nbsp;currently&nbsp;bound&nbsp;to.</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">67</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;@type&nbsp;signals.Signal</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">68</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;@private</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">69</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*/</td>
+ </tr> <tr class="called">
+ <td class="line-number">70</td><td class="line-calls">118</td><td class="line-code"> this._signal&nbsp;=&nbsp;signal;</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">71</td><td class="line-calls">&nbsp;</td><td class="line-code"> }</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">72</td><td class="line-calls">&nbsp;</td><td class="line-code"> </td>
+ </tr> <tr class="called">
+ <td class="line-number">73</td><td class="line-calls">1</td><td class="line-code"> SignalBinding.prototype&nbsp;=&nbsp;/**&nbsp;@lends&nbsp;signals.SignalBinding.prototype&nbsp;*/&nbsp;{</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">74</td><td class="line-calls">&nbsp;</td><td class="line-code"> </td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">75</td><td class="line-calls">&nbsp;</td><td class="line-code"> /**</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">76</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;@type&nbsp;boolean</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">77</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;@private</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">78</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*/</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">79</td><td class="line-calls">&nbsp;</td><td class="line-code"> _isEnabled&nbsp;:&nbsp;true,</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">80</td><td class="line-calls">&nbsp;</td><td class="line-code"> </td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">81</td><td class="line-calls">&nbsp;</td><td class="line-code"> /**</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">82</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;Call&nbsp;listener&nbsp;passing&nbsp;arbitrary&nbsp;parameters.</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">83</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;&lt;p&gt;If&nbsp;binding&nbsp;was&nbsp;added&nbsp;using&nbsp;`Signal.addOnce()`&nbsp;it&nbsp;will&nbsp;be&nbsp;automatically&nbsp;removed&nbsp;from&nbsp;signal&nbsp;dispatch&nbsp;queue,&nbsp;this&nbsp;method&nbsp;is&nbsp;used&nbsp;internally&nbsp;for&nbsp;the&nbsp;signal&nbsp;dispatch.&lt;/p&gt;&nbsp;</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">84</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;@param&nbsp;{Array}&nbsp;[paramsArr] Array&nbsp;of&nbsp;parameters&nbsp;that&nbsp;should&nbsp;be&nbsp;passed&nbsp;to&nbsp;the&nbsp;listener</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">85</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;@return&nbsp;{*}&nbsp;Value&nbsp;returned&nbsp;by&nbsp;the&nbsp;listener.</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">86</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*/</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">87</td><td class="line-calls">&nbsp;</td><td class="line-code"> execute&nbsp;:&nbsp;function(paramsArr){</td>
+ </tr> <tr class="called">
+ <td class="line-number">88</td><td class="line-calls">83</td><td class="line-code"> var&nbsp;r;</td>
+ </tr> <tr class="called">
+ <td class="line-number">89</td><td class="line-calls">83</td><td class="line-code"> if(this._isEnabled){</td>
+ </tr> <tr class="called">
+ <td class="line-number">90</td><td class="line-calls">82</td><td class="line-code"> r&nbsp;=&nbsp;this._listener.apply(this.context,&nbsp;paramsArr);</td>
+ </tr> <tr class="called">
+ <td class="line-number">91</td><td class="line-calls">82</td><td class="line-code"> if(this._isOnce){</td>
+ </tr> <tr class="called">
+ <td class="line-number">92</td><td class="line-calls">23</td><td class="line-code"> this.detach();</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">93</td><td class="line-calls">&nbsp;</td><td class="line-code"> }</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">94</td><td class="line-calls">&nbsp;</td><td class="line-code"> }</td>
+ </tr> <tr class="called">
+ <td class="line-number">95</td><td class="line-calls">83</td><td class="line-code"> return&nbsp;r;&nbsp;//avoid&nbsp;warnings&nbsp;on&nbsp;some&nbsp;editors</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">96</td><td class="line-calls">&nbsp;</td><td class="line-code"> },</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">97</td><td class="line-calls">&nbsp;</td><td class="line-code"> </td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">98</td><td class="line-calls">&nbsp;</td><td class="line-code"> /**</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">99</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;Detach&nbsp;binding&nbsp;from&nbsp;signal.</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">100</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;-&nbsp;alias&nbsp;to:&nbsp;mySignal.remove(myBinding.getListener());</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">101</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;@return&nbsp;{Function}&nbsp;Handler&nbsp;function&nbsp;bound&nbsp;to&nbsp;the&nbsp;signal.</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">102</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*/</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">103</td><td class="line-calls">&nbsp;</td><td class="line-code"> detach&nbsp;:&nbsp;function(){</td>
+ </tr> <tr class="called">
+ <td class="line-number">104</td><td class="line-calls">25</td><td class="line-code"> return&nbsp;this._signal.remove(this._listener);</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">105</td><td class="line-calls">&nbsp;</td><td class="line-code"> },</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">106</td><td class="line-calls">&nbsp;</td><td class="line-code"> </td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">107</td><td class="line-calls">&nbsp;</td><td class="line-code"> /**</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">108</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;@return&nbsp;{Function}&nbsp;Handler&nbsp;function&nbsp;bound&nbsp;to&nbsp;the&nbsp;signal.</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">109</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*/</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">110</td><td class="line-calls">&nbsp;</td><td class="line-code"> getListener&nbsp;:&nbsp;function(){</td>
+ </tr> <tr class="called">
+ <td class="line-number">111</td><td class="line-calls">8</td><td class="line-code"> return&nbsp;this._listener;</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">112</td><td class="line-calls">&nbsp;</td><td class="line-code"> },</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">113</td><td class="line-calls">&nbsp;</td><td class="line-code"> </td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">114</td><td class="line-calls">&nbsp;</td><td class="line-code"> /**</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">115</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;Remove&nbsp;binding&nbsp;from&nbsp;signal&nbsp;and&nbsp;destroy&nbsp;any&nbsp;reference&nbsp;to&nbsp;external&nbsp;Objects&nbsp;(destroy&nbsp;SignalBinding&nbsp;object).</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">116</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;&lt;p&gt;&lt;strong&gt;IMPORTANT:&lt;/strong&gt;&nbsp;calling&nbsp;methods&nbsp;on&nbsp;the&nbsp;binding&nbsp;instance&nbsp;after&nbsp;calling&nbsp;dispose&nbsp;will&nbsp;throw&nbsp;errors.&lt;/p&gt;</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">117</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*/</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">118</td><td class="line-calls">&nbsp;</td><td class="line-code"> dispose&nbsp;:&nbsp;function(){</td>
+ </tr> <tr class="called">
+ <td class="line-number">119</td><td class="line-calls">1</td><td class="line-code"> this.detach();</td>
+ </tr> <tr class="called">
+ <td class="line-number">120</td><td class="line-calls">1</td><td class="line-code"> this._destroy();</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">121</td><td class="line-calls">&nbsp;</td><td class="line-code"> },</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">122</td><td class="line-calls">&nbsp;</td><td class="line-code"> </td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">123</td><td class="line-calls">&nbsp;</td><td class="line-code"> /**</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">124</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;Delete&nbsp;all&nbsp;instance&nbsp;properties</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">125</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;@private</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">126</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*/</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">127</td><td class="line-calls">&nbsp;</td><td class="line-code"> _destroy&nbsp;:&nbsp;function(){</td>
+ </tr> <tr class="called">
+ <td class="line-number">128</td><td class="line-calls">59</td><td class="line-code"> delete&nbsp;this._signal;</td>
+ </tr> <tr class="called">
+ <td class="line-number">129</td><td class="line-calls">59</td><td class="line-code"> delete&nbsp;this._isOnce;</td>
+ </tr> <tr class="called">
+ <td class="line-number">130</td><td class="line-calls">59</td><td class="line-code"> delete&nbsp;this._listener;</td>
+ </tr> <tr class="called">
+ <td class="line-number">131</td><td class="line-calls">59</td><td class="line-code"> delete&nbsp;this.context;</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">132</td><td class="line-calls">&nbsp;</td><td class="line-code"> },</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">133</td><td class="line-calls">&nbsp;</td><td class="line-code"> </td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">134</td><td class="line-calls">&nbsp;</td><td class="line-code"> /**</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">135</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;Disable&nbsp;SignalBinding,&nbsp;block&nbsp;listener&nbsp;execution.&nbsp;Listener&nbsp;will&nbsp;only&nbsp;be&nbsp;executed&nbsp;after&nbsp;calling&nbsp;`enable()`.&nbsp;&nbsp;</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">136</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;@see&nbsp;signals.SignalBinding.enable()</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">137</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*/</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">138</td><td class="line-calls">&nbsp;</td><td class="line-code"> disable&nbsp;:&nbsp;function(){</td>
+ </tr> <tr class="called">
+ <td class="line-number">139</td><td class="line-calls">1</td><td class="line-code"> this._isEnabled&nbsp;=&nbsp;false;</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">140</td><td class="line-calls">&nbsp;</td><td class="line-code"> },</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">141</td><td class="line-calls">&nbsp;</td><td class="line-code"> </td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">142</td><td class="line-calls">&nbsp;</td><td class="line-code"> /**</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">143</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;Enable&nbsp;SignalBinding.&nbsp;Enable&nbsp;listener&nbsp;execution.</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">144</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;@see&nbsp;signals.SignalBinding.disable()</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">145</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*/</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">146</td><td class="line-calls">&nbsp;</td><td class="line-code"> enable&nbsp;:&nbsp;function(){</td>
+ </tr> <tr class="called">
+ <td class="line-number">147</td><td class="line-calls">1</td><td class="line-code"> this._isEnabled&nbsp;=&nbsp;true;</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">148</td><td class="line-calls">&nbsp;</td><td class="line-code"> },</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">149</td><td class="line-calls">&nbsp;</td><td class="line-code"> </td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">150</td><td class="line-calls">&nbsp;</td><td class="line-code"> /**</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">151</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;@return&nbsp;{boolean}&nbsp;If&nbsp;SignalBinding&nbsp;is&nbsp;currently&nbsp;paused&nbsp;and&nbsp;won't&nbsp;execute&nbsp;listener&nbsp;during&nbsp;dispatch.</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">152</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*/</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">153</td><td class="line-calls">&nbsp;</td><td class="line-code"> isEnabled&nbsp;:&nbsp;function(){</td>
+ </tr> <tr class="called">
+ <td class="line-number">154</td><td class="line-calls">3</td><td class="line-code"> return&nbsp;this._isEnabled;</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">155</td><td class="line-calls">&nbsp;</td><td class="line-code"> },</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">156</td><td class="line-calls">&nbsp;</td><td class="line-code"> </td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">157</td><td class="line-calls">&nbsp;</td><td class="line-code"> /**</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">158</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;@return&nbsp;{boolean}&nbsp;If&nbsp;SignalBinding&nbsp;will&nbsp;only&nbsp;be&nbsp;executed&nbsp;once.</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">159</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*/</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">160</td><td class="line-calls">&nbsp;</td><td class="line-code"> isOnce&nbsp;:&nbsp;function(){</td>
+ </tr> <tr class="called">
+ <td class="line-number">161</td><td class="line-calls">16</td><td class="line-code"> return&nbsp;this._isOnce;</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">162</td><td class="line-calls">&nbsp;</td><td class="line-code"> },</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">163</td><td class="line-calls">&nbsp;</td><td class="line-code"> </td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">164</td><td class="line-calls">&nbsp;</td><td class="line-code"> /**</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">165</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;@return&nbsp;{string}&nbsp;String&nbsp;representation&nbsp;of&nbsp;the&nbsp;object.</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">166</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*/</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">167</td><td class="line-calls">&nbsp;</td><td class="line-code"> toString&nbsp;:&nbsp;function(){</td>
+ </tr> <tr class="not-called">
+ <td class="line-number">168</td><td class="line-calls">0</td><td class="line-code"> return&nbsp;'[SignalBinding&nbsp;isOnce:&nbsp;'+&nbsp;this._isOnce&nbsp;+',&nbsp;isEnabled:&nbsp;'+&nbsp;this._isEnabled&nbsp;+']';</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">169</td><td class="line-calls">&nbsp;</td><td class="line-code"> }</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">170</td><td class="line-calls">&nbsp;</td><td class="line-code"> </td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">171</td><td class="line-calls">&nbsp;</td><td class="line-code"> };</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">172</td><td class="line-calls">&nbsp;</td><td class="line-code"> </td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">173</td><td class="line-calls">&nbsp;</td><td class="line-code"> //&nbsp;Signal&nbsp;--------------------------------------------------------</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">174</td><td class="line-calls">&nbsp;</td><td class="line-code"> //================================================================</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">175</td><td class="line-calls">&nbsp;</td><td class="line-code"> </td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">176</td><td class="line-calls">&nbsp;</td><td class="line-code"> /**</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">177</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;Custom&nbsp;event&nbsp;broadcaster</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">178</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;&lt;br&nbsp;/&gt;-&nbsp;inspired&nbsp;by&nbsp;Robert&nbsp;Penner's&nbsp;AS3&nbsp;Signals.</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">179</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;@author&nbsp;Miller&nbsp;Medeiros</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">180</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;@constructor</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">181</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*/</td>
+ </tr> <tr class="called">
+ <td class="line-number">182</td><td class="line-calls">1</td><td class="line-code"> signals.Signal&nbsp;=&nbsp;function(){</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">183</td><td class="line-calls">&nbsp;</td><td class="line-code"> /**</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">184</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;@type&nbsp;Array.&lt;SignalBinding&gt;</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">185</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;@private</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">186</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*/</td>
+ </tr> <tr class="called">
+ <td class="line-number">187</td><td class="line-calls">72</td><td class="line-code"> this._bindings&nbsp;=&nbsp;[];</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">188</td><td class="line-calls">&nbsp;</td><td class="line-code"> };</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">189</td><td class="line-calls">&nbsp;</td><td class="line-code"> </td>
+ </tr> <tr class="called">
+ <td class="line-number">190</td><td class="line-calls">1</td><td class="line-code"> signals.Signal.prototype&nbsp;=&nbsp;{</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">191</td><td class="line-calls">&nbsp;</td><td class="line-code"> </td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">192</td><td class="line-calls">&nbsp;</td><td class="line-code"> /**</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">193</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;@type&nbsp;boolean</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">194</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;@private</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">195</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*/</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">196</td><td class="line-calls">&nbsp;</td><td class="line-code"> _shouldPropagate&nbsp;:&nbsp;true,</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">197</td><td class="line-calls">&nbsp;</td><td class="line-code"> </td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">198</td><td class="line-calls">&nbsp;</td><td class="line-code"> /**</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">199</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;@type&nbsp;boolean</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">200</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;@private</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">201</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*/</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">202</td><td class="line-calls">&nbsp;</td><td class="line-code"> _isEnabled&nbsp;:&nbsp;true,</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">203</td><td class="line-calls">&nbsp;</td><td class="line-code"> </td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">204</td><td class="line-calls">&nbsp;</td><td class="line-code"> /**</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">205</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;@param&nbsp;{Function}&nbsp;listener</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">206</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;@param&nbsp;{boolean}&nbsp;isOnce</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">207</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;@param&nbsp;{Object}&nbsp;[scope]</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">208</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;@return&nbsp;{SignalBinding}</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">209</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;@private</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">210</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*/</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">211</td><td class="line-calls">&nbsp;</td><td class="line-code"> _registerListener&nbsp;:&nbsp;function(listener,&nbsp;isOnce,&nbsp;scope){</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">212</td><td class="line-calls">&nbsp;</td><td class="line-code"> </td>
+ </tr> <tr class="called">
+ <td class="line-number">213</td><td class="line-calls">127</td><td class="line-code"> if(typeof&nbsp;listener&nbsp;!==&nbsp;'function'){</td>
+ </tr> <tr class="called">
+ <td class="line-number">214</td><td class="line-calls">2</td><td class="line-code"> throw&nbsp;new&nbsp;Error('listener&nbsp;is&nbsp;a&nbsp;required&nbsp;param&nbsp;of&nbsp;add()&nbsp;and&nbsp;addOnce()&nbsp;and&nbsp;should&nbsp;be&nbsp;a&nbsp;Function.');</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">215</td><td class="line-calls">&nbsp;</td><td class="line-code"> }</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">216</td><td class="line-calls">&nbsp;</td><td class="line-code"> </td>
+ </tr> <tr class="called">
+ <td class="line-number">217</td><td class="line-calls">125</td><td class="line-code"> var&nbsp;prevIndex&nbsp;=&nbsp;this._indexOfListener(listener),</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">218</td><td class="line-calls">&nbsp;</td><td class="line-code"> binding;</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">219</td><td class="line-calls">&nbsp;</td><td class="line-code"> </td>
+ </tr> <tr class="called">
+ <td class="line-number">220</td><td class="line-calls">124</td><td class="line-code"> if(prevIndex&nbsp;!==&nbsp;-1){&nbsp;//avoid&nbsp;creating&nbsp;a&nbsp;new&nbsp;Binding&nbsp;for&nbsp;same&nbsp;listener&nbsp;if&nbsp;already&nbsp;added&nbsp;to&nbsp;list</td>
+ </tr> <tr class="called">
+ <td class="line-number">221</td><td class="line-calls">6</td><td class="line-code"> binding&nbsp;=&nbsp;this._bindings[prevIndex];</td>
+ </tr> <tr class="called">
+ <td class="line-number">222</td><td class="line-calls">6</td><td class="line-code"> if(binding.isOnce()&nbsp;!==&nbsp;isOnce){</td>
+ </tr> <tr class="called">
+ <td class="line-number">223</td><td class="line-calls">2</td><td class="line-code"> throw&nbsp;new&nbsp;Error('You&nbsp;cannot&nbsp;add'+&nbsp;(isOnce?&nbsp;''&nbsp;:&nbsp;'Once')&nbsp;+'()&nbsp;then&nbsp;add'+&nbsp;(!isOnce?&nbsp;''&nbsp;:&nbsp;'Once')&nbsp;+'()&nbsp;the&nbsp;same&nbsp;listener&nbsp;without&nbsp;removing&nbsp;the&nbsp;relationship&nbsp;first.');</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">224</td><td class="line-calls">&nbsp;</td><td class="line-code"> }</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">225</td><td class="line-calls">&nbsp;</td><td class="line-code"> }&nbsp;else&nbsp;{</td>
+ </tr> <tr class="called">
+ <td class="line-number">226</td><td class="line-calls">118</td><td class="line-code"> binding&nbsp;=&nbsp;new&nbsp;SignalBinding(this,&nbsp;listener,&nbsp;isOnce,&nbsp;scope);</td>
+ </tr> <tr class="called">
+ <td class="line-number">227</td><td class="line-calls">118</td><td class="line-code"> this._bindings.push(binding);</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">228</td><td class="line-calls">&nbsp;</td><td class="line-code"> }</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">229</td><td class="line-calls">&nbsp;</td><td class="line-code"> </td>
+ </tr> <tr class="called">
+ <td class="line-number">230</td><td class="line-calls">122</td><td class="line-code"> return&nbsp;binding;</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">231</td><td class="line-calls">&nbsp;</td><td class="line-code"> },</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">232</td><td class="line-calls">&nbsp;</td><td class="line-code"> </td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">233</td><td class="line-calls">&nbsp;</td><td class="line-code"> /**</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">234</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;@param&nbsp;{Function}&nbsp;listener</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">235</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;@return&nbsp;{number}</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">236</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;@private</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">237</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*/</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">238</td><td class="line-calls">&nbsp;</td><td class="line-code"> _indexOfListener&nbsp;:&nbsp;function(listener){</td>
+ </tr> <tr class="called">
+ <td class="line-number">239</td><td class="line-calls">167</td><td class="line-code"> var&nbsp;n&nbsp;=&nbsp;this._bindings.length;</td>
+ </tr> <tr class="called">
+ <td class="line-number">240</td><td class="line-calls">165</td><td class="line-code"> while(n--){</td>
+ </tr> <tr class="called">
+ <td class="line-number">241</td><td class="line-calls">126</td><td class="line-code"> if(this._bindings[n]._listener&nbsp;===&nbsp;listener){</td>
+ </tr> <tr class="called">
+ <td class="line-number">242</td><td class="line-calls">41</td><td class="line-code"> return&nbsp;n;</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">243</td><td class="line-calls">&nbsp;</td><td class="line-code"> }</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">244</td><td class="line-calls">&nbsp;</td><td class="line-code"> }</td>
+ </tr> <tr class="called">
+ <td class="line-number">245</td><td class="line-calls">124</td><td class="line-code"> return&nbsp;-1;</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">246</td><td class="line-calls">&nbsp;</td><td class="line-code"> },</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">247</td><td class="line-calls">&nbsp;</td><td class="line-code"> </td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">248</td><td class="line-calls">&nbsp;</td><td class="line-code"> /**</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">249</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;Add&nbsp;a&nbsp;listener&nbsp;to&nbsp;the&nbsp;signal.</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">250</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;@param&nbsp;{Function}&nbsp;listener Signal&nbsp;handler&nbsp;function.</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">251</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;@param&nbsp;{Object}&nbsp;[scope] Context&nbsp;on&nbsp;which&nbsp;listener&nbsp;will&nbsp;be&nbsp;executed&nbsp;(object&nbsp;that&nbsp;should&nbsp;represent&nbsp;the&nbsp;`this`&nbsp;variable&nbsp;inside&nbsp;listener&nbsp;function).</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">252</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;@return&nbsp;{SignalBinding}&nbsp;An&nbsp;Object&nbsp;representing&nbsp;the&nbsp;binding&nbsp;between&nbsp;the&nbsp;Signal&nbsp;and&nbsp;listener.</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">253</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*/</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">254</td><td class="line-calls">&nbsp;</td><td class="line-code"> add&nbsp;:&nbsp;function(listener,&nbsp;scope){</td>
+ </tr> <tr class="called">
+ <td class="line-number">255</td><td class="line-calls">79</td><td class="line-code"> return&nbsp;this._registerListener(listener,&nbsp;false,&nbsp;scope);</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">256</td><td class="line-calls">&nbsp;</td><td class="line-code"> },</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">257</td><td class="line-calls">&nbsp;</td><td class="line-code"> </td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">258</td><td class="line-calls">&nbsp;</td><td class="line-code"> /**</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">259</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;Add&nbsp;listener&nbsp;to&nbsp;the&nbsp;signal&nbsp;that&nbsp;should&nbsp;be&nbsp;removed&nbsp;after&nbsp;first&nbsp;execution&nbsp;(will&nbsp;be&nbsp;executed&nbsp;only&nbsp;once).</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">260</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;@param&nbsp;{Function}&nbsp;listener Signal&nbsp;handler&nbsp;function.</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">261</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;@param&nbsp;{Object}&nbsp;[scope] Context&nbsp;on&nbsp;which&nbsp;listener&nbsp;will&nbsp;be&nbsp;executed&nbsp;(object&nbsp;that&nbsp;should&nbsp;represent&nbsp;the&nbsp;`this`&nbsp;variable&nbsp;inside&nbsp;listener&nbsp;function).</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">262</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;@return&nbsp;{SignalBinding}&nbsp;An&nbsp;Object&nbsp;representing&nbsp;the&nbsp;binding&nbsp;between&nbsp;the&nbsp;Signal&nbsp;and&nbsp;listener.</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">263</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*/</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">264</td><td class="line-calls">&nbsp;</td><td class="line-code"> addOnce&nbsp;:&nbsp;function(listener,&nbsp;scope){</td>
+ </tr> <tr class="called">
+ <td class="line-number">265</td><td class="line-calls">48</td><td class="line-code"> return&nbsp;this._registerListener(listener,&nbsp;true,&nbsp;scope);</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">266</td><td class="line-calls">&nbsp;</td><td class="line-code"> },</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">267</td><td class="line-calls">&nbsp;</td><td class="line-code"> </td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">268</td><td class="line-calls">&nbsp;</td><td class="line-code"> /**</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">269</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;Remove&nbsp;a&nbsp;single&nbsp;listener&nbsp;from&nbsp;the&nbsp;dispatch&nbsp;queue.</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">270</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;@param&nbsp;{Function}&nbsp;listener Handler&nbsp;function&nbsp;that&nbsp;should&nbsp;be&nbsp;removed.</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">271</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;@return&nbsp;{Function}&nbsp;Listener&nbsp;handler&nbsp;function.</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">272</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*/</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">273</td><td class="line-calls">&nbsp;</td><td class="line-code"> remove&nbsp;:&nbsp;function(listener){</td>
+ </tr> <tr class="called">
+ <td class="line-number">274</td><td class="line-calls">43</td><td class="line-code"> if(typeof&nbsp;listener&nbsp;!==&nbsp;'function'){</td>
+ </tr> <tr class="called">
+ <td class="line-number">275</td><td class="line-calls">1</td><td class="line-code"> throw&nbsp;new&nbsp;Error('listener&nbsp;is&nbsp;a&nbsp;required&nbsp;param&nbsp;of&nbsp;remove()&nbsp;and&nbsp;should&nbsp;be&nbsp;a&nbsp;Function.');</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">276</td><td class="line-calls">&nbsp;</td><td class="line-code"> }</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">277</td><td class="line-calls">&nbsp;</td><td class="line-code"> </td>
+ </tr> <tr class="called">
+ <td class="line-number">278</td><td class="line-calls">42</td><td class="line-code"> var&nbsp;i&nbsp;=&nbsp;this._indexOfListener(listener);</td>
+ </tr> <tr class="called">
+ <td class="line-number">279</td><td class="line-calls">41</td><td class="line-code"> if(i&nbsp;!==&nbsp;-1){</td>
+ </tr> <tr class="called">
+ <td class="line-number">280</td><td class="line-calls">35</td><td class="line-code"> this._bindings[i]._destroy();&nbsp;//no&nbsp;reason&nbsp;to&nbsp;a&nbsp;SignalBinding&nbsp;exist&nbsp;if&nbsp;it&nbsp;isn't&nbsp;attached&nbsp;to&nbsp;a&nbsp;signal</td>
+ </tr> <tr class="called">
+ <td class="line-number">281</td><td class="line-calls">35</td><td class="line-code"> this._bindings.splice(i,&nbsp;1);</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">282</td><td class="line-calls">&nbsp;</td><td class="line-code"> }</td>
+ </tr> <tr class="called">
+ <td class="line-number">283</td><td class="line-calls">41</td><td class="line-code"> return&nbsp;listener;</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">284</td><td class="line-calls">&nbsp;</td><td class="line-code"> },</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">285</td><td class="line-calls">&nbsp;</td><td class="line-code"> </td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">286</td><td class="line-calls">&nbsp;</td><td class="line-code"> /**</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">287</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;Remove&nbsp;all&nbsp;listeners&nbsp;from&nbsp;the&nbsp;Signal.</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">288</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*/</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">289</td><td class="line-calls">&nbsp;</td><td class="line-code"> removeAll&nbsp;:&nbsp;function(){</td>
+ </tr> <tr class="called">
+ <td class="line-number">290</td><td class="line-calls">8</td><td class="line-code"> var&nbsp;n&nbsp;=&nbsp;this._bindings.length;</td>
+ </tr> <tr class="called">
+ <td class="line-number">291</td><td class="line-calls">8</td><td class="line-code"> while(n--){</td>
+ </tr> <tr class="called">
+ <td class="line-number">292</td><td class="line-calls">23</td><td class="line-code"> this._bindings[n]._destroy();</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">293</td><td class="line-calls">&nbsp;</td><td class="line-code"> }</td>
+ </tr> <tr class="called">
+ <td class="line-number">294</td><td class="line-calls">8</td><td class="line-code"> this._bindings.length&nbsp;=&nbsp;0;</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">295</td><td class="line-calls">&nbsp;</td><td class="line-code"> },</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">296</td><td class="line-calls">&nbsp;</td><td class="line-code"> </td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">297</td><td class="line-calls">&nbsp;</td><td class="line-code"> /**</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">298</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;@return&nbsp;{number}&nbsp;Number&nbsp;of&nbsp;listeners&nbsp;attached&nbsp;to&nbsp;the&nbsp;Signal.</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">299</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*/</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">300</td><td class="line-calls">&nbsp;</td><td class="line-code"> getNumListeners&nbsp;:&nbsp;function(){</td>
+ </tr> <tr class="called">
+ <td class="line-number">301</td><td class="line-calls">40</td><td class="line-code"> return&nbsp;this._bindings.length;</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">302</td><td class="line-calls">&nbsp;</td><td class="line-code"> },</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">303</td><td class="line-calls">&nbsp;</td><td class="line-code"> </td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">304</td><td class="line-calls">&nbsp;</td><td class="line-code"> /**</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">305</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;Disable&nbsp;Signal.&nbsp;Block&nbsp;dispatch&nbsp;to&nbsp;listeners&nbsp;until&nbsp;`enable()`&nbsp;is&nbsp;called.</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">306</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;&lt;p&gt;&lt;strong&gt;IMPORTANT:&lt;/strong&gt;&nbsp;If&nbsp;this&nbsp;method&nbsp;is&nbsp;called&nbsp;during&nbsp;a&nbsp;dispatch&nbsp;it&nbsp;will&nbsp;only&nbsp;have&nbsp;effect&nbsp;on&nbsp;the&nbsp;next&nbsp;dispatch,&nbsp;if&nbsp;you&nbsp;want&nbsp;to&nbsp;stop&nbsp;the&nbsp;propagation&nbsp;of&nbsp;a&nbsp;signal&nbsp;use&nbsp;`halt()`&nbsp;instead.&lt;/p&gt;</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">307</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;@see&nbsp;signals.Signal.prototype.enable</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">308</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;@see&nbsp;signals.Signal.prototype.halt</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">309</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*/</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">310</td><td class="line-calls">&nbsp;</td><td class="line-code"> disable&nbsp;:&nbsp;function(){</td>
+ </tr> <tr class="called">
+ <td class="line-number">311</td><td class="line-calls">1</td><td class="line-code"> this._isEnabled&nbsp;=&nbsp;false;</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">312</td><td class="line-calls">&nbsp;</td><td class="line-code"> },</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">313</td><td class="line-calls">&nbsp;</td><td class="line-code"> </td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">314</td><td class="line-calls">&nbsp;</td><td class="line-code"> /**</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">315</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;Enable&nbsp;broadcast&nbsp;to&nbsp;listeners.</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">316</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;@see&nbsp;signals.Signal.prototype.disable</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">317</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*/</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">318</td><td class="line-calls">&nbsp;</td><td class="line-code"> enable&nbsp;:&nbsp;function(){</td>
+ </tr> <tr class="called">
+ <td class="line-number">319</td><td class="line-calls">1</td><td class="line-code"> this._isEnabled&nbsp;=&nbsp;true;</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">320</td><td class="line-calls">&nbsp;</td><td class="line-code"> },&nbsp;</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">321</td><td class="line-calls">&nbsp;</td><td class="line-code"> </td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">322</td><td class="line-calls">&nbsp;</td><td class="line-code"> /**</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">323</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;@return&nbsp;{boolean}&nbsp;If&nbsp;Signal&nbsp;is&nbsp;currently&nbsp;enabled&nbsp;and&nbsp;will&nbsp;broadcast&nbsp;message&nbsp;to&nbsp;listeners.</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">324</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*/</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">325</td><td class="line-calls">&nbsp;</td><td class="line-code"> isEnabled&nbsp;:&nbsp;function(){</td>
+ </tr> <tr class="called">
+ <td class="line-number">326</td><td class="line-calls">6</td><td class="line-code"> return&nbsp;this._isEnabled;</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">327</td><td class="line-calls">&nbsp;</td><td class="line-code"> },</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">328</td><td class="line-calls">&nbsp;</td><td class="line-code"> </td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">329</td><td class="line-calls">&nbsp;</td><td class="line-code"> /**</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">330</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;Stop&nbsp;propagation&nbsp;of&nbsp;the&nbsp;event,&nbsp;blocking&nbsp;the&nbsp;dispatch&nbsp;to&nbsp;next&nbsp;listeners&nbsp;on&nbsp;the&nbsp;queue.</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">331</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;&lt;p&gt;&lt;strong&gt;IMPORTANT:&lt;/strong&gt;&nbsp;should&nbsp;be&nbsp;called&nbsp;only&nbsp;during&nbsp;signal&nbsp;dispatch,&nbsp;calling&nbsp;it&nbsp;before/after&nbsp;dispatch&nbsp;won't&nbsp;affect&nbsp;signal&nbsp;broadcast.&lt;/p&gt;</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">332</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;@see&nbsp;signals.Signal.prototype.disable&nbsp;</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">333</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*/</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">334</td><td class="line-calls">&nbsp;</td><td class="line-code"> halt&nbsp;:&nbsp;function(){</td>
+ </tr> <tr class="called">
+ <td class="line-number">335</td><td class="line-calls">2</td><td class="line-code"> this._shouldPropagate&nbsp;=&nbsp;false;</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">336</td><td class="line-calls">&nbsp;</td><td class="line-code"> },</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">337</td><td class="line-calls">&nbsp;</td><td class="line-code"> </td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">338</td><td class="line-calls">&nbsp;</td><td class="line-code"> /**</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">339</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;Dispatch/Broadcast&nbsp;Signal&nbsp;to&nbsp;all&nbsp;listeners&nbsp;added&nbsp;to&nbsp;the&nbsp;queue.&nbsp;</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">340</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;@param&nbsp;{...*}&nbsp;[params] Parameters&nbsp;that&nbsp;should&nbsp;be&nbsp;passed&nbsp;to&nbsp;each&nbsp;handler.</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">341</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*/</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">342</td><td class="line-calls">&nbsp;</td><td class="line-code"> dispatch&nbsp;:&nbsp;function(params){</td>
+ </tr> <tr class="called">
+ <td class="line-number">343</td><td class="line-calls">69</td><td class="line-code"> if(!&nbsp;this._isEnabled){</td>
+ </tr> <tr class="called">
+ <td class="line-number">344</td><td class="line-calls">1</td><td class="line-code"> return;</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">345</td><td class="line-calls">&nbsp;</td><td class="line-code"> }</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">346</td><td class="line-calls">&nbsp;</td><td class="line-code"> </td>
+ </tr> <tr class="called">
+ <td class="line-number">347</td><td class="line-calls">68</td><td class="line-code"> var&nbsp;paramsArr&nbsp;=&nbsp;Array.prototype.slice.call(arguments),</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">348</td><td class="line-calls">&nbsp;</td><td class="line-code"> bindings&nbsp;=&nbsp;this._bindings.slice(),&nbsp;//clone&nbsp;array&nbsp;in&nbsp;case&nbsp;add/remove&nbsp;items&nbsp;during&nbsp;dispatch</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">349</td><td class="line-calls">&nbsp;</td><td class="line-code"> i,</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">350</td><td class="line-calls">&nbsp;</td><td class="line-code"> n&nbsp;=&nbsp;this._bindings.length;</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">351</td><td class="line-calls">&nbsp;</td><td class="line-code"> </td>
+ </tr> <tr class="called">
+ <td class="line-number">352</td><td class="line-calls">67</td><td class="line-code"> this._shouldPropagate&nbsp;=&nbsp;true;&nbsp;//in&nbsp;case&nbsp;`halt`&nbsp;was&nbsp;called&nbsp;before&nbsp;dispatch&nbsp;or&nbsp;during&nbsp;the&nbsp;previous&nbsp;dispatch.</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">353</td><td class="line-calls">&nbsp;</td><td class="line-code"> </td>
+ </tr> <tr class="called">
+ <td class="line-number">354</td><td class="line-calls">67</td><td class="line-code"> for(i=0;&nbsp;i&lt;n;&nbsp;i++){</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">355</td><td class="line-calls">&nbsp;</td><td class="line-code"> //execute&nbsp;all&nbsp;callbacks&nbsp;until&nbsp;end&nbsp;of&nbsp;the&nbsp;list&nbsp;or&nbsp;until&nbsp;a&nbsp;callback&nbsp;returns&nbsp;`false`&nbsp;or&nbsp;stops&nbsp;propagation</td>
+ </tr> <tr class="called">
+ <td class="line-number">356</td><td class="line-calls">83</td><td class="line-code"> if(bindings[i].execute(paramsArr)&nbsp;===&nbsp;false&nbsp;||&nbsp;!this._shouldPropagate){</td>
+ </tr> <tr class="called">
+ <td class="line-number">357</td><td class="line-calls">2</td><td class="line-code"> break;</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">358</td><td class="line-calls">&nbsp;</td><td class="line-code"> }</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">359</td><td class="line-calls">&nbsp;</td><td class="line-code"> }</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">360</td><td class="line-calls">&nbsp;</td><td class="line-code"> },</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">361</td><td class="line-calls">&nbsp;</td><td class="line-code"> </td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">362</td><td class="line-calls">&nbsp;</td><td class="line-code"> /**</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">363</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;Remove&nbsp;all&nbsp;bindings&nbsp;from&nbsp;signal&nbsp;and&nbsp;destroy&nbsp;any&nbsp;reference&nbsp;to&nbsp;external&nbsp;objects&nbsp;(destroy&nbsp;Signal&nbsp;object).</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">364</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*&nbsp;&lt;p&gt;&lt;strong&gt;IMPORTANT:&lt;/strong&gt;&nbsp;calling&nbsp;any&nbsp;method&nbsp;on&nbsp;the&nbsp;signal&nbsp;instance&nbsp;after&nbsp;calling&nbsp;dispose&nbsp;will&nbsp;throw&nbsp;errors.&lt;/p&gt;</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">365</td><td class="line-calls">&nbsp;</td><td class="line-code"> &nbsp;*/</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">366</td><td class="line-calls">&nbsp;</td><td class="line-code"> dispose&nbsp;:&nbsp;function(){</td>
+ </tr> <tr class="called">
+ <td class="line-number">367</td><td class="line-calls">4</td><td class="line-code"> this.removeAll();</td>
+ </tr> <tr class="called">
+ <td class="line-number">368</td><td class="line-calls">4</td><td class="line-code"> delete&nbsp;this._bindings;</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">369</td><td class="line-calls">&nbsp;</td><td class="line-code"> },</td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">370</td><td class="line-calls">&nbsp;</td><td class="line-code"> </td>
+ </tr> <tr class="uncovered">
+ <td class="line-number">371</td><td class="line-calls">&nbsp;</td><td class="line-code"> /**</td>
+ </tr> <tr class="uncovered"&