Vijay Menon
acde775091
Update dart_runtime.dart rules
...
This should bring it in line with rules.dart.
R=jmesserly@google.com , leafp@google.com
Review URL: https://codereview.chromium.org/1043323002
2015-04-07 05:57:20 -07:00
Leaf Petersen
7321b609d5
Inference casts to dynamic, fuzzy types handled
...
During inference, allow sub-expressions of type dynamic to be cast to the inferred type.
This CL also adds special case support for the case where we are trying to infer a type for a closure literal with a fuzzy type - often these closures are already well-typed (or easily inferable) if we eliminate the fuzziness.
This gets rid of two of the static errors on angular hello world, along with most of the InferableClosure warnings (turning them into InferredTypeClosure infos).
Most of the remaining InferableClosure cases are function literals with block function bodies, which I don't handle in general yet.
BUG=
R=vsm@google.com
Review URL: https://codereview.chromium.org/1059763003
2015-04-03 15:36:27 -07:00
Jacob Richman
5a5ddca7bc
Extension method support to move us closer to a valid List implementation.
...
BUG=
R=jmesserly@google.com
Review URL: https://codereview.chromium.org/1059583002
2015-04-03 14:52:04 -07:00
Vijay Menon
78cb0608b3
Disable closure wrapping by default
...
R=leafp@google.com
Review URL: https://codereview.chromium.org/1052383003
2015-04-03 14:26:11 -07:00
Leaf Petersen
0399992b81
Downwards closure inference. This implements a basic form of downwards closure inference. It only handles expression functions (=> e), and it does not try to narrow the type of parameters.
...
BUG=
R=vsm@google.com
Review URL: https://codereview.chromium.org/1050703002
2015-04-03 09:17:30 -07:00
John Messerly
0eba3903b9
move => bind this workaround to js_ast
...
cleaner since we only worry about it in one place, and the "this" check is easier and more precise now.
incidentally, I saw a CL go by on the V8 bug, looks like it's close to being fixed
R=jacobr@google.com
Review URL: https://codereview.chromium.org/1052693004
2015-04-02 12:17:01 -07:00
John Messerly
a4cbcc0c07
implement mixins in subtype checks, more codegen fixes
...
or: how creating a SplayTreeSet<String> leads to fixing a bunch of stuff
R=vsm@google.com
Review URL: https://codereview.chromium.org/1058653002
2015-04-02 12:16:24 -07:00
John Messerly
864299081e
partially implement instance of checks and some codegen fixes
...
R=vsm@google.com
Review URL: https://codereview.chromium.org/1050723002
2015-04-01 09:44:37 -07:00
Leaf Petersen
da58b9d8aa
Downward inference
...
This is a first cut at downwards inference. The interaction with InferableLiteral etc isn't well sorted out yet, so while downwards inference on nested expressions works, there will currently be spurious warnings.
BUG=
R=vsm@google.com
Review URL: https://codereview.chromium.org/1038213003
2015-03-31 13:24:25 -07:00
Sigmund Cherem
c48018ee62
Update widget with latext fix from source_span
...
R=jacobr@google.com
Review URL: https://codereview.chromium.org/1047083002
2015-03-31 13:11:14 -07:00
John Messerly
3ce5a11d77
compute interfaces lazily
...
otherwise we'd have to make a lot more classes lazy
R=jacobr@google.com
Review URL: https://codereview.chromium.org/1047203002
2015-03-31 09:14:37 -07:00
Vijay Menon
75ee9c6cc5
Handle for-in loops
...
R=sigmund@google.com
Review URL: https://codereview.chromium.org/1048863003
2015-03-30 17:22:46 -07:00
John Messerly
5472d0cfcd
keep mixin and interface implementation info at runtime
...
R=jacobr@google.com , vsm@google.com
Review URL: https://codereview.chromium.org/1043003002
2015-03-30 16:09:48 -07:00
Vijay Menon
e4fdeb376d
Fix logging test
...
Just updating the broken test. The dart_runtime.dart type rules are still out of date.
R=leafp@google.com
Review URL: https://codereview.chromium.org/1045753003
2015-03-30 16:03:50 -07:00
John Messerly
fc02cba0f4
use == and != to enable handling null/undefined
...
R=jacobr@google.com , vsm@google.com
Review URL: https://codereview.chromium.org/1047023002
2015-03-30 16:01:22 -07:00
John Messerly
1515ceaa8e
fixes private named constructors
...
R=jacobr@google.com
Review URL: https://codereview.chromium.org/1042943003
2015-03-30 14:30:01 -07:00
John Messerly
f0e35ab12c
fix arguments keyword used in our helper method
...
R=jacobr@google.com
Review URL: https://codereview.chromium.org/1048873002
2015-03-30 10:46:13 -07:00
John Messerly
af714fed80
fix for static methods and names banned in strict mode
...
* static methods qualified properly
* static method privacy is now enforced
* avoid static method names banned in strict mode
* avoid variable names banned in strict mode
We might want to relax privacy (for both instance and static), but for now it's nice and consistent with instance methods using ES6 Symbol
R=jacobr@google.com
Review URL: https://codereview.chromium.org/1034273003
2015-03-30 10:09:56 -07:00
Jacob Richman
a6ca53ee49
fix list literal initialization call fix typeof calls for primitive JS types add dart/collection.js to defaultRuntimeFiles list Enclose switch statement case blocks with braces to insure a block scope matching dart semantics
...
BUG=
R=jmesserly@google.com
Review URL: https://codereview.chromium.org/1042003002
2015-03-30 09:42:29 -07:00
John Messerly
34e2fbabd7
fix temp used in postfix ops
...
Review URL: https://codereview.chromium.org/1039243002
2015-03-27 07:26:57 -07:00
John Messerly
2357e3013b
more care around generated names, fixes #60 #82 and #97
...
R=vsm@google.com
Review URL: https://codereview.chromium.org/1030063004
2015-03-26 17:47:31 -07:00
Sigmund Cherem
3ab4f01149
Pass through context information in error messages
...
R=vsm@google.com
Review URL: https://codereview.chromium.org/1023893004
2015-03-26 15:25:24 -07:00
Sigmund Cherem
2bf7e0aed8
Transitive inference using SCC
...
BUG=
R=vsm@google.com
Review URL: https://codereview.chromium.org/1028793002
2015-03-23 13:11:33 -07:00
Vijay Menon
1430655b9e
Treat Object and dynamic similarly
...
Note, this makes: T<dynamic> <: T<Object> and T<Object> <: T<dynamic>.
R=leafp@google.com
Review URL: https://codereview.chromium.org/1024073003
2015-03-20 14:06:13 -07:00
John Messerly
e1c8e996b7
Replace dart_core.js with actual compiled SDK
...
Almost no calls are going to work at this point, but core.js can load
now and there is enough in place to continue to load sunflower.
R=sigmund@google.com
Review URL: https://codereview.chromium.org/1020043002
2015-03-20 09:41:00 -07:00
John Messerly
c587869d1d
bind to localhost instead of all interfaces, and fix closureWrap
...
R=sigmund@google.com
Review URL: https://codereview.chromium.org/1022923005
2015-03-20 09:19:10 -07:00
John Messerly
b62f4c06ab
sort classes in dependency order, or load lazily if needed, fixes #78
...
this also starts using compiled code in dart_core.js (just copy+paste for Object)
visitClassDeclaration was getting rather long, so it's now refactored to make the flow more clear.
R=sigmund@google.com
Review URL: https://codereview.chromium.org/1016003003
2015-03-19 10:03:22 -07:00
Vijay Menon
48d4a4e320
Allow S->T <: dynamic->T
...
In followup CLs, I will:
- Fix coercions to limit implicit ones.
R=jmesserly@google.com , leafp@google.com
Review URL: https://codereview.chromium.org/1010893004
2015-03-18 16:40:43 -07:00
Sigmund Cherem
fa03b6b422
Move sunflower to a new directory, make final tweaks to make it all work.
...
R=jmesserly@google.com
Review URL: https://codereview.chromium.org/1007313003
2015-03-18 15:53:59 -07:00
John Messerly
07feeb3119
js: fix core.Object, output order, static const fields
...
These are a few fixes trying to get the compiled SDK to load
R=vsm@google.com
Review URL: https://codereview.chromium.org/1011153002
2015-03-17 13:11:34 -07:00
Jacob Richman
2ed6fbe9e7
minor code cleanup
...
BUG=
R=jmesserly@google.com
Review URL: https://codereview.chromium.org/1002443002
2015-03-11 08:36:23 -07:00
Sigmund Cherem
4e4dd98e6b
Add widget to display errors, and report graph errors correctly.
...
This fixes the compiler so that all error messages in dependency_graph are reported via the reporter and unifies how errors are constructed in other places as well. With all errors reported together, we use a widget (adapted from polymer) to display the error messages as part of the app in server mode.
R=vsm@google.com
Review URL: https://codereview.chromium.org/988483006
2015-03-09 11:37:22 -07:00
John Messerly
6e824067a3
rename ddc -> dev_compiler, fixes #84
...
R=sigmund@google.com
Review URL: https://codereview.chromium.org/967933005
2015-03-04 11:12:19 -08:00
John Messerly
b8fcd8cb42
rename as helper to make tools happy
...
WebStorm ES6 support treats `as` as a keyword. Not sure why, as I don't see it in any ES6 specs, even under "future reserved words".
R=sigmund@google.com
Review URL: https://codereview.chromium.org/971823002
2015-03-02 11:03:31 -08:00
John Messerly
2a5adfe05a
fix analysis messages
...
seen on the latest dev channel editor w/ analysis server
R=sigmund@google.com
Review URL: https://codereview.chromium.org/962213003
2015-02-27 09:06:13 -08:00
John Messerly
b82e83f383
use js_ast instead of strings to generate JS
...
fixes https://github.com/dart-lang/dev_compiler/issues/61
R=sigmund@google.com , vsm@google.com
Review URL: https://codereview.chromium.org/949383003
2015-02-25 11:14:19 -08:00
Sigmund Cherem
e57c960817
rename package:ddc to package:dev_compiler
...
BUG=
R=vsm@google.com
Review URL: https://codereview.chromium.org/954773003
2015-02-24 17:01:15 -08:00
Vijay Menon
5c1c9c2381
Add LICENSE and corresponding headers
...
Fix expectations where line number has changed.
R=dgrove@google.com
Review URL: https://chromereviews.googleplex.com/158257013
2015-02-24 15:02:26 -08:00
Vijay Menon
ddce235e3d
Set nonnullable types by flag
...
R=sigmund@google.com
Review URL: https://chromereviews.googleplex.com/156397013
2015-02-20 14:34:44 -08:00
John Messerly
0ddedfb3da
fix incorrect DartObject reference
...
Review URL: https://chromereviews.googleplex.com/156337013
2015-02-19 09:32:21 -08:00
Sigmund Cherem
ce3dd48740
Accept compilng HTML files
...
R=jmesserly@google.com , vsm@google.com
Review URL: https://chromereviews.googleplex.com/153157013
2015-02-18 16:48:56 -08:00
John Messerly
7c1ab1f04d
work around issue #51 , super restrictions in V8
...
Adds an explicit "extends dart.Object", which we probably want for other reasons (e.g. toString, runtimeType, hashCode)
Attempts to recover some readability by tweaking the name of the initialize functions. This closes #51 , but we should open another tracking bug because there are concerning aspects to this workaround.
R=sigmund@google.com , vsm@google.com
Review URL: https://chromereviews.googleplex.com/150417015
2015-02-18 16:27:32 -08:00
Vijay Menon
260cfc05d2
Make nonnullability configurable
...
John: I added code in the JS codegen to query which primitives are non-nullable.
R=jmesserly@google.com , sigmund@google.com
Review URL: https://chromereviews.googleplex.com/155407013
2015-02-18 14:20:22 -08:00
John Messerly
bf9a2b9015
add test tools, implement generic type constructor
...
test tools are from https://github.com/webcomponents/webcomponentsjs/tree/master/tests/tools
R=vsm@google.com
Review URL: https://chromereviews.googleplex.com/151127013
2015-02-11 16:53:05 -08:00
Vijay Menon
e64630186d
Add non-nullability logic for primitives
...
Still need to:
- Fix our dart:core errors
- Change DownCastLiteral to error
- Handle "int x;", etc.
R=jmesserly@google.com , leafp@google.com
Review URL: https://chromereviews.googleplex.com/156787013
2015-02-11 12:08:34 -08:00
John Messerly
083e4c4889
reified generics baby steps
...
introduces a memoized function that produces the generic type instance
generic type parameters are closed over, making it easy to get them and ensure they flow correctly through base class/mixins.
also implements the unimplemented features in _typeName.
R=leafp@google.com , vsm@google.com
Review URL: https://chromereviews.googleplex.com/157627013
2015-02-11 09:03:03 -08:00
John Messerly
f85c2eb649
fix mixin field init, implicit-this
...
also slight change to sunflower example
R=vsm@google.com
Review URL: https://chromereviews.googleplex.com/144247014
2015-02-09 13:11:26 -08:00
John Messerly
bf682828f8
implement try and switch
...
R=leafp@google.com
Review URL: https://chromereviews.googleplex.com/144527014
2015-02-06 10:25:13 -08:00
John Messerly
9957696748
improve invoke/as code
...
R=vsm@google.com
Review URL: https://chromereviews.googleplex.com/149937013
2015-02-05 15:46:42 -08:00
Vijay Menon
29718b72e8
Support Function object typing
...
R=jmesserly@google.com , leafp@google.com
Review URL: https://chromereviews.googleplex.com/147547013
2015-02-05 14:06:09 -08:00