File tree 2 files changed +9
-2
lines changed
compiler/src/dotty/tools/backend/sjs
2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -3384,8 +3384,15 @@ class JSCodeGen()(using genCtx: Context) {
3384
3384
} else {
3385
3385
val captureValues = {
3386
3386
if (code == CREATE_INNER_JS_CLASS ) {
3387
+ /* Private inner classes that do not actually access their outer
3388
+ * pointer do not receive an outer argument. We therefore count
3389
+ * the number of constructors that have non-empty param list to
3390
+ * know how many times we need to pass `this`.
3391
+ */
3392
+ val requiredThisParams =
3393
+ classSym.info.decls.lookupAll(nme.CONSTRUCTOR ).count(_.info.paramInfoss.head.nonEmpty)
3387
3394
val outer = genThis()
3388
- List .fill(classSym.info.decls.lookupAll(nme. CONSTRUCTOR ).size )(outer)
3395
+ List .fill(requiredThisParams )(outer)
3389
3396
} else {
3390
3397
val fakeNewInstances = args(2 ).asInstanceOf [JavaSeqLiteral ].elems
3391
3398
fakeNewInstances.flatMap(genCaptureValuesFromFakeNewInstance(_))
Original file line number Diff line number Diff line change @@ -1109,7 +1109,6 @@ object Build {
1109
1109
++ (dir / " shared/src/test/require-jdk7" ** " *.scala" ).get
1110
1110
1111
1111
++ (dir / " js/src/test/scala" ** ((" *.scala" : FileFilter )
1112
- -- " ExportsTest.scala" // JS exports + IR checking error
1113
1112
-- " ObjectTest.scala" // compile errors caused by #9588
1114
1113
-- " StackTraceTest.scala" // would require `npm install source-map-support`
1115
1114
-- " UnionTypeTest.scala" // requires the Scala 2 macro defined in Typechecking*.scala
@@ -1126,6 +1125,7 @@ object Build {
1126
1125
Test / testOptions += Tests .Filter { name =>
1127
1126
! Set [String ](
1128
1127
" org.scalajs.testsuite.jsinterop.AsyncTest" , // needs JS exports in PromiseMock.scala
1128
+ " org.scalajs.testsuite.jsinterop.ExportsTest" , // JS exports
1129
1129
" org.scalajs.testsuite.jsinterop.JSExportStaticTest" , // JS exports
1130
1130
1131
1131
// Not investigated so far
You can’t perform that action at this time.
0 commit comments