There's some changes in strong mode errors we may want to follow up on.
Unforks the following: async, collection, convert, core, developer, internal, io, isolate, math, mirrors.
Does not unfork: html, indexed_db, js, js_util, svg, typed_data, web_audio, web_gl, web_sql.
R=vsm@google.com
Review-Url: https://codereview.chromium.org/2698353003 .
Just creating an Error object is sufficient on FF,
Chrome, Safari, and Edge. Note that captureStackTrace
was not supported by other browsers so those browsers
were going down the even slower path of throwing an
exception.
BUG=
R=vsm@google.com
Review-Url: https://codereview.chromium.org/2668503002 .
When I'm looking at the dynamic call profiles of an internal app test,
I see a bunch coming from the SDK itself. In fact, the top five most
common dynamic call sites are in the SDK.
This fixes four of them. (The fifth is in runUnary() in Zone, and I
don't think can be made typed yet.)
R=vsm@google.com
Review URL: https://codereview.chromium.org/2542723003 .
Really, this works around them, but the workaround is all round better
code.
Remove the Dart implementations of min() and max() and just forward to
the JS ones. In DDC, all numbers are double, so the type checks to
handle them specifically aren't meaningful. Also, we don't need the
other special case checks in there to help dart2js optimize them.
R=vsm@google.com
Review URL: https://codereview.chromium.org/2386493003 .
Added 'tag' type StrongModeError, implemented by all errors that are
specific to strong mode semantics.
Failed casts throw CastError(Implementation) or StrongModeCastError.
Failed type assertions and reified coercions throw TypeError or
StrongModeTypeError.
Triaged some tests. Some pass due to now throwing a TypeError, many
pass for unknown reasons.
R=leafp@google.com
Review URL: https://codereview.chromium.org/2026133002 .
We initially hard coded a few of these. That worked until native_typed_data and html were added. Those two libraries have a lot of native types.
This also fixes TypeRep to extend dart:core Object, and fixes the dart:_runtime so we can write Dart classes. Cleans up a few of the JS builtins as well.
R=vsm@google.com
Review URL: https://codereview.chromium.org/1962823002 .
I started trying to get the convert tests all cleaned up and passing
but realized I was going down a rathole. So, for now, all of the slow
or failing ones are just skipped.
BUG=
R=sra@google.com
Review URL: https://codereview.chromium.org/1965563003 .
- Instead of using the raw runtime type that DDC uses for its type
checks, use a WrappedType that correctly implements Type's interface.
- Compile class literals to wrap the type in a WrappedType.
- Make Object.runtimeType() do the same thing.
Fixes#488. Fixes#511.
R=jmesserly@google.com
Review URL: https://codereview.chromium.org/1944483002 .
fixes#138, extension methods for Iterable/List injected as needed, regardless of how the methods started
fixes#142, extension methods and dynamic dispatch
small change that fixes#139, recognize that '.length' doesn't need an extension method
Also restores JSArray, moved the methods out of List, which is back to just being an interface.
NOTE: this removes the capability of types that mix native JS members and some Dart extension members, instead it now *hides* all JS members for these native types. We'll want to bring that feature back to support dart:html, so it's just a simplification for now. Should be easy to add that capability when we pull in dart:html for reals.
R=leafp@google.com, vsm@google.com
Review URL: https://codereview.chromium.org/1153003003
Tightens up some typing issues (mostly in the collections) to eliminate some casts and dynamic calls. Also adds inference through parenthesized expressions.
BUG=
R=vsm@google.com
Review URL: https://codereview.chromium.org/1122313002
This fixes all of the static errors from generating the SDK except those in the _interceptors library, and a set of errors associated with checks of the form (v is E) for generic type parameter E. Most of the fixes consist of adding missing generic parameters, or making overrides consistent. There are a few fixes to resolve issues around code that moved implicitly between hidden implementation classes and their public API classes, and some other miscellaneous fixes.
All of my changes are in the tool/input_sdk directory - the rest of the diff is generated code.
BUG=
R=vsm@google.com
Review URL: https://codereview.chromium.org/1112403004