File tree 1 file changed +12
-6
lines changed
compiler/src/dotty/tools/backend/sjs 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) {
104
104
}
105
105
}
106
106
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
+
107
118
private def acquireContextualJSClassValue [A ](f : Option [js.Tree ] => A ): A = {
108
119
val jsClassValue = contextualJSClassValue.get
109
120
withScopedVars(
@@ -1039,12 +1050,7 @@ class JSCodeGen()(using genCtx: Context) {
1039
1050
val vparamss = dd.termParamss
1040
1051
val rhs = dd.rhs
1041
1052
1042
- withScopedVars(
1043
- currentMethodSym := sym,
1044
- undefinedDefaultParams := mutable.Set .empty,
1045
- thisLocalVarIdent := None ,
1046
- isModuleInitialized := new ScopedVar .VarBox (false )
1047
- ) {
1053
+ withPerMethodBodyState(sym) {
1048
1054
assert(vparamss.isEmpty || vparamss.tail.isEmpty,
1049
1055
" Malformed parameter list: " + vparamss)
1050
1056
val params = if (vparamss.isEmpty) Nil else vparamss.head.map(_.symbol)
You can’t perform that action at this time.
0 commit comments