Commit Graph

43 Commits

Author SHA1 Message Date
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
lrn@google.com 642b7d8a05 Revert "Revert "First step towards having patch files for generic libraries.""
This reapplies r9246 without the (known) bugs.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9282 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-02 09:04:42 +00:00
lrn@google.com 83ce2f9f6e Revert "First step towards having patch files for generic libraries."
This reverts commit r9246.

TBR: floitsch

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9249 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-29 13:49:13 +00:00
lrn@google.com 1fad321449 First step towards having patch files for generic libraries.
As proof of concept, it patches a non-functional htmlEscape from web.dart.

Still has lots of restrictions:
- Only loads a normal library (no syntax extension to mark patches as
separate from additions). Assumes every element is a patch.
- Only handles top-level functions (probably won't handle getters/setters
or constructors), and not classes.
- Doesn't check that the patched function is marked external (no syntax for
that in the spec yet, doesn't even require it to be abstract).
- Doesn't check that the signature of the patch function matches the original
function.
- Probably won't work for 'coreimpl', as loaded from 'js_helper', since it's not
loaded using the 'dart:' scheme.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9246 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-29 12:32:40 +00:00
johnniwinther@google.com d23b5d707d Token.slowCharLength used in SourceSpan.
Assertion changed to handle empty tokens.
getBeginToken() bugs fixed.
getLibraryOrScriptName() added to LibraryElement.
Optional uri argument added to spanFromNode.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9160 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-27 12:39:41 +00:00
ahe@google.com 7b31e54ab7 Implement override checks.
First attempt committed as: https://code.google.com/p/dart/source/detail?r=9108

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9151 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-27 09:07:36 +00:00
antonm@google.com 38bf8c295b Revert "Implement override checks."
TBR=ahe@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9112 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-26 14:36:00 +00:00
ahe@google.com 7f2041bf11 Implement override checks.
Review URL: https://chromiumcodereview.appspot.com//10575033

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9108 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-26 12:51:55 +00:00
sgjesse@google.com 9ab265364b Improve tracking of the type of fields after object construction
Based on the guarenteed types a field is initialized to in both the
initializer lists and constructor bodies give an optimistic type for
this field. Based on all the field setters and invoked setters for
that field turn this optimistic type into either a propagated type or
a guarenteed type.

R=kasperl@google.com, floitsch@google.com

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9019 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-22 09:29:41 +00:00
floitsch@google.com 3d5769cc8b Remove static fields in the namer.
Review URL: https://chromiumcodereview.appspot.com//10574046

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8965 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-21 09:35:08 +00:00
ahe@google.com 84fb6cd409 Remove string constants from Types class.
Review URL: https://chromiumcodereview.appspot.com//10533126

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8660 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-14 14:28:18 +00:00
ahe@google.com 91e2b7794c Resolution based tree-shaking.
Review URL: https://chromiumcodereview.appspot.com//10542073

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8543 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-12 12:35:34 +00:00
ngeoffray@google.com 2cb4416340 Use the typedef arity to know how to invoke a closure given by the dom.
Review URL: https://chromiumcodereview.appspot.com//10441071

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8067 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-29 15:53:54 +00:00
ahe@google.com b4be047301 Add locations to diagnostics.
Review URL: https://chromiumcodereview.appspot.com//10389143

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7660 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-15 16:13:44 +00:00
lrn@google.com 8a73514c3d Add a "Label" Node around an Identifier that is being used as a label.
This is in preparation for rewriting switch to match the "new" switch grammar.
I need to make a block information structure for switch statements, and I don't
want to do that on an obsolete structure.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7485 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-10 12:23:45 +00:00
karlklose@google.com 62dd717be3 This fixes a wrong warning about void functions in which not all paths leads to return or throw statement.
TEST=added to type_checker_test
R=ngeoffray@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7449 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-09 11:12:42 +00:00
floitsch@google.com 5780b25f60 Sort the output (for now just the classes and instance members).
Review URL: https://chromiumcodereview.appspot.com//10310040

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7447 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-09 10:55:27 +00:00
floitsch@google.com 7672f5b74d Fix findMyName by comparing the kind and not the token to EOF_TOKEN.
Review URL: https://chromiumcodereview.appspot.com//10378033

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7416 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-08 14:14:34 +00:00
karlklose@google.com e205b4fdb0 Compute function types together with the parameters.
This avoids resolving the types of arguments twice.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7374 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-07 12:33:09 +00:00
karlklose@google.com 61f38fde3b Set the right context to resolve types of fields, closures and parameters.
R=ngeoffray@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7373 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-07 12:16:59 +00:00
karlklose@google.com 78736ddda9 Remove getType; use the resolver instead.
Review URL: https://chromiumcodereview.appspot.com//10270010

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7250 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-02 18:22:32 +00:00
karlklose@google.com c5e3fc4a9f Address the remaining review comments on http://chromiumcodereview.appspot.com/9431029.
Review URL: https://chromiumcodereview.appspot.com//10115026

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7216 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-02 08:27:13 +00:00
kasperl@google.com 90796f084c Move all the builtin$ interceptors to a new interceptors library and shorten the names of them.
This re-lands r7187 with a few fixes for VM tests and leg tests.

R=floitsch@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7191 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-01 15:18:39 +00:00
kasperl@google.com 29ad15f8e3 Revert "Move all the builtin$ interceptors to a new interceptors library and shorten the names of them."
This reverts r7187.

R=floitsch@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7189 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-01 14:51:21 +00:00
kasperl@google.com 8031e3043a Move all the builtin$ interceptors to a new interceptors library and shorten the names of them.
R=ngeoffray@google.com,floitsch@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7187 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-01 14:44:12 +00:00
karlklose@google.com 8fa9bf1317 Implement simple dynamic type check.
The generated code for the test is:
(before)
 $.isTrue(typeof x === 'object' && !!x.is$Hest, (void 0));
 $.isFalse(typeof x === 'object' && !!x.is$Hest, (void 0));
(with patch)
 $.setRuntimeTypeInfo(x, ({X: 'int'}));
 var t0 = $.getRuntimeTypeInfo(x);
 $.isTrue(typeof x === 'object' && !!x.is$Hest && typeof t0 === 'object' && t0.X === 'int', (void 0));
 var t1 = $.getRuntimeTypeInfo(x);
 $.isFalse(typeof x === 'object' && !!x.is$Hest && typeof t1 === 'object' && t1.X === 'String', (void 0));

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7184 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-01 11:26:59 +00:00
ngeoffray@google.com acffc45787 Introduce typed selectors for getters and setters also for better tree shaking.
FYI: Swarm from 862465 to 848387 (14k saved).
Review URL: https://chromiumcodereview.appspot.com//10191016

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6997 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-26 10:14:01 +00:00
ngeoffray@google.com 78b7ced997 Introduce typed selectors to do better tree shaking based on calls on 'this'. Getters and setters will be next.
Review URL: https://chromiumcodereview.appspot.com//10180001

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6847 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-23 15:36:51 +00:00
karlklose@google.com 6faf28ac22 Use the correct current element when computing the type of function elements.
R=ahe@google.com,kasperl@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6841 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-23 13:36:14 +00:00
ngeoffray@google.com fc16e635d6 Start propagating non-primitive types in the backend, and fold instructions that know about the type of their receiver.
Review URL: https://chromiumcodereview.appspot.com//10119010

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6728 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-19 08:23:42 +00:00
karlklose@google.com 038964d52c Check number of type arguments.
Review URL: https://chromiumcodereview.appspot.com//10105031

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6675 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-18 10:27:32 +00:00
karlklose@google.com 2cccd55714 Remove SimpleType.
Review URL: https://chromiumcodereview.appspot.com//10105027

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6644 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-17 16:05:09 +00:00
floitsch@google.com 07024492b5 Many type fixes.
Review URL: https://chromiumcodereview.appspot.com//10001008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6576 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-16 13:58:20 +00:00
floitsch@google.com 645ae182e0 Look up the correct constructor for default classes.
Review URL: https://chromiumcodereview.appspot.com//9980004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6402 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-11 11:41:13 +00:00
floitsch@google.com c9be80704e Move member-iterating code into ClassElement.
Review URL: https://chromiumcodereview.appspot.com//9873012

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6007 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-29 22:45:03 +00:00
ahe@google.com dc099c4a00 Move frog/leg to lib/compiler/implementation.
Review URL: https://chromiumcodereview.appspot.com//9873021

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5926 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-28 08:54:01 +00:00