Commit Graph

1589 Commits

Author SHA1 Message Date
Vijay Menon 5ff3864a18 Load on demand
This fixes ordering issues.

R=jmesserly@google.com

Review URL: https://codereview.chromium.org/1171843002
2015-06-09 08:05:26 -07:00
John Messerly 023bfc087d remove ignoreTypes flag, it doesn't work, see #134
If we wanted to bring this back, we should implement it differently, IMO
Instead simply replace all type annotations with `dynamic`

R=vsm@google.com

Review URL: https://codereview.chromium.org/1163393002
2015-06-08 16:57:24 -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 a5132e6436 remove covariant generics option
Thoughts? Seems unlikely we'll go with invariant at this point.
I'd like to see covariant generics go, but it seems we need variance annotations of some sort before that becomes realistic. (e.g. Iterable is used all over the place)

R=leafp@google.com

Review URL: https://codereview.chromium.org/1165303002
2015-06-08 14:35:56 -07:00
John Messerly 73be4cab48 remove ClosureWrap option and related implementation
Vijay thought that we don't need this anymore, as we decided not to wrap.

R=leafp@google.com

Review URL: https://codereview.chromium.org/1171713002
2015-06-08 14:32:42 -07:00
John Messerly d88c36af77 remove unused allowConstCast option
this was for the Dart backend?

R=vsm@google.com

Review URL: https://codereview.chromium.org/1166163002
2015-06-08 13:19:06 -07:00
John Messerly cce21a4991 dead code elimination in reify_coercions
with the removal of dart backend, we don't need support for _runtime

R=leafp@google.com

Review URL: https://codereview.chromium.org/1169873002
2015-06-08 13:17:00 -07:00
Vijay Menon c139653fcb Check for duplicate library names
This bites us on Angular - dart:collection and angular's collection
(facade) lib smash on top of each other, silently causing issues.

We'll need a better naming convention - perhaps we should use the lib
name and require uniqueness.

Fixes #208

R=jmesserly@google.com

Review URL: https://codereview.chromium.org/1145243013
2015-06-05 16:34:10 -07:00
John Messerly a7adab29fa fixes browser/runtime_test, and a few of extension member fixes
* fixes generic List. Because generic arrays have the proto of JSArray, which itself extends Array, we need to make sure we don't override members from Array.

* fixes tear offs, they were not preserving type signatures in some cases. This doesn't change how we store signatures, but perhaps something we could consider, to make this bug less likely.

* the defineExtensionMembers call was not getting emitted unless the type implemented at least one interface.

R=leafp@google.com

Review URL: https://codereview.chromium.org/1156273010
2015-06-05 16:22:37 -07:00
John Messerly cac786f671 fixes #173, ability to use native JS indexers
dom_experimental could opt-in to use this

R=jacobr@google.com

Review URL: https://codereview.chromium.org/1145833004
2015-06-05 12:14:09 -07:00
John Messerly 89b3d920d6 fixes #206, add checking for unary ops
fixes #207, checking for boolean conversions

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

Review URL: https://codereview.chromium.org/1147143007
2015-06-05 12:12:27 -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 2722aed77e fixes #201, add support for custom URL mapping
R=vsm@google.com

Review URL: https://codereview.chromium.org/1150143006
2015-06-03 09:40:48 -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 8865229d8d fixes #200, library prefixes for unknown imports
Take 2. The first version passed checker_test but not inferred_type_test. The library prefix staticElement check needs to come first.

R=vsm@google.com

Review URL: https://codereview.chromium.org/1161603009
2015-06-02 17:06:04 -07:00
John Messerly 33eee25590 fixes #43, remove => workaround
R=leafp@google.com

Review URL: https://codereview.chromium.org/1169473003
2015-06-02 16:30:23 -07:00
John Messerly 145656318a Revert "fixes #200, library prefixes for unknown imports"
This reverts commit 026a4921957ee08f011eabf1c3deea6c5e8aa715.

BUG=

Review URL: https://codereview.chromium.org/1159013009
2015-06-02 13:23:26 -07:00
John Messerly f6a2ec274a fixes #200, library prefixes for unknown imports
R=vsm@google.com

Review URL: https://codereview.chromium.org/1165823002
2015-06-02 13:21:24 -07:00
Vijay Menon c6ecb1df15 Fix DDC errors on DDC
Eating our own dogfood...

Some errors still in upstream packages, but this doesn't count Paul's recent CL.

> dart -c bin/devc.dart -i bin/devc.dart

package         AE   IMO  IRCE   STE     LOC
analyzer         0    10     0    12  111627
shelf            0     0     1     0    1415
http_parser      0     1     1     0    1473
source_span      2     0     0     0     708
yaml             7     5     0     1    3850
dart_style       2     0     0     0    4577
html             0    14     1   108   12307
csslib           3     0     0     6   10227
utf              0     0     0     2    1516
------------ ----- ----- ----- ----- -------
package         AE   IMO  IRCE   STE     LOC
total           14    30     3   129  175897
%             0.01  0.02  0.00  0.07     100

Where:
  AE:   AnalyzerError
  IMO:  InvalidMethodOverride
  IRCE: InvalidRuntimeCheckError
  STE:  StaticTypeError
  LOC:  LinesOfCode

BUG=
R=jmesserly@google.com

Review URL: https://codereview.chromium.org/1160223006
2015-06-01 17:02:18 -07:00
John Messerly 9a95d18c13 fixes #182, avoid injecting a duplicate link rel=stylesheet
R=sigmund@google.com

Review URL: https://codereview.chromium.org/1145893008
2015-06-01 16:54:01 -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 498ecbc7c3 small cleanups to dart_runtime.js
these were caught by the webstorm ES6 plugin
biggest one is strict mode doesn't like local functions except at top level, I think becasue the name is not scoped correctly (for historical reasons). Instead `let name = () => ...;`  allows correct scoping for `name`.

R=vsm@google.com

Review URL: https://codereview.chromium.org/1152783005
2015-06-01 09:32:40 -07:00
John Messerly 92773980ab Revert "fixes #173, ability to use native JS indexers"
This reverts commit 8dc1eeeb4dcc4d186f59513abd18f98e67c36339.

Review URL: https://codereview.chromium.org/1160343003
2015-06-01 09:31:01 -07:00
John Messerly 59852b526b fixes #173, ability to use native JS indexers
dom_experimental could opt-in to use this

Review URL: https://codereview.chromium.org/1145833004
2015-06-01 08:46:26 -07:00
John Messerly 2ae3c13d5d fix formatting
TBR

Review URL: https://codereview.chromium.org/1157093006
2015-05-29 14:55:56 -07:00
John Messerly 81fc365b95 fixes #193, factory constructors as static methods
R=vsm@google.com

Review URL: https://codereview.chromium.org/1156993015
2015-05-29 14:52:10 -07:00
Vijay Menon a73dec2030 Fix checked mode error
R=jmesserly@google.com

Review URL: https://codereview.chromium.org/1167543002
2015-05-29 13:17:56 -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 9e5896fdae Use analyzer's sealed type list
R=paulberry@google.com

Review URL: https://codereview.chromium.org/1161613005
2015-05-28 06:03:48 -07:00
Leaf Petersen aac783cfcf Allow null args to dynamic invocations
Fixes #194.

BUG=
R=jmesserly@google.com

Review URL: https://codereview.chromium.org/1149243002
2015-05-26 11:28:59 -07:00
Vijay Menon 32e4f401dd Fixes #196 - Enable resources to be served
R=sigmund@google.com

Review URL: https://codereview.chromium.org/1152573003
2015-05-22 09:35:35 -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
Leaf Petersen e270186901 Fix names in named parameter lists
This fixes #195.

BUG=
R=vsm@google.com

Review URL: https://codereview.chromium.org/1150623004
2015-05-21 15:04:22 -07:00
Leaf Petersen 694240c2ea Add constructors to signatures.
This adds the types of constructors onto class signatures and makes them available via an exported function in the dart runtime.

BUG=
R=vsm@google.com

Review URL: https://codereview.chromium.org/1152583002
2015-05-21 14:49:11 -07:00
Leaf Petersen 99433b7121 No dynamic at runtime.
Reify dynamic as bottom or Object as appropriate in the generated code.

For general function types, dynamic parameters become bottom, and all other uses of dynamic become Object.

For concrete function types (the rtti attached to function objects) dynamic parameters also become Object.

BUG=
R=vsm@google.com

Review URL: https://codereview.chromium.org/1148333003
2015-05-20 16:36:25 -07:00
Leaf Petersen 50e50530ab Use short array syntax in method signatures.
This follows up on a suggestion from jmesserly to use a shorter syntax in methods signatures.  Replaces:

dart.functionType(t, [t0,..., tn], extras)

with

[t, [t0, ..., tn], extras]

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

Review URL: https://codereview.chromium.org/1145283002
2015-05-20 16:11:42 -07:00
Leaf Petersen fcb7dfad95 Use signature inheritance when method types are unchanged
BUG=
R=jmesserly@google.com

Review URL: https://codereview.chromium.org/1144303003
2015-05-20 13:41:48 -07:00
Leaf Petersen 8322940ecd Use dart.tearoff helper at tearoff sites.
When we tear off a method, replace the obj.foo.bind(obj) pattern with dart.tearoff(obj, 'foo'), and the dart.bind(exp, 'foo') pattern with dart.tearoff(exp, 'foo').  This helper does both the bind and attaches rtti.

This CL also stops binding of static methods when they are town off, since I think this is unnecessary.

BUG=
R=vsm@google.com

Review URL: https://codereview.chromium.org/1142293002
2015-05-20 11:13:36 -07:00
Leaf Petersen 406e68ccec Check whether type parameters are loaded before emitting.
This fixes #190.

BUG=
R=vsm@google.com

Review URL: https://codereview.chromium.org/1143253003
2015-05-20 09:47:39 -07:00
Vijay Menon 0ce490561c Type check binary expressions
Fixes #188

R=leafp@google.com

Review URL: https://codereview.chromium.org/1137543005
2015-05-20 09:24:16 -07:00
John Messerly 772f6f6d1b fixes #185, track const ctor dependencies, plus a static field fix
R=vsm@google.com

Review URL: https://codereview.chromium.org/1141663003
2015-05-20 09:19:08 -07:00
Leaf Petersen 8040611a79 This CL implements tagging of functions and methods with function types.
For every class, we now generate a setSignature call which attaches properties to the constructor recording the method signatures, the static function signatures, and the names of all of the static methods. This call also attaches a getter to every static method which returns the type of the function.  Methods are only decorated with runtime types when torn off.  At a tear-off, the type is looked up in the constructor, and then attached to the bound function.

Top level functions and statement level functions get annotated with their type immediately after their declaration.  We could consider moving all of the top level function annotations to the end of the file, but for now I've left it inline.

Closures (function expressions) get wrapped in calls to a dart.fn helper, with type information attached in one of various forms.  This is currently the least attractive part of this CL.  We may want to iterate on the syntax for this.

I've added some support for NSM checking to the dsend/dcall case as well.

We may wish to iterate on the syntax, and on the runtime representation of types, but this should move us forward from a functionality standpoint.

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

Review URL: https://codereview.chromium.org/1138793002
2015-05-19 16:24:35 -07:00
John Messerly 918ee6636d fixes #187, implicit html, as well as server messages not printing
R=vsm@google.com

Review URL: https://codereview.chromium.org/1136293005
2015-05-19 13:44:31 -07:00
John Messerly 08fb2161f7 fixes #184, type literals now use emitTypeName
this fixes `dart.dynamic` as well as other cases covered by emitTypeName

R=vsm@google.com

Review URL: https://codereview.chromium.org/1142713004
2015-05-18 13:41:25 -07:00
John Messerly 01d39ba3f2 cleanup: simplify creation of AnalysisContext
removes TypeResolver class, introduces function to create analysis context, simplifies a few other things around mock vs real SDK sources.

R=vsm@google.com

Review URL: https://codereview.chromium.org/1143683002
2015-05-18 10:20:29 -07:00
John Messerly b0ff84eedc fixes #183, remove our InMemory* in favor of analyzer's impl
this should improve test coverage too, as analyzer's MemoryResourceProvider/ResourceUriResolver matches the real semantics more closely than ours did.

R=sigmund@google.com

Review URL: https://codereview.chromium.org/1146503003
2015-05-15 11:17:24 -07:00
Vijay Menon 54db808405 Promote analyzer warnings to ddc errors
This is perhaps a blunt hammer, but every warning i'm hitting in angular so far should be an error in ddc.

R=leafp@google.com

Review URL: https://codereview.chromium.org/1133663006
2015-05-15 09:47:14 -07:00
John Messerly ebf297456b isLoaded can now handle elements from other libraries
Review URL: https://codereview.chromium.org/1141133002
2015-05-14 16:44:16 -07:00