Closed rauanmayemir closed 14 years ago
nb: i'm passing this
from prototype js Classes (their "methods")
Can you please post some code that reproduces the problem?
Hm.. i remember, i really had such problems, but after solving them, i cannot reproduce again.
I guess there was problems with the scope of eval'd scripts came from ajax.
Take a look at this fragment:
if (pending[type] || !(p = pending[type] = queue[type].shift())) { return; }
Case is:
i'm lazy loading script from one place, and some time later loading it again, but
this string !(p = pending[type] = queue[type].shift())
returns me true.
After firebuging i noticed, that either pending or queue doesn't clean up after loading scripts, so that in next cycle queue or pending is not empty.
I'm using Firefox 3.5.8, but in Chrome 4 results are the same.
The !(p = pending[type] = queue[type].shift())
check will evaluate to true
when the queue is empty, so it sounds like this is working correctly. If items weren't being removed from the queue, that expression would evaluate to false
.
Since I haven't seen an issue like the one you describe, I can't debug this unless you can provide executable code that reproduces the problem.
Can't reproduce and no new info, so closing.
I'm using prototype js, binding context doesn't work properly. i'm passing
this
for obj, but it doesn't work. it's much simpler for me to apply context via bind(this) for callback function, don't it?