Commit Graph

85 Commits

Author SHA1 Message Date
karlklose@google.com 5ac1789d6c Fix dart2dart and dart2js build.
TBR=antonm@google.com

Review URL: https://chromiumcodereview.appspot.com//10827442

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11051 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-21 14:36:38 +00:00
antonm@google.com d5525c3fa6 Better version of TypeVariableElement.position.
R=ahe@google.com,johnniwinther@google.com

Review URL: https://chromiumcodereview.appspot.com//10837361

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11047 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-21 14:10:33 +00:00
antonm@google.com 435969e63b Implement TypeVariableElement.position.
R=ahe@google.com,johnniwinther@google.com

Review URL: https://chromiumcodereview.appspot.com//10824399

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11044 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-21 13:54:05 +00:00
karlklose@google.com aeafe0fdda Add erroneous elements for function types and use them to allow unresolvable constructors to be handled in the backend.
This is the first step towards runtime error handling of unresolvable constructors, library prefixes and constructor names in new-expressions.

Review URL: https://chromiumcodereview.appspot.com//10829379

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11042 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-21 13:40:07 +00:00
ahe@google.com 2134fa0fc1 Clean up state handling in ClassElement.
Review URL: https://chromiumcodereview.appspot.com//10823311

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11040 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-21 13:23:34 +00:00
karlklose@google.com 16a2cbd760 Fix some type warnings.
Review URL: https://chromiumcodereview.appspot.com//10824350

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11028 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-21 10:38:00 +00:00
ahe@google.com 19851497ff Support new getter syntax.
Review URL: https://chromiumcodereview.appspot.com//10831332

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10956 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-20 13:26:38 +00:00
lrn@google.com ed1ed6472d Make top-level patch injections be compilation unit under library.
Review URL: https://chromiumcodereview.appspot.com//10824347

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10895 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-17 13:08:00 +00:00
ajohnsen@google.com 3109b142a3 Fix a performance regressions introduced by r10632.
This gives the compiler the exact same behaviour as before.

BUG=

Review URL: https://chromiumcodereview.appspot.com//10827353

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10891 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-17 12:12:53 +00:00
johnniwinther@google.com ac5a4808d8 Skeleton typedef type implementation
Review URL: https://chromiumcodereview.appspot.com//10832136

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10880 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-17 11:15:44 +00:00
ager@google.com 59df4e7735 Add a couple of workarounds for issues caused by current dart2js patch
support.

R=johnniwinther@google.com,lrn@google.com
BUG=

Review URL: https://chromiumcodereview.appspot.com//10836312

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10878 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-17 10:45:08 +00:00
floitsch@google.com ecae19772f Fix field-accesses for private fields that were "shadowed" by other private fields.
Review URL: https://chromiumcodereview.appspot.com//10827359

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10827 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-16 16:16:17 +00:00
kasperl@google.com 3b87631a1c Make selector registration in the resolver and code generator more explicit.
Get rid of registerFieldClosureInvocations() in the enqueuer by explicit
registering the closure call selectors when we may be calling a getter in
the resolver and the code generator.

R=floitsch@google.com,ahe@google.com
BUG=

Review URL: https://chromiumcodereview.appspot.com//10854158

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10805 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-16 11:52:44 +00:00
lrn@google.com 640e0ee99b Clean-up of getCompilationUnit.
Fixes a few places that assumes libraries can be compilation units.
- VoidElement now belongs to the entry compilation unit of the core library.
- Abstract fields now belong to the compilation unit of the creating accessor.

Review URL: https://chromiumcodereview.appspot.com//10834330

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10711 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-15 11:38:56 +00:00
ahe@google.com 474a7d6d56 Check overrides.
Review URL: https://chromiumcodereview.appspot.com//10836235

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10677 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-14 20:23:58 +00:00
kasperl@google.com e8268dd78a Add name and library to selectors.
This is the first step towards improving the Selector as an
abstraction used by the resolver, builder, and enqueur. The
intent is to have the resolver construct selectors that can
be used for method lookup, tree shaking, and for simplifying
the logic we use to build the correct SSA instructions for
sends (some of which are quite complex).

Next step is to get rid of more of the adhoc selector building
that's done outside of the resolver and clean up how we resolve
sends. After that, I'll start removing the need for passing
around both a name and a selector in a lot of places.

R=ahe@google.com,sgjesse@google.com
BUG=

Review URL: https://chromiumcodereview.appspot.com//10825337

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10637 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-14 12:21:51 +00:00
ajohnsen@google.com a262657ca0 Fix bugs found in checked mode.
BUG=

Review URL: https://chromiumcodereview.appspot.com//10826302

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10636 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-14 12:08:31 +00:00
ajohnsen@google.com 404f888f83 Refactor Library/CompilationUnit and how we define local Scope.
This also collapses members and constructors of a class into the same
map.

BUG=

Original URL: https://chromiumcodereview.appspot.com//10832203

Review URL: https://chromiumcodereview.appspot.com//10830303

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10632 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-14 11:35:17 +00:00
lrn@google.com 8972a0b9ad Add missing abort on duplicate class fields.
Review URL: https://chromiumcodereview.appspot.com//10832291

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10626 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-14 10:40:53 +00:00
ahe@google.com 26f63f029a Ensure supertypes are loaded safely.
Review URL: https://chromiumcodereview.appspot.com//10855125

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10586 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-13 16:42:41 +00:00
lrn@google.com 81434e3dab Fix bug in patch injection CL.
TBR=ager@google.com

Review URL: https://chromiumcodereview.appspot.com//10830279

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10564 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-13 12:09:30 +00:00
lrn@google.com d134e7d052 Allow patch files to add declarations to the patched library.
Review URL: https://chromiumcodereview.appspot.com//10831262

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10562 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-13 11:58:48 +00:00
ajohnsen@google.com dd8585d5a2 Revert "Refactor Library/CompilationUnit and how we define local Scope."
This reverts commit 05718e680ca45ac26fcc0d0256fc98419fac1b2e.

BUG=

Review URL: https://chromiumcodereview.appspot.com//10824275

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10550 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-13 06:45:24 +00:00
ajohnsen@google.com ccc0ce3101 Refactor Library/CompilationUnit and how we define local Scope.
This also collapses members and constructors of a class into the same
map.

BUG=

Review URL: https://chromiumcodereview.appspot.com//10832203

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10549 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-13 06:22:24 +00:00
floitsch@google.com 63bce914b7 Implement call operator.
Committed: https://code.google.com/p/dart/source/detail?r=10495

Review URL: https://chromiumcodereview.appspot.com//10834270

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10507 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-10 14:19:31 +00:00
floitsch@google.com dafca6eb63 Revert "Implement call operator."
This reverts commit 10495.

Review URL: https://chromiumcodereview.appspot.com//10854093

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10498 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-10 12:37:47 +00:00
floitsch@google.com 0feeece251 Implement call operator.
Review URL: https://chromiumcodereview.appspot.com//10834270

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10495 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-10 12:20:30 +00:00
lrn@google.com 97b4df393f Reduce usage of .enclosingElement to get enclosing class.
Currently code assumes that a member's immediate enclosingElement is
its class element.
If we introduce compilation unit override elements into the enclosing
chain, this will no longer be true.
This CL changes the places that assumes this to use isMember() or
getEnclosingClass(). The assumption is still in place in isMember(),
which will need to be modified when things change.

Review URL: https://chromiumcodereview.appspot.com//10834243

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10438 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-09 12:47:42 +00:00
floitsch@google.com 449c8dee83 Make field-get/set work without elements.
Review URL: https://chromiumcodereview.appspot.com//10831154

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10334 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-07 12:54:03 +00:00
johnniwinther@google.com 3ce4405ced Revert "Skeleton typedef type implementation"
This reverts revision 10234.

Review URL: https://chromiumcodereview.appspot.com//10829168

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10235 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-03 16:06:19 +00:00
johnniwinther@google.com 21855b3b1a Skeleton typedef type implementation
Review URL: https://chromiumcodereview.appspot.com//10832136

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10234 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-03 15:48:49 +00:00
johnniwinther@google.com 729194a689 Change final field to abstract getter.
Review URL: https://chromiumcodereview.appspot.com//10828149

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10227 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-03 12:31:54 +00:00
johnniwinther@google.com 832a3f46a3 Unify ClassElement and TypedefElement.
Review URL: https://chromiumcodereview.appspot.com//10825177

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10221 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-03 11:10:38 +00:00
johnniwinther@google.com 0cf46c3db1 Refactor scope handling.
Review URL: https://chromiumcodereview.appspot.com//10837095

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10220 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-03 11:08:40 +00:00
ajohnsen@google.com 5b563a82dd Revert 'Port the remaining of dart:core to the unified corelib.'
BUG=

Review URL: https://chromiumcodereview.appspot.com//10831125

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10159 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-02 11:07:49 +00:00
ajohnsen@google.com e029198035 Port the remaining of dart:core to the unified corelib.
This also adds support for injecting private fields and functions from
class patches.

BUG=

Review URL: https://chromiumcodereview.appspot.com//10830117

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10156 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-02 10:18:25 +00:00
antonm@google.com 7bc0e0d9a3 Properly emit variable declarations.
VariableElements share definition in VarialbleListElement, so it should be
only output once.

R=smok@google.com

Review URL: https://chromiumcodereview.appspot.com//10837025

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10082 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-31 18:56:00 +00:00
smok@google.com 5ae046785f Revert https://chromiumcodereview.appspot.com/10789012/
We now use default class for ClassElement

Review URL: https://chromiumcodereview.appspot.com//10834065

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10041 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-31 08:11:20 +00:00
johnniwinther@google.com 1dda757cf0 Parameters with function types supported + Added features in mirrors implementation
VariableListElement.computeType now handles function types.
Default value and function typed parameters supported in the mirror system.

Review URL: https://chromiumcodereview.appspot.com//10779010

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9756 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-19 13:17:10 +00:00
smok@google.com 422a8ae338 Record default clause for interfaces in parser.
Use it in dart2dart emitter

Review URL: https://chromiumcodereview.appspot.com//10789012

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9662 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-16 13:29:58 +00:00
lrn@google.com 2d58755073 Revert "Allow patch files to add top-level declarations to the patched library."
This reverts r9629.

TBR: floitsch

Review URL: https://chromiumcodereview.appspot.com//10702204

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9630 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-13 13:59:54 +00:00
lrn@google.com 7621533549 Allow patch files to add top-level declarations to the patched library.
The patch library is loaded normally, and then non-patch methods and classes
are cloned and added to the patched library. To support methods from other
compilation units, all elements now has a scriptOverride field that lets
them report a different script than the one of their enclosing element.
(For top-level elements that's already possible, as that's what #source does,
but for fields inside a class, we can't easily wrap a compilation unit element
around them.)

TBR: floitsch
(to get in before vacation, with reversion rights).

Review URL: https://chromiumcodereview.appspot.com//10703188

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9629 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-13 13:46:21 +00:00
johnniwinther@google.com fdbabb995e Dartdoc and Apidoc updated to use dart2js through the mirror system.
BUG=3414

Review URL: https://chromiumcodereview.appspot.com//10701091

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9584 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-12 08:52:19 +00:00
lrn@google.com 42f353fad1 Patch methods in classes.
Add math library in corelib/unified. Location subject to change.
Made _Random's implementation external and patched it to use JS random.
Made "external" marking acually work.

Review URL: https://chromiumcodereview.appspot.com//10696147

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9544 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-11 08:47:24 +00:00
floitsch@google.com 596f69cae0 Use better names for closures and static variables.
This increases the code size, but goes away with a minifier.

Review URL: https://chromiumcodereview.appspot.com//10693123

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9468 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-09 14:40:13 +00:00
lrn@google.com aa8f2cf676 Recognize "patch" identifier in .dartp files.
Added more infrastructure to detect errors in the patch.
Still no ability to add an element from the patch to the original library.

Review URL: https://chromiumcodereview.appspot.com//10697084

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9457 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-09 06:39:57 +00:00
lrn@google.com 9010ea745c Add "external" prefix to methods and constructors.
This is expected to be added to the language specification, for allowing the specification of methods with externally bound implementations.

Review URL: https://chromiumcodereview.appspot.com//10697096

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9456 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-09 06:37:51 +00:00
lrn@google.com d1da93a393 Reapply "Make patch file import declarations apply to the patched library too."
This reapplies r9346 with the following fix:
Adds #library tag to tests containing #import.
The test web-driver tries to source the file if it doesn't contain
a #library declaration, which isn't valid if it contains #import.

R=floitsch

Review URL: https://chromiumcodereview.appspot.com//10698096

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9401 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-04 12:02:28 +00:00
lrn@google.com b5ce02776b Revert "Make patch file import declarations apply to the patched library too."
This reverts commit r9346.

TBR=floitsch

Review URL: https://chromiumcodereview.appspot.com//10704080

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9354 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-03 14:25:50 +00:00
lrn@google.com c86ce92f07 Make patch file import declarations apply to the patched library too.
Add a math library and apply patching to that, instead of to the web library.
We still have a default Math class with the same functionality, which isn't patched.

Review URL: https://chromiumcodereview.appspot.com//10694067

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9346 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-03 13:01:15 +00:00