Commit Graph

392 Commits

Author SHA1 Message Date
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
Vijay Menon 67e4bc583a Rationalize coercions
This breaks out casts / coercions into:

Standard (on by default)
- DynamicCasts: dynamic -> T
- AssignmentCasts: T x = expr; // T must be a ground type

Inference (this will go away)
- InferableLiteral
- InferableClosure
- InferableAllocation

Implicit (no flag yet, but i'll add to disable by default)
- DownCastComposite: Any cast to a non-ground type
- DownCastImplicit: Any other implicit downcast not covered above

A flag is also added to enable/disable all wrapping.  This is not off by default yet, but that is the intent.

R=leafp@google.com

Review URL: https://codereview.chromium.org/1038583004
2015-03-25 14:51:54 -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
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 2ba454d945 Enable inference in the core libs
R=jmesserly@google.com

Review URL: https://codereview.chromium.org/1023543002
2015-03-18 16:24:23 -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 9cf5a077e9 coverage: increase coverage of js_codegen
it was already decent, but this should plug the two biggest holes: source maps and maps with non-string keys

R=vsm@google.com

Review URL: https://codereview.chromium.org/1013223002
2015-03-18 09:20:36 -07:00
Sigmund Cherem 1b23c0ecb2 Copy resources refered to in the HTML to the output folder
R=vsm@google.com

Review URL: https://codereview.chromium.org/1014173002
2015-03-17 18:54:48 -07:00
Jacob Richman d624c322d3 Suppress generation of JsGlobal and JsType code and use window as the default value instead of {} for libraries that define JsGlobal fields.
BUG=
R=jmesserly@google.com

Review URL: https://codereview.chromium.org/1013653004
2015-03-17 14:42:42 -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
Vijay Menon e50906c0d3 Fix for conditional expressions
R=sigmund@google.com

Review URL: https://codereview.chromium.org/997143003
2015-03-16 10:09:25 -07:00
Sigmund Cherem 228a475ed0 Fixes in codegen and test script
R=jmesserly@google.com

Review URL: https://codereview.chromium.org/998043002
2015-03-11 17:16:05 -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 a6befe3a1d Add dart_core.js (fixes #89)
R=vsm@google.com

Review URL: https://codereview.chromium.org/986023003
2015-03-10 18:31:32 -07:00
Sigmund Cherem 6d9564b4ff Support browser caching using hashes in serverMode (fixes #93, fixes #92).
Now the HTML can include a hash in the URL for cachable resources, and the serve knows how to include cache-control headers.

In the process of doing so, I had to change a couple things that made it possible to fix #92 as well (producing different output in the command-line than in server mode).

R=vsm@google.com

Review URL: https://codereview.chromium.org/993213003
2015-03-10 18:27:23 -07:00
Vijay Menon 74476b5e4c Log the runtime type of messages
This makes is a little easier to investigate errors.

R=sigmund@google.com

Review URL: https://codereview.chromium.org/993513005
2015-03-09 11:46:27 -07:00
Vijay Menon 8df5b06aac Fix increment on nullable
R=jmesserly@google.com

Review URL: https://codereview.chromium.org/977153002
2015-03-04 12:56:02 -08:00
Vijay Menon f9909f0d07 Flesh out dynamic invocation code
This gets sunflower working with ignore-types.

R=jmesserly@google.com

Review URL: https://codereview.chromium.org/961513002
2015-03-04 10:13:21 -08:00
Sigmund Cherem 7dd29efd8f Initial cut for a development server
R=jmesserly@google.com

Review URL: https://codereview.chromium.org/973433003
2015-03-04 09:40:06 -08:00
Vijay Menon 946676554b Make int and double nullable by default
See patch set 1 for the initial step back and patch set 2 to try to get some of this back.

R=jmesserly@google.com

Review URL: https://codereview.chromium.org/977613002
2015-03-03 12:08:30 -08:00
Sigmund Cherem f7b7f43d28 Fixing layout in js output (use full paths rather than just the library name)
R=jmesserly@google.com

Review URL: https://codereview.chromium.org/968273002
2015-03-03 09:05:09 -08:00
John Messerly 77e62cc7fb implement private members, fixes #74
naturally, lots of things to iterate on, but this expresses the key idea (per-library ES6 symbols for privacy).

R=vsm@google.com

Review URL: https://codereview.chromium.org/963343002
2015-03-03 06:44:25 -08:00
John Messerly a3aebf03ed fix dummy setters -- grammar requires an identifier
R=vsm@google.com

Review URL: https://codereview.chromium.org/974703003
2015-03-03 06:42:04 -08:00
John Messerly 5d52de79e1 implement rethrow
R=sigmund@google.com

Review URL: https://codereview.chromium.org/969783002
2015-03-02 09:49:17 -08:00
John Messerly a260ce7a62 fixes #69, avoid module name inside module scope
R=vsm@google.com

Review URL: https://codereview.chromium.org/967713002
2015-03-02 07:10:55 -08:00
John Messerly bd06d9e7f4 support the JS builtin
* fix a few cases where we regressed js_ast parser interpolations
* infer correct static type for JS call expressions

R=vsm@google.com

Review URL: https://codereview.chromium.org/962083002
2015-02-27 11:28:41 -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 a3bbe2a291 cleans up sdk patching so we no longer have unresolved names
js_codegen.dart and patch_sdk.dart are the only human-changed files.

This also pulls in dart:isolate, which is depended on from one of the implementation libraries

This also moves dart:_* files back to `lib/_internal/compiler/js_lib/` because there's where libraries.dart points to, and hence Analyzer looks for them there. Alternatively, we could put them somewhere like `tool/input_sdk_internal` and then copy that file into the right path.

R=vsm@google.com

Review URL: https://codereview.chromium.org/955513008
2015-02-26 17:58:13 -08:00
Vijay Menon 50753e3a47 Typecheck constructor initializers properly
R=leafp@google.com

Review URL: https://codereview.chromium.org/959003003
2015-02-26 16:19:27 -08:00
John Messerly ead4fe2e85 merge class extensions from patch files.
There are a few examples of classes like this:

```dart
@patch
class StringBuffer {
  ... various @patch members ...
  // no @patch here
  void _writeString(str) { ... }
}
```

we need to merge in those members too

R=vsm@google.com

Review URL: https://codereview.chromium.org/955513007
2015-02-26 08:08:21 -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
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
Sigmund Cherem 608906db87 Fixes needed so we work correctly with the latest analyzer
Review URL: https://chromereviews.googleplex.com/157367013
2015-02-20 15:39:28 -08:00
Sigmund Cherem d2834b49a6 Reenable type promotion
R=jmesserly@google.com, vsm@google.com

Review URL: https://chromereviews.googleplex.com/159667013
2015-02-20 13:56:46 -08:00
John Messerly 6c7cd9b731 Begin to handle some of the *_patch.dart files
Moves: test/sdk --> tool/input_sdk_src
Also moves: test/sdk/lib/_internal/js_lib --> tool/input_sdk_patch
we'll eventually need to customize that code

Adds tool/patch_sdk.dart, an offline transformation step that produces: test/generated_sdk

Essentially this merges the "external" declarations and the @patch syntactically. There's a comment in tool/patch_sdk.dart explaining the rationale behind this approach.

There's still *lots* to do in the generated code. This does none of that. The only new code is tool/patch_sdk.dart and the minimum changes to test/codegen_test.dart and js_codegen.dart to get test.sh running and debuggable.

Tracking bug for SDK is https://github.com/dart-lang/dart-dev-compiler/issues/58

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

Review URL: https://chromereviews.googleplex.com/157137013
2015-02-20 08:58:01 -08:00
Sigmund Cherem d78ecd3241 Infer consts and final fields based on RHS
R=vsm@google.com

Review URL: https://chromereviews.googleplex.com/142457013
2015-02-19 08:34:01 -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
Vijay Menon eb3c51e6f3 Check default parameters properly
R=leafp@google.com

Review URL: https://chromereviews.googleplex.com/155367013
2015-02-18 12:13:30 -08:00
John Messerly 694c93c61f fix #41, named arguments with conversions
R=leafp@google.com

Review URL: https://chromereviews.googleplex.com/150407013
2015-02-17 13:27:37 -08:00
John Messerly f7a5ff4523 workaround for arrow function bind this
I filed https://github.com/dart-lang/dart-dev-compiler/issues/43 to track removal of this workaround

R=vsm@google.com

Review URL: https://chromereviews.googleplex.com/154077013
2015-02-12 15:18:22 -08:00
John Messerly fe19170e93 better handling of string literals and interpolation
fixes https://github.com/dart-lang/dart-dev-compiler/issues/42
V8 has shipped template strings: https://code.google.com/p/v8/issues/detail?id=3230

R=vsm@google.com

Review URL: https://chromereviews.googleplex.com/152127013
2015-02-12 11:45:39 -08:00
Vijay Menon 266b6df92d Error on uninitialized non-nullables
R=jmesserly@google.com, leafp@google.com

Review URL: https://chromereviews.googleplex.com/157727013
2015-02-12 09:44:41 -08:00
Vijay Menon 9265d63a32 Fix core libs for primitives
R=jacobr@google.com, jmesserly@google.com

Review URL: https://chromereviews.googleplex.com/155017013
2015-02-11 14:10:27 -08:00