-
Notifications
You must be signed in to change notification settings - Fork 26
implement dart:js for ddc #168
Comments
https://codereview.chromium.org/1179643005/ adds code to the build, we need to go through it and make sure it actually works though :) |
the code most likely does not work yet. But this gets it in so we can iterate more easily, from a clean baseline. [email protected] Review URL: https://codereview.chromium.org/1179643005.
it looks like we have almost no dart:js tests in the Dart SDK(!) ... going to write some tests, and also review the code we pulled in ... |
There are about 1000 lines of tests for dart:js in the sdk: On Mon, Jun 15, 2015 at 11:24 AM, John Messerly [email protected]
|
oh, nice! I kind of assumed that was mostly the dart:html integration side, but yeah, it looks like some bits in that can be stolen, like the JsArray tests. |
Yeah those tests barely have to do with dart:html integration. They are in On Mon, Jun 15, 2015 at 1:07 PM, John Messerly [email protected]
|
update: I'm getting closer to having the code+tests working. amusingly, hitting problems just getting package:test to work (e.g. #226 and #227) ... once that's clear I'll see how the tests are doing. The strange thing: for now, we'll continue to proxy generic Dart and JS objects when crossing the boundary, including Arrays, even though that's totally useless to do in DDC (especially for Array). That should give API compatibility with existing apps, though. Otherwise, you'd never be able to get a JsObject/JsArray instances. An alternative design would be to make all JS objects and Arrays "pretend" to have JsObject implemented. We could support calling those members on all objects. Looking over the interface: class JsObject {
callMethod(method, [List args]);
void deleteProperty(property);
bool hasProperty(property);
bool instanceof(JsFunction type);
void operator[](property);
void operator[]=(property, value);
} It wouldn't be too bad to just have those methods on there. Naturally, you'd get a static error trying to call them, unless the target type is |
That is what I was thinking. Having those extension methods on all JS On Wed, Jun 17, 2015 at 9:43 AM, John Messerly [email protected]
|
also just fixed #231 ... still fixing out unrelated issues to see if I can get my tests passing.
Ideally we can do the second step at the same time that dart2js and dartium do, so we aren't losing compatibility those implementations. |
this is proving harder than I thought ... had to make my own lightweight test functions since we can't run package:test yet. I'm down to a handful of test failures though. |
finally ... https://codereview.chromium.org/1200233004/ |
Angular uses this statically, although the hello world sample does not hit it.
@jacob314
The text was updated successfully, but these errors were encountered: