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 @@ -1101,7 +1101,6 @@ object Build {
1101
1101
++ (dir / " shared/src/test/require-jdk7" ** " *.scala" ).get
1102
1102
1103
1103
++ (dir / " js/src/test/scala" ** ((" *.scala" : FileFilter )
1104
- -- " ExportsTest.scala" // JS exports + IR checking error
1105
1104
-- " ObjectTest.scala" // compile errors caused by #9588
1106
1105
-- " StackTraceTest.scala" // would require `npm install source-map-support`
1107
1106
-- " UnionTypeTest.scala" // requires the Scala 2 macro defined in Typechecking*.scala
@@ -1118,6 +1117,7 @@ object Build {
1118
1117
Test / testOptions += Tests .Filter { name =>
1119
1118
! Set [String ](
1120
1119
" org.scalajs.testsuite.jsinterop.AsyncTest" , // needs JS exports in PromiseMock.scala
1120
+ " org.scalajs.testsuite.jsinterop.ExportsTest" , // JS exports
1121
1121
" org.scalajs.testsuite.jsinterop.JSExportStaticTest" , // JS exports
1122
1122
1123
1123
// Not investigated so far
You can’t perform that action at this time.
0 commit comments