Commit Graph

212 Commits

Author SHA1 Message Date
Vijay Menon 8a48c2f726 Remove uses of DartObjectImpl
Note: the changes to .txt files are due to unrelated analyzer strong mode fixes.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1413923003 .
2015-10-19 12:59:48 -07:00
John Messerly 5e0c2bbaf8 Move DDC to analyzer-based checker
this fully moves DDC over to analyzer for checking

NOTE: there's one test failure in a .lib file, it may not be getting correctly analyzed.

R=leafp@google.com

Review URL: https://codereview.chromium.org/1401273002 .
2015-10-14 17:13:03 -07:00
Vijay Menon 2358366f56 Rewire DDC to use the analyzer task model
This is WIP - not quite ready for review.

Not all tests are passing yet.  Most checker and inference tests are passing, but about a quarter are failing - need to look.

The non-runtime changes under lib along with test/testing.dart are the only real changes.

We seem to be losing some type info - lots of new casts - but I see at least one removed.

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

Review URL: https://codereview.chromium.org/1355893003 .
2015-10-08 13:42:53 -07:00
Vijay Menon c623db6821 Batch the batch compiler for tests
This:
- Ensures that a given AST is processed once per context, avoiding AST caching issues and redundant work
- Associates file errors with their library instead of the entry point - we now only generate these once across different entry points

R=jmesserly@google.com

Review URL: https://codereview.chromium.org/1376123004 .
2015-10-02 14:11:27 -07:00
Vijay Menon d30fafee6f These files are no longer generated 2015-09-30 16:37:21 -07:00
John Messerly 0cdc8c28fb Revert "Qualified exports and inheritance for Closure" 2015-09-25 11:31:25 -07:00
John Messerly 2d5525fc4a Merge pull request #319 from dart-lang/closure-qualify
Qualified exports and inheritance for Closure
2015-09-25 10:53:37 -07:00
John Messerly 28f1e80cd6 fix some errors in our SDK, mostly around numbers, see issue #103
also improved codegen of JSNumber's methods

R=leafp@google.com

Review URL: https://codereview.chromium.org/1348453004 .
2015-09-18 17:10:02 -07:00
John Messerly bea9ae786a add language tests & run them in karma 2015-09-16 16:00:46 -07:00
John Messerly bcec623909 fixes #315, order of libraries in the HTML file
the lesson here is never use .importedLibraries ... we might want to change it in analyzer to use LinkedHashSet ...

R=vsm@google.com

Review URL: https://codereview.chromium.org/1337993004 .
2015-09-15 09:13:18 -07:00
John Messerly ff1b78ca42 fix a few more codegen issues:
* don't generate script tag
* handle U+2028 and U+2029
* handle name conflict with constructor

R=vsm@google.com

Review URL: https://codereview.chromium.org/1347453002 .
2015-09-14 17:06:28 -07:00
Olivier Chafik 58f1ca9259 Qualified exports and inheritance for Closure (fixes core.Object issue) 2015-09-14 14:07:02 +01:00
John Messerly 637c2c83de fixes #314, super method tear offs
R=leafp@google.com

Review URL: https://codereview.chromium.org/1310513013 .
2015-09-10 17:18:21 -07:00
John Messerly dc560e572c fix readability regressions from previous block-scope CL
also reverts the simple incremental compile code, it wasn't aware of our own compiler's version.

also fixes a warning from analyzer

R=leafp@google.com

Review URL: https://codereview.chromium.org/1305413006 .
2015-09-09 15:52:17 -07:00
John Messerly 99bdee4f8d fix implicit_scope_test and builtin_identifier_test
these were generating invalid JS code

R=vsm@google.com

Review URL: https://codereview.chromium.org/1328303002 .
2015-09-08 16:56:50 -07:00
John Messerly 7263daed54 fix dynamic type literal
it doesn't have a library

R=leafp@google.com

Review URL: https://codereview.chromium.org/1310943005 .
2015-09-04 15:57:32 -07:00
John Messerly badedeaf16 fix cascade on ThisExpression
R=leafp@google.com

Review URL: https://codereview.chromium.org/1309383003 .
2015-09-04 15:28:38 -07:00
Vijay Menon 33ad4d9600 Reformat
Olivier: running presubmit locally (for me) reformats a few files.  May be a pub upgrade issue to get on the latest formatter.

TBR=ochafik@google.com

Review URL: https://codereview.chromium.org/1322673004 .
2015-09-02 12:53:05 -07:00
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 707b9cc09c triage remaining async tests
one fix, two rejected statically

R=leafp@google.com

Review URL: https://codereview.chromium.org/1319523007 .
2015-08-31 17:49:41 -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
John Messerly c4b754b041 use the real matchers for running language tests
R=vsm@google.com

Review URL: https://codereview.chromium.org/1321683004 .
2015-08-28 09:27:36 -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
John Messerly 74c760066b implement null aware ops, fixes #249
this also implements multitest support, which fixes #280

Fixes some other preexisting bugs:
* MetaLets did not simplify themselves correctly in some nested cases
* Library prefixed identifiers did not work as lvalues in opassign
* dsetindex/dput/[]= methods did not return a value
* checker did not correctly handle invalid constructor field initializers
* cascades did not correctly work with method invocations(?)
* postfix ++/-- did not correctly generate lvalues in some cases

The good news: because this reuses on our existing lvalue/metalet helpers, it managed to flush out a lot of bugs in other features that use them.

R=vsm@google.com

Review URL: https://codereview.chromium.org/1316723003 .
2015-08-25 15:13:18 -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 136396c107 Regen js_test.txt
I'm seeing this diff locally on presubmit.

R=jmesserly@google.com

Review URL: https://codereview.chromium.org/1300203002 .
2015-08-19 13:09:37 -07:00
Leaf Petersen 8d36859187 Attach type info to extension method and object method tear-offs
Fixes #189.

BUG=
R=jmesserly@google.com

Review URL: https://codereview.chromium.org/1293293002 .
2015-08-19 10:01:12 -07:00
John Messerly 38065257a2 fixes #292, report async_helper test failures
R=vsm@google.com

Review URL: https://codereview.chromium.org/1289673007 .
2015-08-19 08:35:41 -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 b393e12c6b fixes #197, don't generate casts that always pass
R=vsm@google.com

Review URL: https://codereview.chromium.org/1261783005 .
2015-08-04 15:42:13 -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 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 7252228557 fix truncate call to use extension method
R=vsm@google.com

Review URL: https://codereview.chromium.org/1249043006 .
2015-07-22 14:52:40 -07:00
John Messerly 394836eaa2 fixes #259, clone ast before mutation
R=vsm@google.com

Review URL: https://codereview.chromium.org/1245013005 .
2015-07-21 15:36:55 -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
Vijay Menon f50661aac4 Add support for Enums
Fixes #248

R=jmesserly@google.com

Review URL: https://codereview.chromium.org/1224083017.
2015-07-14 17:48:38 -07:00
Vijay Menon 8ccef442a3 Fixes #254 - Better stacktrace support
R=jmesserly@google.com

Review URL: https://codereview.chromium.org/1233553005
2015-07-14 13:33:01 -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 98d14b14da initial sync*, part of #221
Right now it maps straight to ES6 generators. This should handle some basic cases, but there's more work to get all of the corners working. For example: it doesn't implement Iterable yet.

R=vsm@google.com

Review URL: https://codereview.chromium.org/1207313002.
2015-06-26 16:02:30 -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
Leaf Petersen 4e7920c487 Handle dynamic as bottom inside of function type reps.
This changes the way we handle dynamic at runtime to be more correct and cleaner.  We now simply emit dynamic as dynamic instead of as core.Object.  There are now two ways to construct a function type: one can construct a fuzzy function type (the default), or a definite function type.  The constructor for a fuzzy function type replaces all uses of dynamic with bottom.  This function type is used for all type annotations.  Definite function types do not replace dynamic with bottom.  These only occur as the runtime type of actual functions, for which we really know the type. Because we now eagerly sort this out when we create the function type, the subtyping code doesn't need to deal with this.

This allows some additional subtyping: closures which actually are typed to take dynamic would previously not have been allowed to be cast to something with a concrete argument type.  Now this is allowed (see the change in runtime_tests.js for an example of this).

This fixes #107.

BUG=
R=vsm@google.com

Review URL: https://codereview.chromium.org/1195523002
2015-06-17 16:46:38 -07:00
John Messerly de6df99db0 fixes #226 super == and fixes #227 escape \r \f
R=vsm@google.com

Review URL: https://codereview.chromium.org/1183453005.
2015-06-16 16:52:32 -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
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