diff options
author | Sébastien Doeraene <sjrdoeraene@gmail.com> | 2016-03-07 14:46:45 +0100 |
---|---|---|
committer | Sébastien Doeraene <sjrdoeraene@gmail.com> | 2016-03-10 18:01:45 +0100 |
commit | d0dd7001f0b59ed53f0778530328b3bf413587a2 (patch) | |
tree | 4a3ad96313026973543edcb7e3d2e15751580b0d /src/dotty/tools/dotc/config/SJSPlatform.scala | |
parent | c14c9c096d09d9e21f1fd4ec27e6b416db01512f (diff) | |
download | dotty-d0dd7001f0b59ed53f0778530328b3bf413587a2.tar.gz dotty-d0dd7001f0b59ed53f0778530328b3bf413587a2.tar.bz2 dotty-d0dd7001f0b59ed53f0778530328b3bf413587a2.zip |
Implement most of the Scala.js IR code generator.
Notable things that are missing at this point:
* Pattern matching
* Try
* Most of the JavaScript interop
Diffstat (limited to 'src/dotty/tools/dotc/config/SJSPlatform.scala')
-rw-r--r-- | src/dotty/tools/dotc/config/SJSPlatform.scala | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/dotty/tools/dotc/config/SJSPlatform.scala b/src/dotty/tools/dotc/config/SJSPlatform.scala index fec9c25a1..3ec8049ae 100644 --- a/src/dotty/tools/dotc/config/SJSPlatform.scala +++ b/src/dotty/tools/dotc/config/SJSPlatform.scala @@ -2,6 +2,7 @@ package dotty.tools.dotc.config import dotty.tools.dotc.core._ import Contexts._ +import Symbols._ import dotty.tools.backend.sjs.JSDefinitions @@ -10,4 +11,8 @@ 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) + } |