Closed
Bug 1119832
Opened 10 years ago
Closed 10 years ago
Typo in apps/system/js/async_semaphore.js
Categories
(Firefox OS Graveyard :: Gaia::System, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: max, Unassigned)
Details
Attachments
(1 file)
Constructor AsyncSemaphore tries to guard against being called without 'new' by the following test (https://github.com/mozilla-b2g/gaia/blob/master/apps/system/js/async_semaphore.js#L8):
if (!this instanceof AsyncSemaphore) {
return new AsyncSemaphore();
}
Note, however, that '!' binds more tightly than 'instanceof', so the 'if' condition will always evaluate to 'false', rendering the guard ineffective.
Comment 1•10 years ago
|
||
Comment 2•10 years ago
|
||
Comment on attachment 8553959 [details] [review]
[PullReq] KevinGrandon:bug_1119832_async_semaphore_typo to mozilla-b2g:master
Max - thank you for filing this bug.
Tzu-Lin - could you give this a quick review? Just fixing the syntax and adding a quick unit test.
Attachment #8553959 -
Flags: review?(tzhuang)
Comment 3•10 years ago
|
||
Comment on attachment 8553959 [details] [review]
[PullReq] KevinGrandon:bug_1119832_async_semaphore_typo to mozilla-b2g:master
Nice catch, thanks
Attachment #8553959 -
Flags: review?(tzhuang) → review+
Comment 4•10 years ago
|
||
Status: UNCONFIRMED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•