trait
Any extends AnyRef
Value Members
-
-
final
def
##(): Int
-
def
+(other: String): String
-
def
->[B](y: B): (Any, B)
-
-
final
def
asInstanceOf[T0]: T0
-
def
clone(): AnyRef
-
-
def
ensuring(cond: (Any) ⇒ Boolean): Any
-
-
def
ensuring(cond: Boolean): Any
-
-
-
def
finalize(): Unit
-
def
formatted(fmtstr: String): String
-
final
def
getClass(): Class[_]
-
def
hashCode(): Int
-
final
def
isInstanceOf[T0]: Boolean
-
-
final
def
notify(): Unit
-
final
def
notifyAll(): Unit
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
-
def
toString(): String
-
final
def
wait(): Unit
-
final
def
wait(arg0: Long, arg1: Int): Unit
-
final
def
wait(arg0: Long): Unit
-
def
→[B](y: B): (Any, B)
Inherited by implicit conversion any2stringadd from
Any to any2stringadd[Any]
Inherited by implicit conversion StringFormat from
Any to StringFormat[Any]
Inherited by implicit conversion Ensuring from
Any to Ensuring[Any]
Inherited by implicit conversion ArrowAssoc from
Any to ArrowAssoc[Any]
Root of the hierarchy of JavaScript types.
Subtypes of js.Any are JavaScript types, which have different semantics and guarantees than Scala types (subtypes of AnyRef and AnyVal). Operations on JavaScript types behave as the corresponding operations in the JavaScript language.
By default, JavaScript types are native: they are facade types to APIs implemented in JavaScript code. Their implementation is irrelevant and never emitted. As such, all members must be defined with their right-hand-side being js.native. For forward source compatibility with the next major version, the class/trait/object itself should be annotated with @js.native. This becomes mandatory with the compiler option
-P:scalajs:sjsDefinedByDefault
.In most cases, you should not directly extend this trait, but rather extend js.Object.
To implement a JavaScript type in Scala.js (therefore non-native), you must add
-P:scalajs:sjsDefinedByDefault
to your scalac options. Scala.js-defined JS types cannot directly extend native JS traits; and Scala.js-defined JS traits cannot declare concrete term members.It is not possible to define traits or classes that inherit both from this trait and a strict subtype of AnyRef. In fact, you should think of js.Any as a third direct subclass of scala.Any, besides scala.AnyRef and scala.AnyVal.
See the JavaScript interoperability guide of Scala.js for more details.