You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fixing an issue with class definition in the param scope
When visiting the pnodescopes I had a check to avoid visiting the body scope as part of the param scope. The condition I was using for the check does not seem to cover all scenarios. This changelist fixes that issue.
Copy file name to clipboardExpand all lines: test/es6/default-splitscope.js
+48-2Lines changed: 48 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -250,7 +250,7 @@ var tests = [
250
250
}
251
251
},
252
252
{
253
-
name: "Split parameter scope in class methods",
253
+
name: "Split parameter scope and class",
254
254
body: function(){
255
255
classc{
256
256
f(a=10,d,b=function(){returna;},c){
@@ -315,7 +315,53 @@ var tests = [
315
315
returny;
316
316
}
317
317
}
318
-
assert.areEqual(10,(newc4()).f({})(),"The method defined as the default destructured value of the parameter should capture the formal from the param scope");
318
+
assert.areEqual(10,(newc4()).f({})(),"The method defined as the default destructured value of the parameter should capture the formal from the param scope");
assert.areEqual(10,(newb()).method1(),"Class method defined within the param scope should capture the formal from the param scope");
323
+
returnb;
324
+
}
325
+
result=f3();
326
+
assert.areEqual(10,(newresult()).method1(),"Methods defined in a class defined, after another function definition, in the param scope should capture the formals form that param scope itself");
assert.areEqual(10,(newresult()).method1(),"Methods defined in a class defined, after another class definition, in the param scope should capture the formals form that param scope itself");
assert.areEqual(10,(newresult()).method1(),"Methods defined in a class defined, after a function and class, in the param scope should capture the formals form that param scope itself");
assert.areEqual(10,(newresult()).method1(),"Methods defined in a class defined, after a split scope function, in the param scope should capture the formals form that param scope itself");
assert.areEqual(10,(newb()).method1(),"Class method defined within the param scope should capture the formal from the param scope");
352
+
returnb;
353
+
}
354
+
result=f7();
355
+
assert.areEqual(10,(newresult()).method1(),"Methods defined in a class with name defined, after another function definition, in the param scope should capture the formals form that param scope itself");
assert.areEqual(10,(newb()).method1(),"Class method defined within the param scope should capture the formal from the param scope");
360
+
returnc;
361
+
}
362
+
result=f8();
363
+
assert.areEqual(10,(newresult()).method1(),"Methods defined in a class extending another class defined, after another function definition, in the param scope should capture the formals form that param scope itself");
364
+
assert.areEqual(100,(newresult()).method2(),"Method in the derived class returns the right value");
0 commit comments