aboutsummaryrefslogtreecommitdiff
path: root/sjs/tools/dotc/config/SJSPlatform.scala
blob: 3ec8049aeb5b6f27025cb864b2b1f4591d2af1b3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
package dotty.tools.dotc.config

import dotty.tools.dotc.core._
import Contexts._
import Symbols._

import dotty.tools.backend.sjs.JSDefinitions

class SJSPlatform()(implicit ctx: Context) extends JavaPlatform {

  /** Scala.js-specific definitions. */
  val jsDefinitions: JSDefinitions = new JSDefinitions()

  /** Is the SAMType `cls` also a SAM under the rules of the Scala.js back-end? */
  override def isSam(cls: ClassSymbol)(implicit ctx: Context): Boolean =
    defn.isFunctionClass(cls) || jsDefinitions.isJSFunctionClass(cls)

}