Skip to content

Commit 64a959b

Browse files
author
maechler
committed
allow debug / debugonce("<S4>")
git-svn-id: https://svn.r-project.org/R/trunk@87345 00db46b3-68df-0310-9c12-caf00c1e9a41
1 parent 53953c0 commit 64a959b

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

doc/NEWS.Rd

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,10 @@
361361

362362
\item \code{axisTicks(usr, ...)} documentation clarification for
363363
\code{log=TRUE}, fixing bug \PR{18821} thanks to Duncan Murdoch.
364+
365+
\item \code{debug()} and \code{debugonce(fun)} now also accept a
366+
string \code{fun} when it names an S4 generic, fixing \PR{18822}
367+
thanks to Michael Jagan.
364368
}
365369
}
366370
}

src/library/base/man/debug.Rd

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ isdebugged(fun, signature = NULL)
1818
debuggingState(on = NULL)
1919
}
2020
\arguments{
21-
\item{fun}{any interpreted \R function.}
21+
\item{fun}{any interpreted \R function or a character string naming
22+
one.}
2223
\item{text}{a text string that can be retrieved when the browser is entered.}
2324
\item{condition}{a condition that can be retrieved when the browser is
2425
entered.}

src/library/methods/R/debug.R

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,8 @@
22
once = FALSE)
33
{
44
stopifnot(is.null(condition), identical(text, ""))
5-
if (is.primitive(fun))
6-
fun <- getGeneric(fun)
7-
if(!is(fun, "genericFunction"))
8-
stop("Function must be an S4 generic")
9-
5+
fun <- getGeneric(fun, mustWork = TRUE)
6+
107
if(isdebugged(fun, signature = signature))
118
return(invisible(NULL))
129

0 commit comments

Comments
 (0)