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 28eeef7e
authored
Oct 18, 2013
by
Sascha Depold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
moved tick method to utils
1 parent
b95c33ea
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
lib/emitters/custom-event-emitter.js
lib/utils.js
lib/emitters/custom-event-emitter.js
View file @
28eeef7
...
@@ -2,7 +2,6 @@ var util = require("util")
...
@@ -2,7 +2,6 @@ var util = require("util")
,
EventEmitter
=
require
(
"events"
).
EventEmitter
,
EventEmitter
=
require
(
"events"
).
EventEmitter
,
Promise
=
require
(
"promise"
)
,
Promise
=
require
(
"promise"
)
,
proxyEventKeys
=
[
'success'
,
'error'
,
'sql'
]
,
proxyEventKeys
=
[
'success'
,
'error'
,
'sql'
]
,
tick
=
(
typeof
setImmediate
!==
"undefined"
?
setImmediate
:
process
.
nextTick
)
,
Utils
=
require
(
'../utils'
)
,
Utils
=
require
(
'../utils'
)
var
bindToProcess
=
function
(
fct
)
{
var
bindToProcess
=
function
(
fct
)
{
...
@@ -20,7 +19,7 @@ module.exports = (function() {
...
@@ -20,7 +19,7 @@ module.exports = (function() {
util
.
inherits
(
CustomEventEmitter
,
EventEmitter
)
util
.
inherits
(
CustomEventEmitter
,
EventEmitter
)
CustomEventEmitter
.
prototype
.
run
=
function
()
{
CustomEventEmitter
.
prototype
.
run
=
function
()
{
tick
(
function
()
{
Utils
.
tick
(
function
()
{
if
(
this
.
fct
)
{
if
(
this
.
fct
)
{
this
.
fct
.
call
(
this
,
this
)
this
.
fct
.
call
(
this
,
this
)
}
}
...
...
lib/utils.js
View file @
28eeef7
...
@@ -494,6 +494,11 @@ var Utils = module.exports = {
...
@@ -494,6 +494,11 @@ var Utils = module.exports = {
return
now
return
now
},
},
tick
:
function
(
func
)
{
var
tick
=
(
typeof
setImmediate
!==
"undefined"
?
setImmediate
:
process
.
nextTick
)
tick
(
func
)
},
// Note: Use the `quoteIdentifier()` and `escape()` methods on the
// Note: Use the `quoteIdentifier()` and `escape()` methods on the
// `QueryInterface` instead for more portable code.
// `QueryInterface` instead for more portable code.
...
...
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