@@ -2368,10 +2368,10 @@ class JSCodeGen()(using genCtx: Context) {
2368
2368
// Construct inline class definition
2369
2369
2370
2370
val jsClassCaptures = originalClassDef.jsClassCaptures.getOrElse {
2371
- throw new AssertionError (s " no class captures for anonymous JS class at $pos" )
2371
+ ctx.implode (s " no class captures for anonymous JS class at $pos" )
2372
2372
}
2373
2373
val js .JSConstructorDef (_, ctorParams, ctorRestParam, ctorBody) = constructor.getOrElse {
2374
- throw new AssertionError (" No ctor found" )
2374
+ ctx.implode (" No ctor found" )
2375
2375
}
2376
2376
assert(ctorParams.isEmpty && ctorRestParam.isEmpty,
2377
2377
s " non-empty constructor params for anonymous JS class at $pos" )
@@ -2396,17 +2396,17 @@ class JSCodeGen()(using genCtx: Context) {
2396
2396
2397
2397
val memberDefinitions0 = instanceMembers.toList.map {
2398
2398
case fdef : js.FieldDef =>
2399
- throw new AssertionError (" unexpected FieldDef" )
2399
+ ctx.implode (" unexpected FieldDef" )
2400
2400
2401
2401
case fdef : js.JSFieldDef =>
2402
2402
implicit val pos = fdef.pos
2403
2403
js.Assign (js.JSSelect (selfRef, fdef.name), jstpe.zeroOf(fdef.ftpe))
2404
2404
2405
2405
case mdef : js.MethodDef =>
2406
- throw new AssertionError (" unexpected MethodDef" )
2406
+ ctx.implode (" unexpected MethodDef" )
2407
2407
2408
2408
case cdef : js.JSConstructorDef =>
2409
- throw new AssertionError (" unexpected JSConstructorDef" )
2409
+ ctx.implode (" unexpected JSConstructorDef" )
2410
2410
2411
2411
case mdef : js.JSMethodDef =>
2412
2412
implicit val pos = mdef.pos
@@ -2773,7 +2773,7 @@ class JSCodeGen()(using genCtx: Context) {
2773
2773
if (from == to || from == jstpe.NothingType ) {
2774
2774
value
2775
2775
} else if (from == jstpe.BooleanType || to == jstpe.BooleanType ) {
2776
- throw new AssertionError (s " Invalid genConversion from $from to $to" )
2776
+ ctx.implode (s " Invalid genConversion from $from to $to" )
2777
2777
} else {
2778
2778
def intValue = (from : @ unchecked) match {
2779
2779
case jstpe.IntType => value
@@ -3134,7 +3134,7 @@ class JSCodeGen()(using genCtx: Context) {
3134
3134
case value :: Nil =>
3135
3135
genSelectSet(genExpr(jsName), value)
3136
3136
case _ =>
3137
- throw new AssertionError (s " property methods should have 0 or 1 non-varargs arguments at $pos" )
3137
+ ctx.implode (s " property methods should have 0 or 1 non-varargs arguments at $pos" )
3138
3138
}
3139
3139
3140
3140
case JSCallingConvention .BracketAccess =>
@@ -3144,7 +3144,7 @@ class JSCodeGen()(using genCtx: Context) {
3144
3144
case keyArg :: valueArg :: Nil =>
3145
3145
genSelectSet(keyArg, valueArg)
3146
3146
case _ =>
3147
- throw new AssertionError (s " @JSBracketAccess methods should have 1 or 2 non-varargs arguments at $pos" )
3147
+ ctx.implode (s " @JSBracketAccess methods should have 1 or 2 non-varargs arguments at $pos" )
3148
3148
}
3149
3149
3150
3150
case JSCallingConvention .BracketCall =>
@@ -3238,7 +3238,7 @@ class JSCodeGen()(using genCtx: Context) {
3238
3238
s " Trying to call the super constructor of Object in a non-native JS class at $pos" )
3239
3239
genApplyMethod(genReceiver, sym, genScalaArgs)
3240
3240
} else if (sym.isClassConstructor) {
3241
- throw new AssertionError (
3241
+ ctx.implode (
3242
3242
s " calling a JS super constructor should have happened in genPrimaryJSClassCtor at $pos" )
3243
3243
} else if (sym.owner.isNonNativeJSClass && ! sym.isJSExposed) {
3244
3244
// Reroute to the static method
@@ -3358,7 +3358,7 @@ class JSCodeGen()(using genCtx: Context) {
3358
3358
3359
3359
clauses = clauses.reverse
3360
3360
val defaultClause = optDefaultClause.getOrElse {
3361
- throw new AssertionError (" No elseClause in pattern match" )
3361
+ ctx.implode (" No elseClause in pattern match" )
3362
3362
}
3363
3363
3364
3364
/* Builds a `js.Match`, but simplifies it to a `js.If` if there is only
0 commit comments