Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
John McEleney
/
casperjs
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
111c00b6
...
111c00b6857d662a4f7961bebb1723aa5aac3601
authored
2012-12-21 20:44:07 +0100
by
Nicolas Perriault
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
refs #328 - added EventEmitter.removeAllFilters()
1 parent
51ded333
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
modules/events.js
modules/events.js
View file @
111c00b
...
...
@@ -19,6 +19,8 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
/*global CasperError*/
var
isArray
=
Array
.
isArray
;
function
EventEmitter
()
{
...
...
@@ -230,6 +232,17 @@ EventEmitter.prototype.filter = function() {
return
filter
.
apply
(
this
,
Array
.
prototype
.
splice
.
call
(
arguments
,
1
));
};
EventEmitter
.
prototype
.
removeAllFilters
=
function
(
type
)
{
if
(
arguments
.
length
===
0
)
{
this
.
_filters
=
{};
return
this
;
}
if
(
type
&&
this
.
_filters
&&
this
.
_filters
[
type
])
{
this
.
_filters
[
type
]
=
null
;
}
return
this
;
};
EventEmitter
.
prototype
.
setFilter
=
function
(
type
,
filterFn
)
{
if
(
!
this
.
_filters
)
{
this
.
_filters
=
{};
...
...
Please
register
or
sign in
to post a comment