[Sciviews-commits] r408 - komodo/SciViews-K-dev/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Oct 14 16:08:05 CEST 2011


Author: prezez
Date: 2011-10-14 16:08:01 +0200 (Fri, 14 Oct 2011)
New Revision: 408

Modified:
   komodo/SciViews-K-dev/R/captureAll.R
Log:
Sciviews-K-dev:
R/captureAll.R: adjusted frame offset number for further traceback()

Modified: komodo/SciViews-K-dev/R/captureAll.R
===================================================================
--- komodo/SciViews-K-dev/R/captureAll.R	2011-10-11 21:17:51 UTC (rev 407)
+++ komodo/SciViews-K-dev/R/captureAll.R	2011-10-14 14:08:01 UTC (rev 408)
@@ -62,7 +62,7 @@
 
 	last.warning <- list()
 	Traceback <- NULL
-	NframeOffset <- sys.nframe() + 19L # frame of reference (used in traceback) +
+	NframeOffset <- sys.nframe() + 19L + 4L # frame of reference (used in traceback) +
 								 # length of the call stack when a condition
 								 # occurs
 	# Note: if 'expr' is a call not expression, 'NframeOffset' is lower by 2
@@ -110,13 +110,15 @@
 		# remove call (eval(expr, envir, enclos)) from the message
 		ncls <- length(calls)
 
-		#if(existsTemp("debugTest") && getTemp("debugTest"))		browser()
-		#cat("frame offset =", foffset, "\n")
-
 		if(isTRUE(all.equal(calls[[NframeOffset + foffset]], e$call, check.attributes=FALSE)))
 			e$call <- NULL
-		Traceback <<- rev(calls[-c(seq.int(NframeOffset + foffset), (ncls - 1L):ncls)])
 
+		cfrom <- ncls - 2L
+		cto <- NframeOffset + foffset
+
+		Traceback <<- if(cfrom < cto) list() else
+			calls[seq.int(cfrom, cto, by=-1L)]
+
 		putMark(FALSE, 1L)
 		#cat(.makeMessage(e, domain="R"))
 		cat(as.character.error(e))



More information about the Sciviews-commits mailing list