This records the actual point at which type inference fails and uses that to give a better error message. So where before we would say:
severe: line 76, column 38 of package:angular2/src/forms/directives.dart: [StaticTypeError] Type check failed: [c.validator, this.validator] (List<dynamic>) is not of type List<Function>
c.validator = validators.compose([c.validator, this.validator]);
we will now in addition say:
because c.validator cannot be typed as Function
BUG=
R=vsm@google.com
Review URL: https://codereview.chromium.org/1056183002
cleaner since we only worry about it in one place, and the "this" check is easier and more precise now.
incidentally, I saw a CL go by on the V8 bug, looks like it's close to being fixed
R=jacobr@google.com
Review URL: https://codereview.chromium.org/1052693004
This is a first cut at downwards inference. The interaction with InferableLiteral etc isn't well sorted out yet, so while downwards inference on nested expressions works, there will currently be spurious warnings.
BUG=
R=vsm@google.com
Review URL: https://codereview.chromium.org/1038213003
* static methods qualified properly
* static method privacy is now enforced
* avoid static method names banned in strict mode
* avoid variable names banned in strict mode
We might want to relax privacy (for both instance and static), but for now it's nice and consistent with instance methods using ES6 Symbol
R=jacobr@google.com
Review URL: https://codereview.chromium.org/1034273003
Also changes Printer to not walk the tree an extra time unless we are minifiying.
The tree structure appears to be helping VarCollector, by encoding some information into the static AST structure. (although some aspects were unused, such as function names). It's easy enough to encode this behavior in VarCollector itself. Having a unified Identifier benefits our tree transform, since we don't need to worry about generating three different types of things under largely identical circumstances.
I'm planning to build on this later, but this version is purely a refactor.
R=vsm@google.com
Review URL: https://codereview.chromium.org/1029583011
This breaks out casts / coercions into:
Standard (on by default)
- DynamicCasts: dynamic -> T
- AssignmentCasts: T x = expr; // T must be a ground type
Inference (this will go away)
- InferableLiteral
- InferableClosure
- InferableAllocation
Implicit (no flag yet, but i'll add to disable by default)
- DownCastComposite: Any cast to a non-ground type
- DownCastImplicit: Any other implicit downcast not covered above
A flag is also added to enable/disable all wrapping. This is not off by default yet, but that is the intent.
R=leafp@google.com
Review URL: https://codereview.chromium.org/1038583004
This was added to our version, while still figuring out js_ast. As it is now, Printer handles property names quite well on its own, so the extra AST node doesn't add anything.
R=vsm@google.com
Review URL: https://codereview.chromium.org/1030243002
this also starts using compiled code in dart_core.js (just copy+paste for Object)
visitClassDeclaration was getting rather long, so it's now refactored to make the flow more clear.
R=sigmund@google.com
Review URL: https://codereview.chromium.org/1016003003
assumes the Source class exists, even when the file has not been created, we
consider that by default the file will be created on the location for the first
of the searchPaths)
R=vsm@google.com
Review URL: https://codereview.chromium.org/1001563003