WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
29920
Make a copy of listeners array before dispatching an event
https://bugs.webkit.org/show_bug.cgi?id=29920
Summary
Make a copy of listeners array before dispatching an event
Yury Semikhatsky
Reported
2009-09-30 05:56:19 PDT
Make a copy of listeners array before dispatching an event in WebInspector.Object.prototype.dispatchEventToListeners. Otherwise if current listener removes itself from the array next listener will be skipped.
Attachments
patch
(1.60 KB, patch)
2009-09-30 06:05 PDT
,
Yury Semikhatsky
no flags
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Yury Semikhatsky
Comment 1
2009-09-30 06:05:24 PDT
Created
attachment 40366
[details]
patch
Timothy Hatcher
Comment 2
2009-09-30 09:18:45 PDT
Comment on
attachment 40366
[details]
patch Why did you remove the bind calls? Those are needed to pass the event as the this object.
Patrick Mueller
Comment 3
2009-09-30 11:43:23 PDT
Looks like the bind() should be on preventDefault, but not on stopPropagation. Not harmful on stopPropagation, but it's not needed, and otherwise creates a new function closure for no good reason.
Yury Semikhatsky
Comment 4
2009-09-30 23:48:07 PDT
(In reply to
comment #2
)
> (From update of
attachment 40366
[details]
) > Why did you remove the bind calls? > > Those are needed to pass the event as the this object.
There is no need to bind the functions to event since 'this' variable will be resolved dynamically and as long as preventDefault and stopPropagation are invoked on 'event' 'this' object will be === 'event'. Please tell me if you still want me to revert the changes.
WebKit Commit Bot
Comment 5
2009-10-01 06:17:12 PDT
Comment on
attachment 40366
[details]
patch Clearing flags on attachment: 40366 Committed
r48970
: <
http://trac.webkit.org/changeset/48970
>
WebKit Commit Bot
Comment 6
2009-10-01 06:17:16 PDT
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug