diff options
Diffstat (limited to 'compiler/sjs/tools/dotc')
-rw-r--r-- | compiler/sjs/tools/dotc/config/SJSPlatform.scala | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/compiler/sjs/tools/dotc/config/SJSPlatform.scala b/compiler/sjs/tools/dotc/config/SJSPlatform.scala new file mode 100644 index 000000000..3ec8049ae --- /dev/null +++ b/compiler/sjs/tools/dotc/config/SJSPlatform.scala @@ -0,0 +1,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) + +} |