Skip to content

Commit 5546511

Browse files
committed
Fix arguments to "done" event. refs #15854
git-svn-id: http://svn.dojotoolkit.org/src/dojo/trunk@29487 560b804f-0ae3-0310-86f3-f6aa0a117693
1 parent 2f5a768 commit 5546511

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

request/notify.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ define(['../Evented', '../_base/lang', './util'], function(Evented, lang, util){
1616
// | }
1717
// | );
1818

19-
var pubCount = 0;
19+
var pubCount = 0,
20+
slice = [].slice;
2021

2122
var hub = lang.mixin(new Evented, {
2223
onsend: function(data){
@@ -42,7 +43,7 @@ define(['../Evented', '../_base/lang', './util'], function(Evented, lang, util){
4243

4344
// After all event handlers have run, run _on* handler
4445
if(this['_on' + type]){
45-
this['_on' + type].apply(this, arguments);
46+
this['_on' + type].apply(this, slice.call(arguments, 1));
4647
}
4748
return result;
4849
}

tests/request/notify.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,10 @@
102102

103103
var doneFired = 0;
104104
t.remove = remover(
105-
notify('done', function(response){
105+
notify('done', d.getTestErrback(function(data){
106106
doneFired = 1;
107-
}),
107+
t.t(data instanceof Error);
108+
})),
108109
notify('error', d.getTestErrback(function(data){
109110
t.t(data instanceof Error);
110111
t.f(doneFired, "'error' should have fired before 'done'");

0 commit comments

Comments
 (0)