File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed
compiler/src/dotty/tools/backend/sjs Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -104,6 +104,17 @@ class JSCodeGen()(using genCtx: Context) {
104104 }
105105 }
106106
107+ private def withPerMethodBodyState [A ](methodSym : Symbol )(body : => A ): A = {
108+ withScopedVars(
109+ currentMethodSym := methodSym,
110+ thisLocalVarIdent := None ,
111+ isModuleInitialized := new ScopedVar .VarBox (false ),
112+ undefinedDefaultParams := mutable.Set .empty,
113+ ) {
114+ body
115+ }
116+ }
117+
107118 private def acquireContextualJSClassValue [A ](f : Option [js.Tree ] => A ): A = {
108119 val jsClassValue = contextualJSClassValue.get
109120 withScopedVars(
@@ -1039,12 +1050,7 @@ class JSCodeGen()(using genCtx: Context) {
10391050 val vparamss = dd.termParamss
10401051 val rhs = dd.rhs
10411052
1042- withScopedVars(
1043- currentMethodSym := sym,
1044- undefinedDefaultParams := mutable.Set .empty,
1045- thisLocalVarIdent := None ,
1046- isModuleInitialized := new ScopedVar .VarBox (false )
1047- ) {
1053+ withPerMethodBodyState(sym) {
10481054 assert(vparamss.isEmpty || vparamss.tail.isEmpty,
10491055 " Malformed parameter list: " + vparamss)
10501056 val params = if (vparamss.isEmpty) Nil else vparamss.head.map(_.symbol)
You can’t perform that action at this time.
0 commit comments