8000 Do not abuse a block to group instance tests · scala-js/scala-js@28b1b65 · GitHub
[go: up one dir, main page]

Skip to content

Commit 28b1b65

Browse files
committed
Do not abuse a block to group instance tests
This was forgotten in 1982a6b.
1 parent 78f1c4d commit 28b1b65

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

linker/shared/src/main/scala/org/scalajs/linker/backend/emitter/ClassEmitter.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -683,12 +683,12 @@ private[emitter] final class ClassEmitter(sjsGen: SJSGen) {
683683

684684
def genInstanceTests(className: ClassName, kind: ClassKind)(
685685
implicit moduleContext: ModuleContext,
686-
globalKnowledge: GlobalKnowledge, pos: Position): WithGlobals[js.Tree] = {
686+
globalKnowledge: GlobalKnowledge, pos: Position): WithGlobals[List[js.Tree]] = {
687687
for {
688688
single <- genSingleInstanceTests(className, kind)
689689
array <- genArrayInstanceTests(className)
690690
} yield {
691-
js.Block(single ::: array)
691+
single ::: array
692692
}
693693
}
694694

linker/shared/src/main/scala/org/scalajs/linker/backend/emitter/Emitter.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,7 @@ final class Emitter(config: Emitter.Config) {
595595
*/
596596

597597
if (classEmitter.needInstanceTests(linkedClass)(classCache)) {
598-
main += extractWithGlobals(classTreeCache.instanceTests.getOrElseUpdate(
598+
main ++= extractWithGlobals(classTreeCache.instanceTests.getOrElseUpdate(
599599
classEmitter.genInstanceTests(className, kind)(moduleContext, classCache, linkedClass.pos)))
600600
}
601601

@@ -1035,7 +1035,7 @@ object Emitter {
10351035

10361036
private final class DesugaredClassCache {
10371037
val privateJSFields = new OneTimeCache[WithGlobals[List[js.Tree]]]
1038-
val instanceTests = new OneTimeCache[WithGlobals[js.Tree]]
1038+
val instanceTests = new OneTimeCache[WithGlobals[List[js.Tree]]]
10391039
val typeData = new OneTimeCache[WithGlobals[List[js.Tree]]]
10401040
val setTypeData = new OneTimeCache[js.Tree]
10411041
val moduleAccessor = new OneTimeCache[WithGlobals[List[js.Tree]]]

0 commit comments

Comments
 (0)
0