Closed Bug 247445 Opened 21 years ago Closed 21 years ago

Useless/unreachable stale code from 1999 in GlobalWindowImpl::SetTimeoutOrInterval

Categories

(Core :: DOM: Core & HTML, defect)

x86
Windows XP
defect
Not set
trivial

Tracking

()

RESOLVED FIXED

People

(Reporter: timeless, Assigned: timeless)

References

()

Details

Attachments

(1 file)

http://bonsai.mozilla.org/cvsview2.cgi?diff_mode=context&whitespace_mode=show&root=/cvsroot&subdir=mozilla/dom/src/base&command=DIFF_FRAMESET&file=nsGlobalWindow.cpp&rev2=1.114&rev1=1.113 ver 1.113 had: if (!(str = JS_ValueToString(cx, argv[0]))) return NS_ERROR_FAILURE; expr = PL_strdup(JS_GetStringBytes(str)); if (nsnull == expr) return NS_ERROR_OUT_OF_MEMORY; in 1.114 <brendan@mozilla.org> 1999-07-12 16:40 changed it to: if (!(expr = JS_ValueToString(cx, argv[0]))) return NS_ERROR_FAILURE; if (nsnull == expr) return NS_ERROR_OUT_OF_MEMORY; He removed the PL_strdup but left the error check
Status: NEW → ASSIGNED
Attachment #151079 - Flags: superreview?(brendan)
Attachment #151079 - Flags: review?(brendan)
Comment on attachment 151079 [details] [diff] [review] remove orphanned code Oh, this was the from the giant patch where I undid all the style damage that tbogard inflicted. The error should be NS_ERROR_OOM, not FAILURE. Fix that and r+sr=me. Bonus: I see no point in nesting assignment in that if condition. /be
Attachment #151079 - Flags: superreview?(brendan)
Attachment #151079 - Flags: superreview+
Attachment #151079 - Flags: review?(brendan)
Attachment #151079 - Flags: review+
mozilla/dom/src/base/nsGlobalWindow.cpp 1.676
Status: ASSIGNED → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: