@@ -206,7 +206,7 @@ class JSCodeGen()(using genCtx: Context) {
206
206
withScopedVars(
207
207
currentClassSym := sym
208
208
) {
209
- val tree = if (isJSType( sym) ) {
209
+ val tree = if (sym.isJSType ) {
210
210
if (! sym.is(Trait ) && sym.isNonNativeJSClass)
211
211
genNonNativeJSClass(td)
212
212
else
@@ -702,7 +702,7 @@ class JSCodeGen()(using genCtx: Context) {
702
702
Nil
703
703
} else {
704
704
val moduleClass = module.moduleClass
705
- if (! isJSType( moduleClass) )
705
+ if (! moduleClass.isJSType )
706
706
genStaticForwardersFromModuleClass(existingMembers, moduleClass)
707
707
else
708
708
Nil
@@ -1678,7 +1678,7 @@ class JSCodeGen()(using genCtx: Context) {
1678
1678
}
1679
1679
1680
1680
fun match {
1681
- case _ if isJSDefaultParam( sym) =>
1681
+ case _ if sym.isJSDefaultParam =>
1682
1682
js.Transient (UndefinedParam )(toIRType(sym.info.finalResultType))
1683
1683
1684
1684
case Select (Super (_, _), _) =>
@@ -1771,7 +1771,7 @@ class JSCodeGen()(using genCtx: Context) {
1771
1771
} else /* if (translatedAnonFunctions contains tpe.typeSymbol) {
1772
1772
val functionMaker = translatedAnonFunctions(tpe.typeSymbol)
1773
1773
functionMaker(args map genExpr)
1774
- } else*/ if (isJSType( clsSym) ) {
1774
+ } else*/ if (clsSym.isJSType ) {
1775
1775
genNewJSClass(tree)
1776
1776
} else {
1777
1777
toTypeRef(tpe) match {
@@ -2406,7 +2406,7 @@ class JSCodeGen()(using genCtx: Context) {
2406
2406
* and `-0.0`, see Javadoc (scala-dev#329, scala-js#2799).
2407
2407
*/
2408
2408
val mustUseAnyComparator : Boolean = {
2409
- isJSType( lsym) || isJSType( rsym) || {
2409
+ lsym.isJSType || rsym.isJSType || {
2410
2410
val p = ctx.platform
2411
2411
p.isMaybeBoxed(lsym) && p.isMaybeBoxed(rsym) && {
2412
2412
val areSameFinals = lsym.is(Final ) && rsym.is(Final ) && (ltpe =:= rtpe)
@@ -2603,7 +2603,7 @@ class JSCodeGen()(using genCtx: Context) {
2603
2603
2604
2604
if (isMethodStaticInIR(sym)) {
2605
2605
genApplyStatic(sym, genActualArgs(sym, args))
2606
- } else if (isJSType( sym.owner) ) {
2606
+ } else if (sym.owner.isJSType ) {
2607
2607
if (! sym.owner.isNonNativeJSClass || sym.isJSExposed)
2608
2608
genApplyJSMethodGeneric(sym, genExprOrGlobalScope(receiver), genActualJSArgs(sym, args), isStat)(tree.sourcePos)
2609
2609
else
@@ -2689,13 +2689,13 @@ class JSCodeGen()(using genCtx: Context) {
2689
2689
}
2690
2690
}
2691
2691
2692
- if (isJSGetter( sym) ) {
2692
+ if (sym.isJSGetter ) {
2693
2693
assert(noSpread && argc == 0 )
2694
2694
genSelectGet(jsFunName)
2695
- } else if (isJSSetter( sym) ) {
2695
+ } else if (sym.isJSSetter ) {
2696
2696
assert(noSpread && argc == 1 )
2697
2697
genSelectSet(jsFunName, requireNotSpread(args.head))
2698
- } else if (isJSBracketAccess( sym) ) {
2698
+ } else if (sym.isJSBracketAccess ) {
2699
2699
assert(noSpread && (argc == 1 || argc == 2 ),
2700
2700
s " @JSBracketAccess methods should have 1 or 2 non-varargs arguments " )
2701
2701
(args : @ unchecked) match {
@@ -2704,7 +2704,7 @@ class JSCodeGen()(using genCtx: Context) {
2704
2704
case List (keyArg, valueArg) =>
2705
2705
genSelectSet(requireNotSpread(keyArg), requireNotSpread(valueArg))
2706
2706
}
2707
- } else if (isJSBracketCall( sym) ) {
2707
+ } else if (sym.isJSBracketCall ) {
2708
2708
val (methodName, actualArgs) = extractFirstArg(args)
2709
2709
genCall(methodName, actualArgs)
2710
2710
} else {
@@ -3187,7 +3187,7 @@ class JSCodeGen()(using genCtx: Context) {
3187
3187
3188
3188
val sym = to.typeSymbol
3189
3189
3190
- if (sym == defn.ObjectClass || isJSType( sym) ) {
3190
+ if (sym == defn.ObjectClass || sym.isJSType ) {
3191
3191
/* asInstanceOf[Object] always succeeds, and
3192
3192
* asInstanceOf to a raw JS type is completely erased.
3193
3193
*/
@@ -3217,7 +3217,7 @@ class JSCodeGen()(using genCtx: Context) {
3217
3217
3218
3218
if (sym == defn.ObjectClass ) {
3219
3219
js.BinaryOp (js.BinaryOp .!== , value, js.Null ())
3220
- } else if (isJSType( sym) ) {
3220
+ } else if (sym.isJSType ) {
3221
3221
if (sym.is(Trait )) {
3222
3222
report.error(
3223
3223
s " isInstanceOf[ ${sym.fullName}] not supported because it is a JS trait " ,
@@ -3347,7 +3347,7 @@ class JSCodeGen()(using genCtx: Context) {
3347
3347
arg match {
3348
3348
case Literal (value) if value.tag == Constants .ClazzTag =>
3349
3349
val classSym = value.typeValue.typeSymbol
3350
- if (isJSType( classSym) && ! classSym.is(Trait ) && ! classSym.is(ModuleClass ))
3350
+ if (classSym.isJSType && ! classSym.is(Trait ) && ! classSym.is(ModuleClass ))
3351
3351
classSym
3352
3352
else
3353
3353
fail()
@@ -3999,7 +3999,7 @@ class JSCodeGen()(using genCtx: Context) {
3999
3999
} else {
4000
4000
val cls = encodeClassName(sym)
4001
4001
val tree =
4002
- if (isJSType( sym) ) js.LoadJSModule (cls)
4002
+ if (sym.isJSType ) js.LoadJSModule (cls)
4003
4003
else js.LoadModule (cls)
4004
4004
MaybeGlobalScope .NotGlobalScope (tree)
4005
4005
}
0 commit comments