Open seanburke-wf opened 5 years ago
I've found a similar behavior with window.navigator.languages
the reported type is List<String>, the actual value under DDC is List<dynamic>
.
@terrylucas - I think we'd need to either (a) statically type this as List<dynamic>
or (b) reify / tag it at runtime as List<String>
.
I've run into another API that is exhibiting similar behavior: window.performance.getEntriesByType
. The return type is expected to be List<PerformanceEntry>
, but when compiled with DDC
it returns List<dynamic>
and when compiled with dart2js
it returns JSArray
.
Though
elementsFromPoint()
is typed asList<Element>
, the actual return value under DDC isList<dynamic>
. The following repro case will produce a runtime error when run viawebdev serve
: