Commit Graph

7 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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