Commit Graph

1589 Commits

Author SHA1 Message Date
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 c5f4228119 format with dart_style 0.2.0
R=vsm@google.com

Review URL: https://codereview.chromium.org/1268813003 .
2015-07-31 09:28:05 -07:00
John Messerly 922a4ba728 use some null aware ops
it looks like we can start using these now

R=leafp@google.com

Review URL: https://codereview.chromium.org/1253143003 .
2015-07-29 10:51:31 -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 cc47aa0ce0 update analyzer and dart_style
R=vsm@google.com

Review URL: https://codereview.chromium.org/1258663002 .
2015-07-27 09:36:56 -07:00
John Messerly 8f6761dd4a add test related to #264 and #228
R=vsm@google.com

Review URL: https://codereview.chromium.org/1252773002 .
2015-07-23 10:03:45 -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 c56eec5708 fixes dart.throw to work for non-objects
language tests use this, for example

R=vsm@google.com

Review URL: https://codereview.chromium.org/1245023004 .
2015-07-23 09:34:41 -07:00
John Messerly bbf292018a allow await to be any value, fixes part of #264
Review URL: https://codereview.chromium.org/1248213002 .
2015-07-22 16:06:31 -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 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
Vijay Menon 9fe41d1202 Fix server mode
TBR=jmesserly@google.com

Review URL: https://codereview.chromium.org/1235293004.
2015-07-17 21:21:18 -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 ebe7d54efd Use standard harmony flag
This fixes current breakage with Chrome 46.

R=jmesserly@google.com

Review URL: https://codereview.chromium.org/1235393004.
2015-07-16 09:33:10 -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 b1e92bfcaf simplify computing of runtime file location
R=vsm@google.com

Review URL: https://codereview.chromium.org/1223113005.
2015-07-15 09:58:26 -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 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
Vijay Menon a68fa599f3 Option to disable message widget
R=leafp@google.com

Review URL: https://codereview.chromium.org/1213233006.
2015-06-30 16:40:20 -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
Vijay Menon 7837d31936 Fixes #246
Type checks await

R=jmesserly@google.com

Review URL: https://codereview.chromium.org/1209413002.
2015-06-26 09:59:43 -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 b9e48a6616 fixes #232, handling of arguments
our renamer wasn't trusting the JS builtin to use arguments correctly :)
incidentally, this does the final step in making the renamer precise: it tracks all renames per-scope now. In practice this was almost never hit except for "arguments" though.

R=vsm@google.com

Review URL: https://codereview.chromium.org/1200243002.
2015-06-23 13:35:39 -07:00
Vijay Menon 4bb9fdce71 Fixes #151
Type check async-return, async*-yield, and sync*-yield.

R=leafp@google.com

Review URL: https://codereview.chromium.org/1190413005.
2015-06-22 10:22:23 -07:00
John Messerly 9b1ad9cf1a fixes #231, mixin application (aka ClassTypeAlias) implicit ctors
R=vsm@google.com

Review URL: https://codereview.chromium.org/1193083002.
2015-06-22 08:55:56 -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
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 4c9fb31e35 Fix multipackage resolver paths
R=jmesserly@google.com

Review URL: https://codereview.chromium.org/1187163003
2015-06-16 13:15:22 -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
John Messerly 86c5ee932d fixes #192, encode dynamic info in checker
fixes a checker bug too: it wasn't working properly for cascade targets. Previously this caught #202 and #206 as well.

R=leafp@google.com

Review URL: https://codereview.chromium.org/1184843002.
2015-06-12 13:39:41 -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
Vijay Menon 4be334a923 Fix runtime ordering and other minor fixes
Other than mirrors (coming next :-)), this gets angular todo running.

R=leafp@google.com

Review URL: https://codereview.chromium.org/1177253002.
2015-06-11 11:06:49 -07:00
Vijay Menon 9c77254a27 Clean up runtime type code
R=leafp@google.com

Review URL: https://codereview.chromium.org/1177233004.
2015-06-11 09:41:18 -07:00
John Messerly 8f4db8f514 expose strong checker API, for use by analyzer_cli
most of the changes here are around making options sane(r), which fixes #204

R=vsm@google.com

Review URL: https://codereview.chromium.org/1174643003.
2015-06-11 07:47:12 -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 d52346c201 fixes #215, removes special case for length
R=vsm@google.com

Review URL: https://codereview.chromium.org/1178523004.
2015-06-10 12:21:49 -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
Olivier Chafik d159b6ee79 Fix dart.equals("10", 10) (issue #210)
See doc on == vs. === : https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Comparison_Operators
Note that the `== null` tests in the same function are probably preferable to `=== null` if both undefined and null values can be encountered.
2015-06-10 15:31:59 +01:00
Vijay Menon 321be0a426 Generate metadata
Fixes #198

BUG=https://github.com/dart-lang/dev_compiler/issues/198
R=jmesserly@google.com

Review URL: https://codereview.chromium.org/1177563003.
2015-06-10 06:28:33 -07:00