Skip to content

fix(callback): callback was called twice when lib was already loaded#72

Merged
ded merged 1 commit intoded:masterfrom
gonzaloruizdevilla:master
Jul 11, 2014
Merged

fix(callback): callback was called twice when lib was already loaded#72
ded merged 1 commit intoded:masterfrom
gonzaloruizdevilla:master

Conversation

@gonzaloruizdevilla
Copy link
Copy Markdown
Contributor

When $script was used with lists with shared scripts, the inside callback() was called twice for previously loaded libraries, and this caused the done() to be called before the scripts were loaded.
Side bonus: 21 bytes less in minified library

@gonzaloruizdevilla
Copy link
Copy Markdown
Contributor Author

@ded Do you think this PR will take long to be merged?
It resolves a very importante bug in the library (blocker in my projects).

I didn't explain the bug clearly.

Lets say you do:

$script(['foo.js', 'bar.js'], doSomething)

and afterwards you do

$script(['foo.js', 'bar.js', 'baz.js'], doSomethingElse)

doSomethingElse may be called before 'baz.js' has been loaded and executed.

Thank you!

@ded
Copy link
Copy Markdown
Owner

ded commented Jul 11, 2014

i see now. thanks for the test. let me make sure it didn't break any other edge cases

ded added a commit that referenced this pull request Jul 11, 2014
fix(callback): callback was called twice when lib was already loaded
@ded ded merged commit 0f21ff6 into ded:master Jul 11, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants