JSEncoding
Encoding of symbol names for JavaScript
Some issues that this encoding solves:
- Overloading: encode the full signature in the JS name
- Same scope for fields and methods of a class
- Global access to classes and modules (by their full name)
Attributes
- Authors:
Sébastien Doeraene
- Graph
- Supertypes
- Self type
- JSEncoding.type
Members list
Type members
Classlikes
Attributes
- Graph
- Supertypes
Value members
Concrete methods
Patches the result type of a method symbol to sanitize it.
Patches the result type of a method symbol to sanitize it.
For some reason, dotc thinks that the info.resultType
of an
isConstructor
method (for classes or traits) is the enclosing class
or trait, but the bodies and usages act as if the result type was Unit
.
This method returns UnitType
for constructor methods, and otherwise
sym.info.resultType
.
Attributes
Converts a general TypeRef to a TypeRef to be used in a method signature.
Converts a general TypeRef to a TypeRef to be used in a method signature.
Attributes
Concrete fields
Name of the capture param storing the JS super class.
Name of the capture param storing the JS super class.
This is used by the dispatchers of exposed JS methods and properties of
nested JS classes when they need to perform a super call. Other super
calls (in the actual bodies of the methods, not in the dispatchers) do
not use this value, since they are implemented as static methods that do
not have access to it. Instead, they get the JS super class value through
the magic method inserted by ExplicitLocalJS
, leveraging lambdalift
to ensure that it is properly captured.
Using this identifier is only allowed if it was reserved in the current local name scope using reserveLocalName. Otherwise, this name can clash with another local identifier.