Skip to content

Commit

Permalink
- only one setTimeout
Browse files Browse the repository at this point in the history
  • Loading branch information
ded committed Sep 28, 2011
1 parent 811e19a commit eead35e
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
6 changes: 3 additions & 3 deletions dist/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
else if (typeof module != 'undefined') module.exports = definition()
else this[name] = definition()
}('$script', function() {
var win = this, doc = document, timeout = setTimeout
var win = this, doc = document
, head = doc.getElementsByTagName('head')[0]
, validBase = /^https?:\/\//
, old = win.$script, list = {}, ids = {}, delay = {}, scriptpath
Expand All @@ -36,7 +36,7 @@
}

function $script(paths, idOrDone, optDone) {
paths = paths[push] ? paths : [paths];
paths = paths[push] ? paths : [paths]
var idOrDoneIsDone = idOrDone && idOrDone.call
, done = idOrDoneIsDone ? idOrDone : optDone
, id = idOrDoneIsDone ? paths.join('') : idOrDone
Expand All @@ -53,7 +53,7 @@
}
}
}
timeout(function() {
setTimeout(function () {
each(paths, function(path) {
if (scripts[path]) {
id && (ids[id] = 1)
Expand Down
2 changes: 1 addition & 1 deletion dist/script.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "scriptjs"
, "description": "Asyncronous JavaScript loader and dependency manager"
, "keywords": ["ender", "script", "dependency", "ajax", "jsonp", "loader"]
, "version": "2.2.1"
, "version": "2.2.2"
, "homepage": "https://github.com/ded/script.js"
, "author": "Dustin Diaz <dustin@dustindiaz.com> (http://dustindiaz.com)"
, "contributors": ["Jacob Thornton <jacob@twitter.com> (https://github.com/fat)"]
Expand Down
12 changes: 6 additions & 6 deletions src/ender.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
var $script = require('scriptjs');
var s = require('scriptjs')
ender.ender({
script: $script,
ready: $script.ready,
require: $script,
getScript: $script.get
});
script: s
, require: s
, ready: s.ready
, getScript: s.get
})
6 changes: 3 additions & 3 deletions src/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
else if (typeof module != 'undefined') module.exports = definition()
else this[name] = definition()
}('$script', function() {
var win = this, doc = document, timeout = setTimeout
var win = this, doc = document
, head = doc.getElementsByTagName('head')[0]
, validBase = /^https?:\/\//
, old = win.$script, list = {}, ids = {}, delay = {}, scriptpath
Expand All @@ -30,7 +30,7 @@
}

function $script(paths, idOrDone, optDone) {
paths = paths[push] ? paths : [paths];
paths = paths[push] ? paths : [paths]
var idOrDoneIsDone = idOrDone && idOrDone.call
, done = idOrDoneIsDone ? idOrDone : optDone
, id = idOrDoneIsDone ? paths.join('') : idOrDone
Expand All @@ -47,7 +47,7 @@
}
}
}
timeout(function() {
setTimeout(function () {
each(paths, function(path) {
if (scripts[path]) {
id && (ids[id] = 1)
Expand Down

0 comments on commit eead35e

Please sign in to comment.