Commit Graph

1367 Commits

Author SHA1 Message Date
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
John Messerly f728691ac8 Fixes #179 -- compile error if editing files during server mode
this avoids reloading file contents many times during a compile. `.contents.data` == bad!
also fixes #73, using Analyzer's LineInfo instead of FileSpan to avoid finding line breaks over and over
I did some manual testing on sunflower as well as diffing SDK messages before and after

The one baseline change (23 -> 22) seems more accurate than it was before.

R=vsm@google.com

Review URL: https://codereview.chromium.org/1141013002
2015-05-14 16:42:33 -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
Vijay Menon 3377d2b7c5 Angular workarounds
- Workaround for symbolized methods (e.g., core.$map)
- dload/dput workarounds
- NSM workaround
- generic method type check workarounds

R=jmesserly@google.com

Review URL: https://codereview.chromium.org/1131143002
2015-05-14 12:47:32 -07:00
Vijay Menon 2749eaa496 Summarize only per logging level
This prunes out INFO messages by default - they end up being a substantial chunk of the payload in server mode.  You can still serve them up by passing '-l ALL' or '-l INFO'.

R=leafp@google.com

Review URL: https://codereview.chromium.org/1126243004
2015-05-14 10:46:35 -07:00
John Messerly ef1739d8eb Make typedefs lazy again
reverts part of https://github.com/dart-lang/dev_compiler/commit/3dcea8bf156b3947c4dbf4b36da55a64cd9dc492
On its own, it's probably okay, but trips on other issues we have w.r.t. JsName types and NoInterfaceObject apis

R=vsm@google.com

Review URL: https://codereview.chromium.org/1135883004
2015-05-14 09:45:41 -07:00
Vijay Menon b013a71e30 Create html if needed in server mode
This allows just serving up a dart file:

dart ./bin/devc.dart --server foo.dart

R=jmesserly@google.com

Review URL: https://codereview.chromium.org/1130093007
2015-05-14 09:26:19 -07:00
Sigmund Cherem dfdaff85bb Load time improvements (fixes #140):
- move hash to a query parameter (it works!)
- do widget request later, let app render/loading in case the request is fast
enough.

R=vsm@google.com

Review URL: https://codereview.chromium.org/1131933003
2015-05-12 16:53:32 -07:00
John Messerly aba85e3d9f fixes #131, use before define from variables to classes
Factored the load order logic into its own file, as it was easier to work with that way. We could definitely tweak the structure.

Also tried hoisting constants out to top level, but it's not quite ready yet, so splitting that work out into a separate CL.

(also fixes #152 about cleaning up lazyClass, and fixes #181 about static fields)

R=vsm@google.com

Review URL: https://codereview.chromium.org/1133593004
2015-05-12 11:47:36 -07:00
John Messerly 32f3c78b82 fix temps that have the same name to have different Elements
this was happening because we picked up an == operator from analyzer's Element

also adds an assert, because I took way too much time figuring out what the heck was happening there :)

R=vsm@google.com

Review URL: https://codereview.chromium.org/1139673005
2015-05-11 16:40:16 -07:00
Vijay Menon 286a2f36c5 Fixes #178
Expand out constructor call if needed.

R=jmesserly@google.com

Review URL: https://codereview.chromium.org/1135543003
2015-05-11 10:56:11 -07:00
Vijay Menon c1d7b44212 Return obj in setType
We use the pattern:
  var x = dart.setType([1, 2, 3], List$(int));
in generated code.

R=jmesserly@google.com

Review URL: https://codereview.chromium.org/1140523002
2015-05-11 09:49:21 -07:00
John Messerly a7c860173c fixes #177, FunctionDeclarationStatement and closing over this
R=vsm@google.com

Review URL: https://codereview.chromium.org/1132113003
2015-05-08 14:52:52 -07:00
John Messerly ef8edb1273 fixes #175, fixed arrays
R=vsm@google.com

Review URL: https://codereview.chromium.org/1138533003
2015-05-08 14:33:37 -07:00
John Messerly da208152ea fixes #157, renaming local library identifiers if needed.
readability regression, but fairly simple fix. looks okay in libraries with few imports, bad if they have a lot. ultimately I think this gets cleaned up as part of emitting modules + handling module lowering in JS codegen, see issue #34.

R=vsm@google.com

Review URL: https://codereview.chromium.org/1122133003
2015-05-06 13:47:38 -07:00
Leaf Petersen bf567bb94b Typing fixes to eliminate casts/dcalls
Tightens up some typing issues (mostly in the collections) to eliminate some casts and dynamic calls.  Also adds inference through parenthesized expressions.

BUG=
R=vsm@google.com

Review URL: https://codereview.chromium.org/1122313002
2015-05-05 16:47:19 -07:00
John Messerly a281dba3f5 fixes #158, precendence of call and access in new
R=vsm@google.com

Review URL: https://codereview.chromium.org/1122283002
2015-05-05 14:55:02 -07:00
Leaf Petersen 071e6d0d46 SDK fixes
This fixes all of the static errors from generating the SDK except those in the _interceptors library, and a set of errors associated with checks of the form (v is E) for generic type parameter E.  Most of the fixes consist of adding missing generic parameters, or making overrides consistent.  There are a few fixes to resolve issues around code that moved implicitly between hidden implementation classes and their public API classes, and some other miscellaneous fixes.

All of my changes are in the tool/input_sdk directory - the rest of the diff is generated code.

BUG=
R=vsm@google.com

Review URL: https://codereview.chromium.org/1112403004
2015-05-05 10:58:33 -07:00
Leaf Petersen 3161bc578e Inference through conditional expressions.
Push type info down through conditional expressions.  This eliminates some casts (mostly due to a bug in the analyzer lub code).

BUG=
R=vsm@google.com

Review URL: https://codereview.chromium.org/1121993004
2015-05-05 10:47:42 -07:00
John Messerly 9d32ea0069 fixes #147, add this and super to isStateless
R=jacobr@google.com

Review URL: https://codereview.chromium.org/1117373002
2015-05-05 09:16:56 -07:00
John Messerly c58318a8ef fixes #130, accept anything with iterator in for loops
R=vsm@google.com

Review URL: https://codereview.chromium.org/1126713002
2015-05-05 09:06:45 -07:00
Vijay Menon 1a0efac4e5 Do not suppress implicit constructors that need a super call.
This fixes a bug creating an _AsyncCompleter (_Completer.future was not being initialized).

R=jmesserly@google.com

Review URL: https://codereview.chromium.org/1122883002
2015-05-04 14:50:34 -07:00
John Messerly b0899d64df fixes #150, broken code in js_number.dart
R=vsm@google.com

Review URL: https://codereview.chromium.org/1121853002
2015-05-01 14:37:19 -07:00