Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4e3a9f2

Browse files
committed
Minify core (internal) property names to one letter each.
1 parent 5b29dcb commit 4e3a9f2

File tree

6 files changed

+236
-134
lines changed

6 files changed

+236
-134
lines changed

linker/shared/src/main/scala/org/scalajs/linker/backend/emitter/ClassEmitter.scala

+6-6
Original file line numberDiff line numberDiff line change
@@ -709,7 +709,7 @@ private[emitter] final class ClassEmitter(sjsGen: SJSGen) {
709709
!(!(
710710
genIsScalaJSObject(obj) &&
711711
genIsClassNameInAncestors(className,
712-
obj DOT "$classData" DOT "ancestors")
712+
obj DOT cpn.classData DOT cpn.ancestors)
713713
))
714714
}
715715

@@ -785,9 +785,9 @@ private[emitter] final class ClassEmitter(sjsGen: SJSGen) {
785785
globalFunctionDef(VarField.isArrayOf, className, List(objParam, depthParam), None, {
786786
js.Return(!(!({
787787
genIsScalaJSObject(obj) &&
788-
((obj DOT "$classData" DOT "arrayDepth") === depth) &&
788+
((obj DOT cpn.classData DOT cpn.arrayDepth) === depth) &&
789789
genIsClassNameInAncestors(className,
790-
obj DOT "$classData" DOT "arrayBase" DOT "ancestors")
790+
obj DOT cpn.classData DOT cpn.arrayBase DOT cpn.ancestors)
791791
})))
792792
})
793793
}
@@ -818,7 +818,7 @@ private[emitter] final class ClassEmitter(sjsGen: SJSGen) {
818818

819819
private def genIsScalaJSObject(obj: js.Tree)(implicit pos: Position): js.Tree = {
820820
import TreeDSL._
821-
obj && (obj DOT "$classData")
821+
obj && (obj DOT cpn.classData)
822822
}
823823

824824
private def genIsClassNameInAncestors(className: ClassName,
@@ -919,7 +919,7 @@ private[emitter] final class ClassEmitter(sjsGen: SJSGen) {
919919
val prunedParams =
920920
allParams.reverse.dropWhile(_.isInstanceOf[js.Undefined]).reverse
921921

922-
val typeData = js.Apply(js.New(globalVar(VarField.TypeData, CoreVar), Nil) DOT "initClass",
922+
val typeData = js.Apply(js.New(globalVar(VarField.TypeData, CoreVar), Nil) DOT cpn.initClass,
923923
prunedParams)
924924

925925
globalVarDef(VarField.d, className, typeData)
@@ -931,7 +931,7 @@ private[emitter] final class ClassEmitter(sjsGen: SJSGen) {
931931
globalKnowledge: GlobalKnowledge, pos: Position): js.Tree = {
932932
import TreeDSL._
933933

934-
globalVar(VarField.c, className).prototype DOT "$classData" := globalVar(VarField.d, className)
934+
globalVar(VarField.c, className).prototype DOT cpn.classData := globalVar(VarField.d, className)
935935
}
936936

937937
def genModuleAccessor(className: ClassName, isJSClass: Boolean)(

0 commit comments

Comments
 (0)