Commit b4ab28f
[vm/bytecode] Do not declare receiver variable in closures
While 'this' variable (receiver) is in scope in closures inside
instance methods, closures do not take it as a parameter and they
shouldn't declare a local variable for receiver unless it's captured.
Fixes #38743
Fixes #39285
Change-Id: Ic5c735fd50457a5fb39acb3ec3590964e4dddba3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124825
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>1 parent cd6dbad commit b4ab28f
File tree
2 files changed
+27
-1
lines changed- pkg/vm/lib/bytecode
- runtime/tests/vm/dart
2 files changed
+27
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1964 | 1964 | | |
1965 | 1965 | | |
1966 | 1966 | | |
1967 | | - | |
| 1967 | + | |
| 1968 | + | |
1968 | 1969 | | |
1969 | 1970 | | |
1970 | 1971 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
0 commit comments