Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 18ad2e7

Browse files
committed
Expose RuntimeClassNameMapper.apply to users of interface.unstable
This removes the last `private[linker]` in the linker interface.
1 parent 4971558 commit 18ad2e7

File tree

3 files changed

+23
-2
lines changed

3 files changed

+23
-2
lines changed

linker-interface/shared/src/main/scala/org/scalajs/linker/interface/Semantics.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ object Semantics {
113113
def andThen(that: RuntimeClassNameMapper): RuntimeClassNameMapper =
114114
AndThen(this, that)
115115

116-
private[linker] def apply(className: String): String = {
116+
private[interface] def apply(className: String): String = {
117117
def rec(mapper: RuntimeClassNameMapper, className: String): String = {
118118
mapper match {
119119
case KeepAll =>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/*
2+
* Scala.js (https://www.scala-js.org/)
3+
*
4+
* Copyright EPFL.
5+
*
6+
* Licensed under Apache License 2.0
7+
* (https://www.apache.org/licenses/LICENSE-2.0).
8+
*
9+
* See the NOTICE file distributed with this work for
10+
* additional information regarding copyright ownership.
11+
*/
12+
13+
package org.scalajs.linker.interface.unstable
14+
15+
import org.scalajs.linker.interface.Semantics.RuntimeClassNameMapper
16+
17+
object RuntimeClassNameMapperImpl {
18+
def map(mapper: RuntimeClassNameMapper, className: String): String =
19+
mapper(className)
20+
}

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1038,7 +1038,8 @@ private[emitter] final class ClassEmitter(jsGen: JSGen) {
10381038
val allParams = List(
10391039
js.ObjectConstr(List(js.Ident(genName(className)) -> js.IntLiteral(0))),
10401040
js.BooleanLiteral(kind == ClassKind.Interface),
1041-
js.StringLiteral(semantics.runtimeClassNameMapper(tree.fullName)),
1041+
js.StringLiteral(RuntimeClassNameMapperImpl.map(
1042+
semantics.runtimeClassNameMapper, tree.fullName)),
10421043
ancestorsRecord,
10431044
isJSTypeParam,
10441045
parentData,

0 commit comments

Comments
 (0)