Reputation: 81
How do you feature test for browser support using Dart? Things that are common to test for in Javascript. It is unfortunately still a necessary evil.
For instance, how do you write a test if the browser supports 'XMLHttpRequestUpload' so that you can fallback to supported features?
Also, how do you test for 'FileReader', 'Worker', 'ArrayBuffer', 'DataView', 'Uint8Array', 'Float32Array', ... ?
In Javascript, you can test if the objects are available in the global namespace (Window, etc).
Upvotes: 1
Views: 391
Reputation: 16261
To check if you can access the file system use the FileSystem.supported field. Similarly for workers see Worker.supported.
Since Dart targets IE9+, I think the other API's you've listed are already supported cross browser.
Upvotes: 1