Commit Graph

981 Commits

Author SHA1 Message Date
Olivier Chafik 8ebe4c8a09 Merge pull request #286 from dart-lang/closure-annotations
Output Closure annotations when --closure (very experimental feature)
2015-09-02 18:34:54 +01:00
John Messerly 798076dbc8 make build_sdk more incremental
saves about 3s off a typical rebuild where nothing changed

R=vsm@google.com

Review URL: https://codereview.chromium.org/1327573002 .
2015-09-02 08:43:00 -07:00
Vijay Menon b0abb3b302 Some preliminary support for quasi-generics
This just expands John's earlier hack on min/max.  No downward
inference, etc, but it captures some simple cases.  Worthwhile?

Testing whether this makes much of a difference on our larger code bases.

R=jmesserly@google.com, leafp@google.com

Review URL: https://codereview.chromium.org/1317933005 .
2015-08-31 09:56:41 -07:00
John Messerly 9c832d6a6b makes tests faster, see #304
this doesn't completely address the issue, but it knocks off some of the time.
also attempt to stabilize error message order.

R=vsm@google.com

Review URL: https://codereview.chromium.org/1321103002 .
2015-08-28 10:14:16 -07:00
Olivier Chafik 59cf5dd893 Output some basic type annotations for the Closure Compiler when --closure is set. 2015-08-27 16:30:20 +01:00
Vijay Menon 604b199ed3 Make implicit casts hints
This appears to cut out about 1/3 of the strong mode errors reported
in angular2.  The actual cases removed that I looked at seem fine - e.g., we may inject an implicit cast, but it'll work fine at runtime.

Fixes #302

R=leafp@google.com

Review URL: https://codereview.chromium.org/1310053005 .
2015-08-26 15:01:59 -07:00
Vijay Menon 50eb282f87 Infer parameter types on overrides
Fixes #105

This overlaps with brian's recent CL moving override inference logic.  If this looks good, we'll need to move it over as well.

R=brianwilkerson@google.com, leafp@google.com

Review URL: https://codereview.chromium.org/1311863005 .
2015-08-25 10:45:08 -07:00
John Messerly e420033f7c sort errors so they appear in stable order
should be the same order analyzer_cli uses

R=vsm@google.com

Review URL: https://codereview.chromium.org/1299993004 .
2015-08-20 08:59:48 -07:00
Vijay Menon 8f9c38b128 Enable is and as checks on non-ground types
Failures generate a StrongModeError.  Fixes #236.  Partially addresses #238.

Some issues to do:
- We're too eager to throw a StrongModeError.  E.g., <int>[] is List<String> will throw.
- We don't differentiate between implicit and explicit casts.

R=leafp@google.com

Review URL: https://codereview.chromium.org/1298893003 .
2015-08-19 06:15:04 -07:00
Vijay Menon c0100939c2 Implement more of dart:mirrors
This unblocks angular.

See #199

R=jmesserly@google.com

Review URL: https://codereview.chromium.org/1252953003 .
2015-08-07 12:40:34 -07:00
John Messerly cbe23ee268 implement exports, fixes #141
R=vsm@google.com

Review URL: https://codereview.chromium.org/1263583005 .
2015-08-04 17:23:13 -07:00
John Messerly 2535238ee8 fixes #276, path manipulation issues on windows. Also fixes server mode
R=leafp@google.com

Review URL: https://codereview.chromium.org/1270993002 .
2015-08-04 16:34:53 -07:00
John Messerly 8422d7ab48 fix language_tests.js to use strict mode
we weren't running a bunch of tests on the bots :|
amazingly, none were broken yet
this also fixes karma.conf log level, and disables some spammy prints from one of the tests

R=vsm@google.com

Review URL: https://codereview.chromium.org/1257233008 .
2015-08-03 14:08:28 -07:00
Olivier Chafik 8426fa9e17 Added bin/devrun.dart, which runs DDC's output with iojs or d8 (issue #225) 2015-07-29 14:17:56 +01:00
John Messerly 49d101c1c4 format with dart_style 0.2.0-rc.3
this unblocks null aware ops

R=vsm@google.com

Review URL: https://codereview.chromium.org/1266483003 .
2015-07-28 18:19:55 -07:00
John Messerly 9137a4538c fixes #221, initial sync*, async, async* implementation
also fixes #270

R=vsm@google.com

Review URL: https://codereview.chromium.org/1243503007 .
2015-07-28 16:52:23 -07:00
John Messerly 486f8dc70e restore arrow function bind this workaround
to help out https://github.com/dart-lang/dev_compiler/pull/266
it seems io.js is using a V8 build from right before this was fixed

R=vsm@google.com

Review URL: https://codereview.chromium.org/1263593003 .
2015-07-28 14:51:31 -07:00
John Messerly 3996aaf3d4 fix for bin/devc relative path
R=vsm@google.com

Review URL: https://codereview.chromium.org/1243693002 .
2015-07-23 09:55:21 -07:00
John Messerly 26528756bd some fixes for --strong warnings
I didn't go all the way, in case we want to change some of these. Thoughts?

R=leafp@google.com

Review URL: https://codereview.chromium.org/1245013002 .
2015-07-22 15:37:55 -07:00
John Messerly 8aa0f1c695 fix code coverage to work on dev channel
R=vsm@google.com

Review URL: https://codereview.chromium.org/1236493003 .
2015-07-22 14:50:23 -07:00
John Messerly 60aba749ca fixes #219, able to compile multiple entry points
also speeds up codegen_test by reusing the analysis context
BatchCompiler is pretty close to how analyzer_cli works now (other than missing features)

R=vsm@google.com

Review URL: https://codereview.chromium.org/1235503010.
2015-07-16 17:41:33 -07:00
John Messerly c4267e5d35 analyzer fixes
found these in the "dart analysis" tool window
(after excluding test files and such)

R=vsm@google.com

Review URL: https://codereview.chromium.org/1239803005.
2015-07-15 10:00:20 -07:00
John Messerly bc4e0f2a38 fixes #6, refactor to use AnalysisError/Listener throughout dev_compiler
Main goal here was to get rid of the enter/exit compilation unit tracking, to allow further Compiler/Server refactoring. We can get the Uri/LineInfo/contents off Source, which AnalysisError already has
SummaryReporter is now fairly generic.

TODOs for the future:
* figure out what to do about ErrorCodes, in particular dev_compiler prefix feels off.
* skip the intermediate StaticInfo types? They're really just builders now for AnalysisError.
* don't classify all existing messages as "AnalyzerError" ... just print them ...
* skip logger. For our command line program, stdout is part of its "API", IMO it shouldn't use logging for those messages. Consider Pub, which uses stdout/err for its messages, and uses logging for more detailed troubleshooting.

R=pquitslund@google.com, vsm@google.com

Review URL: https://codereview.chromium.org/1230903002.
2015-07-10 10:15:08 -07:00
John Messerly f17187f3aa fix for 1.12.0-dev SDK and 0.25.1 analyzer breaking changes
unfortunately we can't run on stable anymore

R=vsm@google.com

Review URL: https://codereview.chromium.org/1228063003.
2015-07-09 10:11:32 -07:00
John Messerly 139483d395 create another copy of libraries.dart for 1.12-dev SDK
also adds .packages to .gitignore
Note: this isn't enough to fix things yet, it seems 0.25.1 analyzer has other breaking changes

R=vsm@google.com

Review URL: https://codereview.chromium.org/1231643009.
2015-07-09 09:36:52 -07:00
Vijay Menon a458150539 Run canary tests in presubmit
This partially addresses #128

R=leafp@google.com

Review URL: https://codereview.chromium.org/1208413003
2015-06-26 10:03:11 -07:00
John Messerly c2e65df22c fixes #168, dart:js implementation with a test
R=vsm@google.com

Review URL: https://codereview.chromium.org/1200233004.
2015-06-25 13:18:52 -07:00
John Messerly 8d76f5f34e have build/test scripts automatically update baselines
we already have to review them, so running a diff and failing the rest of the test pass seems unhelpful. Instead operate like our generated SDK does, and update in place

R=vsm@google.com

Review URL: https://codereview.chromium.org/1188173003.
2015-06-17 09:05:59 -07:00
John Messerly 7d8b38a236 js_ast: implement rest/spread parsing
R=vsm@google.com

Review URL: https://codereview.chromium.org/1183033004.
2015-06-16 16:10:05 -07:00
Vijay Menon d48b153193 dart:mirrors
This is a very bare bones version - just enough to get angular running.

See #199

R=jmesserly@google.com

Review URL: https://codereview.chromium.org/1186683005.
2015-06-15 16:22:54 -07:00
John Messerly b769aa5fbc fixes #25, most analyzer errors were not computed
It helps to call computeErrors ;)

R=vsm@google.com

Review URL: https://codereview.chromium.org/1183733004.
2015-06-15 08:55:59 -07:00
John Messerly d1a4c5dc94 first step for #168, adds dart:js impl to the build
the code most likely does not work yet. But this gets it in so we can iterate more easily, from a clean baseline.

R=jacobr@google.com

Review URL: https://codereview.chromium.org/1179643005.
2015-06-12 15:17:38 -07:00
Leaf Petersen b9c83e0013 Most of this CL just re-organizes the runtime code into multiple sub-libraries. js_utils and loader remain as top level symbols (the former so that it has no dependencies, the latter since it defines the module system that the rest use).
The dart runtime files are roughly split around functional boundaries.  Comments at the top of each file describe the function of the library.  I'm not sure that these are 100% right yet, but they're closer.  We may want to iterate on the organization.

The main dart runtime file just re-exports various symbols from the sub-libraries.  It has hard dependencies on the other runtime files, some of which have soft (lazy) dependencies on SDK files.  The generated code now depends on dart and dartx as a imported libraries, rather than as top level symbols.

This CL also includes some new code to make type representations a bit better.  This is mostly in the new types.js file, which makes all of the non-instance types (dynamic, bottom, void, function types) subtypes of a common representation type.  Among other things, they now have the correct runtime type (core.Type).  Some of the type code has been rationalized around this a bit, but there is more left to do here.  The setSignature code in classes.js now also places the correct runtime type on nominal (instance) types.  There are new tests in the runtime_tests.js file to test for this.

The static object method code that implements the Object methods has not yet been updated to dispatch on type representations.  I will do that in a separate CL.

BUG=
R=jmesserly@google.com, vsm@google.com

Review URL: https://codereview.chromium.org/1182653002
2015-06-12 13:34:39 -07:00
John Messerly b62fdb577d fixes #217, Object members on extension types
R=vsm@google.com

Review URL: https://codereview.chromium.org/1173023004.
2015-06-10 13:52:18 -07:00
John Messerly e7a5cc36ef fixes #216, JSNumber members
R=vsm@google.com

Review URL: https://codereview.chromium.org/1173903003.
2015-06-10 13:46:44 -07:00
John Messerly 86a8ac2b0c fix #214, check type of inferred initializing formal with default value
Analyzer does this inference (probably from spec?) very early in the compilation.

R=sigmund@google.com

Review URL: https://codereview.chromium.org/1180513002.
2015-06-10 12:59:55 -07:00
John Messerly c7b3846d8e fixes detection of SDK libraries
R=vsm@google.com

Review URL: https://codereview.chromium.org/1170813008.
2015-06-10 09:59:18 -07:00
John Messerly 20d14a610c fixes #209, remove tree mutation from CodeChecker
R=vsm@google.com

Review URL: https://codereview.chromium.org/1172453002
2015-06-08 16:52:01 -07:00
John Messerly 92f7129ae3 split analyze and format steps out of test.sh
presubmit.sh still runs all of them in the same order

often I'd like to iterate on analyze or rerun format without running all of the tests, and find myself copying analyze or format lines from test.sh

R=leafp@google.com

Review URL: https://codereview.chromium.org/1167233002
2015-06-08 13:48:47 -07:00
Leaf Petersen 695ae10131 Delete dart2js specific private library code.
This trims out a large chunk of the more obviously dart2js specific stuff from js_helper.dart and its dependencies.

BUG=
R=jmesserly@google.com, vsm@google.com

Review URL: https://codereview.chromium.org/1152333009
2015-06-05 09:52:18 -07:00
John Messerly 6c3cdd707d fixes #40, extension methods for primitive types
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
2015-06-04 14:58:18 -07:00
Vijay Menon 4aaeaf6125 Remove dart backend
Fixes #205

R=jmesserly@google.com, leafp@google.com

Review URL: https://codereview.chromium.org/1148283010
2015-06-03 14:01:28 -07:00
John Messerly 85242175d4 fixes #202, check IndexExpression
R=leafp@google.com

Review URL: https://codereview.chromium.org/1160673003
2015-06-02 17:10:43 -07:00
John Messerly 2b55297c68 remove generated_sdk from checked in code
R=leafp@google.com

Review URL: https://codereview.chromium.org/1162723007
2015-06-02 12:39:25 -07:00
John Messerly e15f53d923 upgrade dependencies, including migration to package:test
dart_style becomes a dev_dependency, and remove the ability to auto-run it from dart backend, instead use the test formatter
migrate to package:test, which has a few tricky bits:
* expect can only appear inside a test now (https://github.com/dart-lang/test/issues/132)
* mirrors is needed to get the test folder (https://github.com/dart-lang/test/issues/110)
* test `main` can't take arguments. not sure what's up there, but not a big deal for us either.

R=vsm@google.com

Review URL: https://codereview.chromium.org/1166683005
2015-06-01 14:54:13 -07:00
John Messerly f0dcd30114 tweak build_sdk to display color unified diffs, and move diff to after the build succeeds
when debugging js_codegen errors, this makes it a lot easier to see the stack trace.

R=vsm@google.com

Review URL: https://codereview.chromium.org/1153313005
2015-05-29 15:47:50 -07:00
Vijay Menon 562313e113 Fixes for sunflower
R=leafp@google.com

Review URL: https://codereview.chromium.org/1143953004
2015-05-28 09:28:55 -07:00
Vijay Menon 8e118887b0 Check for SDK error regressions on presubmit
This is to keep us from inadvertently regressing the SDK.  See related bug #103

R=leafp@google.com

Review URL: https://codereview.chromium.org/1154213008
2015-05-28 09:26:18 -07:00
Vijay Menon 980c0904b3 Add types to shift operations
Not sure why these weren't typed in the first place.

R=jmesserly@google.com

Review URL: https://codereview.chromium.org/1143273002
2015-05-22 09:08:35 -07:00
John Messerly 995e0f0bb3 remove #177 workaround
this issue was fixed

R=vsm@google.com

Review URL: https://codereview.chromium.org/1142553002
2015-05-14 16:02:39 -07:00