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

RESOLVED FIXED

Status

()

--
trivial
RESOLVED FIXED
15 years ago
15 years ago

People

(Reporter: timeless, Assigned: timeless)

Tracking

Trunk
x86
Windows XP
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(1 attachment)

(Assignee)

Description

15 years ago
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
(Assignee)

Updated

15 years ago
Status: NEW → ASSIGNED
(Assignee)

Comment 1

15 years ago
Created attachment 151079 [details] [diff] [review]
remove orphanned code
(Assignee)

Updated

15 years ago
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+
(Assignee)

Comment 3

15 years ago
mozilla/dom/src/base/nsGlobalWindow.cpp 	1.676
Status: ASSIGNED → RESOLVED
Last Resolved: 15 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.