Commit ca7dd96
[dart2js] fix crash in program emitter
The emitter creates classes in bulk, and then later connects them together
except for adding stubs for JS-interop is checks. We assumed the class for
JavaScriptObject was previously created and stored stubs eagerly while creating
classes.
We believe this caused a crash with flutter because the class was not yet
defined in that case.
One theory why this wasn't hit as much externally is that we sort classes by
location and process dart:* classes first. Flutter is the first use case where
JS-interop classes can be defined within SDK libraries.
Fixes #42612
Fixes #25517
Change-Id: Icad0a9a16ec0d05481ed60f581a23c9eeb1ed5d3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153943
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Stephen Adams <sra@google.com>1 parent 16e607e commit ca7dd96
File tree
1 file changed
+5
-3
lines changed- pkg/compiler/lib/src/js_emitter/program_builder
1 file changed
+5
-3
lines changedLines changed: 5 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
| 166 | + | |
| 167 | + | |
166 | 168 | | |
167 | 169 | | |
168 | 170 | | |
| |||
492 | 494 | | |
493 | 495 | | |
494 | 496 | | |
| 497 | + | |
| 498 | + | |
495 | 499 | | |
496 | 500 | | |
497 | 501 | | |
| |||
750 | 754 | | |
751 | 755 | | |
752 | 756 | | |
753 | | - | |
754 | | - | |
755 | | - | |
| 757 | + | |
756 | 758 | | |
757 | 759 | | |
758 | 760 | | |
| |||
0 commit comments