Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
public
/
sequelize
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
不要怂,就是干,撸起袖子干!
Commit fe77d52d
authored
Apr 08, 2013
by
Jan Aagaard Meier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rm those pesky semi-colons - shame on you @mweibel
1 parent
ef81d002
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
13 deletions
lib/emitters/custom-event-emitter.js
lib/emitters/custom-event-emitter.js
View file @
fe77d52
var
util
=
require
(
"util"
)
var
util
=
require
(
"util"
)
,
EventEmitter
=
require
(
"events"
).
EventEmitter
;
,
EventEmitter
=
require
(
"events"
).
EventEmitter
module
.
exports
=
(
function
()
{
module
.
exports
=
(
function
()
{
var
CustomEventEmitter
=
function
(
fct
)
{
var
CustomEventEmitter
=
function
(
fct
)
{
this
.
fct
=
fct
;
this
.
fct
=
fct
var
self
=
this
;
var
self
=
this
}
}
util
.
inherits
(
CustomEventEmitter
,
EventEmitter
)
;
util
.
inherits
(
CustomEventEmitter
,
EventEmitter
)
CustomEventEmitter
.
prototype
.
run
=
function
()
{
CustomEventEmitter
.
prototype
.
run
=
function
()
{
var
self
=
this
;
var
self
=
this
process
.
nextTick
(
function
()
{
process
.
nextTick
(
function
()
{
if
(
self
.
fct
)
{
if
(
self
.
fct
)
{
self
.
fct
.
call
(
self
,
self
)
self
.
fct
.
call
(
self
,
self
)
}
}
}.
bind
(
this
))
;
}.
bind
(
this
))
return
this
;
return
this
}
}
CustomEventEmitter
.
prototype
.
success
=
CustomEventEmitter
.
prototype
.
success
=
CustomEventEmitter
.
prototype
.
ok
=
CustomEventEmitter
.
prototype
.
ok
=
function
(
fct
)
{
function
(
fct
)
{
this
.
on
(
'success'
,
fct
)
;
this
.
on
(
'success'
,
fct
)
return
this
;
return
this
}
}
CustomEventEmitter
.
prototype
.
failure
=
CustomEventEmitter
.
prototype
.
failure
=
CustomEventEmitter
.
prototype
.
fail
=
CustomEventEmitter
.
prototype
.
fail
=
CustomEventEmitter
.
prototype
.
error
=
CustomEventEmitter
.
prototype
.
error
=
function
(
fct
)
{
function
(
fct
)
{
this
.
on
(
'error'
,
fct
)
;
this
.
on
(
'error'
,
fct
)
return
this
;
return
this
;
}
}
...
@@ -39,10 +39,10 @@ module.exports = (function() {
...
@@ -39,10 +39,10 @@ module.exports = (function() {
CustomEventEmitter
.
prototype
.
complete
=
CustomEventEmitter
.
prototype
.
complete
=
function
(
fct
)
{
function
(
fct
)
{
this
.
on
(
'error'
,
function
(
err
)
{
fct
(
err
,
null
)
})
this
.
on
(
'error'
,
function
(
err
)
{
fct
(
err
,
null
)
})
.
on
(
'success'
,
function
(
result
)
{
fct
(
null
,
result
)
})
;
.
on
(
'success'
,
function
(
result
)
{
fct
(
null
,
result
)
})
return
this
;
return
this
}
}
return
CustomEventEmitter
;
return
CustomEventEmitter
;
})()
;
})()
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment