Skip to content

Commit cd397f4

Browse files
committed
Remove the -p/--relfProxies option of scalajsp.
Since there are no reflective proxies in sjsir files anymore, this option is obsolete.
1 parent eb1c59d commit cd397f4

File tree

3 files changed

+38
-47
lines changed

3 files changed

+38
-47
lines changed

cli/src/main/scala/org/scalajs/cli/Scalajsp.scala

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ object Scalajsp {
3131

3232
private case class Options(
3333
infos: Boolean = false,
34-
showReflProxy: Boolean = false,
3534
jar: Option[File] = None,
3635
fileNames: Seq[String] = Seq.empty)
3736

@@ -49,9 +48,6 @@ object Scalajsp {
4948
opt[Unit]('i', "infos")
5049
.action { (_, c) => c.copy(infos = true) }
5150
.text("Show DCE infos instead of trees")
52-
opt[Unit]('p', "reflProxies")
53-
.action { (_, c) => c.copy(showReflProxy = true) }
54-
.text("Show reflective call proxies")
5551
opt[Unit]('s', "supported")
5652
.action { (_,_) => printSupported(); sys.exit() }
5753
.text("Show supported Scala.js IR versions")
@@ -90,15 +86,8 @@ object Scalajsp {
9086
opts: Options): Unit = {
9187
if (opts.infos)
9288
new InfoPrinter(stdout).print(vfile.info)
93-
else {
94-
val (info, tree) = vfile.infoAndTree
95-
val outTree = {
96-
if (opts.showReflProxy) tree
97-
else filterOutReflProxies(tree)
98-
}
99-
100-
new IRTreePrinter(stdout).printTopLevelTree(outTree)
101-
}
89+
else
90+
new IRTreePrinter(stdout).printTopLevelTree(vfile.tree)
10291

10392
stdout.flush()
10493
}
@@ -141,15 +130,4 @@ object Scalajsp {
141130
private val stdout =
142131
new BufferedWriter(new OutputStreamWriter(Console.out, "UTF-8"))
143132

144-
// !!! CODE DUPLICATION with ScalaJSPluginInternal.filterOutReflProxies
145-
private def filterOutReflProxies(tree: ClassDef): ClassDef = {
146-
import ir.Trees._
147-
import ir.Definitions.isReflProxyName
148-
val newDefs = tree.defs.filter {
149-
case MethodDef(_, Ident(name, _), _, _, _) => !isReflProxyName(name)
150-
case _ => true
151-
}
152-
tree.copy(defs = newDefs)(tree.optimizerHints)(tree.pos)
153-
}
154-
155133
}

project/BinaryIncompatibilities.scala

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,44 @@ object BinaryIncompatibilities {
1212
)
1313

1414
val SbtPlugin = Seq(
15+
// private, not an issue
16+
ProblemFilters.exclude[MissingMethodProblem](
17+
"org.scalajs.sbtplugin.ScalaJSPluginInternal.org$scalajs$sbtplugin$ScalaJSPluginInternal$$filterOutReflProxies")
1518
)
1619

1720
val TestAdapter = Seq(
1821
)
1922

2023
val CLI = Seq(
24+
// private, not an issue
25+
ProblemFilters.exclude[MissingTypesProblem](
26+
"org.scalajs.cli.Scalajsp$Options$"),
27+
ProblemFilters.exclude[MissingMethodProblem](
28+
"org.scalajs.cli.Scalajsp#Options.this"),
29+
ProblemFilters.exclude[IncompatibleResultTypeProblem](
30+
"org.scalajs.cli.Scalajsp#Options.<init>$default$2"),
31+
ProblemFilters.exclude[IncompatibleResultTypeProblem](
32+
"org.scalajs.cli.Scalajsp#Options.<init>$default$3"),
33+
ProblemFilters.exclude[MissingMethodProblem](
34+
"org.scalajs.cli.Scalajsp#Options.<init>$default$4"),
35+
ProblemFilters.exclude[MissingMethodProblem](
36+
"org.scalajs.cli.Scalajsp#Options.apply"),
37+
ProblemFilters.exclude[IncompatibleResultTypeProblem](
38+
"org.scalajs.cli.Scalajsp#Options.apply$default$2"),
39+
ProblemFilters.exclude[IncompatibleResultTypeProblem](
40+
"org.scalajs.cli.Scalajsp#Options.apply$default$3"),
41+
ProblemFilters.exclude[MissingMethodProblem](
42+
"org.scalajs.cli.Scalajsp#Options.apply$default$4"),
43+
ProblemFilters.exclude[MissingMethodProblem](
44+
"org.scalajs.cli.Scalajsp#Options.copy"),
45+
ProblemFilters.exclude[IncompatibleResultTypeProblem](
46+
"org.scalajs.cli.Scalajsp#Options.copy$default$2"),
47+
ProblemFilters.exclude[IncompatibleResultTypeProblem](
48+
"org.scalajs.cli.Scalajsp#Options.copy$default$3"),
49+
ProblemFilters.exclude[MissingMethodProblem](
50+
"org.scalajs.cli.Scalajsp#Options.copy$default$4"),
51+
ProblemFilters.exclude[MissingMethodProblem](
52+
"org.scalajs.cli.Scalajsp#Options.showReflProxy")
2153
)
2254

2355
val Library = Seq(

sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/ScalaJSPluginInternal.scala

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -143,14 +143,12 @@ object ScalaJSPluginInternal {
143143

144144
private def scalajspSettings: Seq[Setting[_]] = {
145145
case class Options(
146-
infos: Boolean = false,
147-
showReflProxy: Boolean = false
146+
infos: Boolean = false
148147
)
149148

150149
val optionsParser: Parser[Options] = {
151150
token(OptSpace ~> (
152151
(literal("-i") | "--infos") ^^^ ((_: Options).copy(infos = true))
153-
| (literal("-p") | "--reflProxies") ^^^ ((_: Options).copy(showReflProxy = true))
154152
)).* map {
155153
fns => Function.chain(fns)(Options())
156154
}
@@ -182,32 +180,15 @@ object ScalaJSPluginInternal {
182180
val vfile = ScalajspUtils.loadIRFile(cp, relPath)
183181

184182
val stdout = new java.io.PrintWriter(System.out)
185-
if (options.infos) {
183+
if (options.infos)
186184
new InfoPrinter(stdout).print(vfile.info)
187-
} else {
188-
val (info, tree) = vfile.infoAndTree
189-
val outTree = {
190-
if (options.showReflProxy) tree
191-
else filterOutReflProxies(tree)
192-
}
193-
new IRTreePrinter(stdout).printTopLevelTree(outTree)
194-
}
185+
else
186+
new IRTreePrinter(stdout).printTopLevelTree(vfile.tree)
195187
stdout.flush()
196188
}
197189
)
198190
}
199191

200-
// !!! CODE DUPLICATION with Scalajsp.filterOutReflProxies
201-
private def filterOutReflProxies(tree: ir.Trees.ClassDef): ir.Trees.ClassDef = {
202-
import ir.Trees._
203-
import ir.Definitions.isReflProxyName
204-
val newDefs = tree.defs.filter {
205-
case MethodDef(_, Ident(name, _), _, _, _) => !isReflProxyName(name)
206-
case _ => true
207-
}
208-
tree.copy(defs = newDefs)(tree.optimizerHints)(tree.pos)
209-
}
210-
211192
val scalaJSConfigSettings: Seq[Setting[_]] = Seq(
212193
incOptions ~= scalaJSPatchIncOptions
213194
) ++ (

0 commit comments

Comments
 (0)