VM and Dartium don't respect @lazy and DeferredLibrary #10171
Labels
area-vm
Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.
closed-obsolete
Closed as the reported issue is no longer relevant
type-enhancement
A request for a change that isn't a bug
This issue was originally filed by @sethladd
Consider this code:
import 'dart:html';
import 'dart:async';
@lazy
import 'reverser.dart';
const lazy = const DeferredLibrary('reverser', uri: './part.js');
void main() {
print('in main');
new Timer(const Duration(seconds:3), () {
lazy.load().then((_) {
print('library loaded');
query("#sample_text_id")
..text = "Click me!"
..onClick.listen(reverseText);
});
});
}
void reverseText(MouseEvent event) {
query("#sample_text_id").text = reverse(query("#sample_text_id").text);
}
In the network panel of Dev Tools, I see the request for reverser.dart immediately on page load. I was expecting now to see the request until after the Timer fires.
The text was updated successfully, but these errors were encountered: