Closed
Bug 647654
Opened 13 years ago
Closed 12 years ago
[SMILE] Avoid binding this._event N times by doing it once in the constructor.
Categories
(SeaMonkey :: General, defect)
SeaMonkey
General
Tracking
(Not tracked)
RESOLVED
FIXED
seamonkey2.12
People
(Reporter: philip.chee, Assigned: sgautherie)
References
()
Details
Attachments
(1 file)
From Bug 647571 Comment 2: > neil@parkwaycc.co.uk 2011-04-03 13:15:37 PDT > > [In theory it's possible to avoid binding this._event N times by doing it once > in the constructor. Followup bug perhaps?]
Assignee | ||
Comment 1•12 years ago
|
||
What is the syntax to do this? Ftr, there are 2 occurrences: { 143 this._cleanup[aType] = this._event.bind(this), 230 this._cleanup[aType] = this._event.bind(this), }
Severity: normal → minor
Comment 2•12 years ago
|
||
Something like __event : function win_event(aEvent) { ... this._event = this.__event.bind(this); ... this._cleanup[aType] = this._event,
Assignee | ||
Comment 3•12 years ago
|
||
Should be like this. (Untested.)
Comment 4•12 years ago
|
||
(In reply to Serge Gautherie from comment #3) > (Untested.) Do we have unit tests that I can run locally for this?
Assignee | ||
Comment 5•12 years ago
|
||
Yes: http://mxr.mozilla.org/comm-central/source/suite/smile/test/
Comment 6•12 years ago
|
||
Comment on attachment 627134 [details] [diff] [review] (Av1) smileApplication.js: Bind '_event()' once for all [Checked in: See comment 7] >+ // Define '_event()' as binded once for all. Nit: past tense of 'bind' is 'bound', not 'binded'.
Attachment #627134 -
Flags: review?(neil) → review+
Assignee | ||
Comment 7•12 years ago
|
||
Comment on attachment 627134 [details] [diff] [review] (Av1) smileApplication.js: Bind '_event()' once for all [Checked in: See comment 7] http://hg.mozilla.org/comm-central/rev/67501405df7b Av1, with comment 6 suggestion(s).
Attachment #627134 -
Attachment description: (Av1) smileApplication.js: Bind '_event()' once for all → (Av1) smileApplication.js: Bind '_event()' once for all
[Checked in: See comment 7]
Assignee | ||
Updated•12 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Flags: in-testsuite-
Resolution: --- → FIXED
Target Milestone: --- → seamonkey2.12
You need to log in
before you can comment on or make changes to this bug.
Description
•