diff options
author | Antoine Gourlay <antoine@gourlay.fr> | 2013-08-18 17:38:53 +0200 |
---|---|---|
committer | Antoine Gourlay <antoine@gourlay.fr> | 2013-08-18 17:38:53 +0200 |
commit | 654fdb1f84ffff2c5b3c0b0eabc1fdd3946eec83 (patch) | |
tree | f57e6ac97830a37c0dc04ee2929aa6ef18d47e9d /src/repl/scala/tools/nsc/interpreter/IMain.scala | |
parent | 6db8a523e32c093c70b27797628bacbda78b81bb (diff) | |
download | scala-654fdb1f84ffff2c5b3c0b0eabc1fdd3946eec83.tar.gz scala-654fdb1f84ffff2c5b3c0b0eabc1fdd3946eec83.tar.bz2 scala-654fdb1f84ffff2c5b3c0b0eabc1fdd3946eec83.zip |
SI-6507 completely sidestep handlers in REPL when :silent in on
This is a cleanup of 6db8a52, the original fix for SI-6507.
When the REPL is :silent, all handlers are ignored when it comes to
generating the printed result. The result extraction code (`lazy val
resN = ...`) is still generated, but now it isn't called until the
user calls it.
Diffstat (limited to 'src/repl/scala/tools/nsc/interpreter/IMain.scala')
-rw-r--r-- | src/repl/scala/tools/nsc/interpreter/IMain.scala | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/repl/scala/tools/nsc/interpreter/IMain.scala b/src/repl/scala/tools/nsc/interpreter/IMain.scala index b35f71aeef..6d921ed987 100644 --- a/src/repl/scala/tools/nsc/interpreter/IMain.scala +++ b/src/repl/scala/tools/nsc/interpreter/IMain.scala @@ -838,8 +838,6 @@ class IMain(@BeanProperty val factory: ScriptEngineFactory, initialSettings: Set def imports = importedSymbols def value = Some(handlers.last) filter (h => h.definesValue) map (h => definedSymbols(h.definesTerm.get)) getOrElse NoSymbol - val printResults = IMain.this.printResults - val lineRep = new ReadEvalPrint() private var _originalLine: String = null @@ -948,7 +946,8 @@ class IMain(@BeanProperty val factory: ScriptEngineFactory, initialSettings: Set } // compile the result-extraction object - withoutWarnings(lineRep compile ResultObjectSourceCode(handlers)) + val handls = if (printResults) handlers else Nil + withoutWarnings(lineRep compile ResultObjectSourceCode(handls)) } } |