Commit Graph

5559 Commits

Author SHA1 Message Date
hausner@google.com 741a12cfd6 Support const modifier in fields, variables
Issue 3551

This change adds const as a valid keyword to declare fields and
variables. The mandatory initializer has to be a compile time
const expression.

Static final variables still have to be initialized with
compile time constant expressions. I will add non-const static
finals (issue 3558) in another change.

Other small changes:
- allow null in some compile time constant expressions.
- allow only numbers, booleans, strings and null in compile time
  constant string interpolation.
Review URL: https://chromiumcodereview.appspot.com//10828053

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9992 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-27 20:49:24 +00:00
antonm@google.com 35251bba50 Filter out core and auxilary libs.
R=smok@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9976 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-27 13:10:55 +00:00
hausner@google.com 2139048aad Fix cascade_test
Checked mode failed.

TBR=lrn
Review URL: https://chromiumcodereview.appspot.com//10826021

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9913 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-25 21:54:52 +00:00
hausner@google.com a2fec11205 Make sure the "Skip*" functions know about cascades as well.
Also, handle index operator in cascades correctly.
Review URL: https://chromiumcodereview.appspot.com//10809089

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9910 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-25 21:31:02 +00:00
rmacnak@google.com 2ded4b23f2 Fixed copyright date; the code is in fact from this year.
Review URL: https://chromiumcodereview.appspot.com//10832013

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9895 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-25 17:25:04 +00:00
antonm@google.com 74d17a16f9 dart2dart compiler support.
R=whesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9880 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-25 11:20:41 +00:00
rmacnak@google.com 377875ac46 Added a test marked as failing for cascades in expression functions.
Review URL: https://chromiumcodereview.appspot.com//10802099

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9873 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-24 23:39:17 +00:00
vsm@google.com a7446f3ede Update status for IE
6 tests started passing on IE with one of my CLs yesterday (apparently).  I'm suspicious - that was a DOM-related CL and these tests appear unrelated.  But TBRing to get things green.

TBR=floitsch,efortuna@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9848 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-24 14:40:07 +00:00
regis@google.com 1eed55c529 Add missing type finalization for function literals not assigned to a function
variable.
Various cleanup.
Review URL: https://chromiumcodereview.appspot.com//10797031

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9782 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-20 16:08:43 +00:00
regis@google.com 318edd938c Hide names of internal classes from the user by mapping them to the documented
interfaces they implement.
Review URL: https://chromiumcodereview.appspot.com//10800002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9748 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-18 21:51:27 +00:00
floitsch@google.com 8e7c66ac79 Disable GVN for interceptors and fields.
Fixes issue 4086.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9735 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-18 11:41:46 +00:00
floitsch@google.com 82d2bfd9f7 Fix loop-invariant code motion.
We did not take the changes-flags of the instructions in the current
block into account.

Fixes issue 4075.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9695 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-17 11:10:50 +00:00
regis@google.com b86a40f48f Fix type checking of void type.
Fix library and tests accordingly.
Add new test.
Disable new test for dart2js.
Disable some now failing co19 tests (new issue 158 filed).
Hide internal VM String types from user (not complete).
Review URL: https://chromiumcodereview.appspot.com//10787021

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9681 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-16 21:34:07 +00:00
regis@google.com dc96874999 Revert fix for type checking of void type, because some top level tests fail.
Review URL: https://chromiumcodereview.appspot.com//10784020

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9673 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-16 19:05:38 +00:00
regis@google.com a8ceb243f6 Fix type checking of void type.
Fix library and tests accordingly.
Add new test.
Disable new test for dart2js.
Disable some now failing co19 tests (new issue 158 filed).
Hide internal VM String types from user (not complete).
Review URL: https://chromiumcodereview.appspot.com//10704216

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9672 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-16 18:05:55 +00:00
ager@google.com d0e409e89c Fix type annotation error in test.
R=floitsch@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9592 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-12 13:22:58 +00:00
ager@google.com a0a3931bcf Fix bug in recompilation handling.
The recompilation infrastructure would set the propagated type of
operations just before code generation (skipping type propagation and
check insertion). This fixes that by splitting the recompilation
handling into two parts. One that is used only to register
recompilation candidates and one that is used to propagate the field
types for recompilation candidates. The one that propagates types is
only used when directly followed by type-propagation and check
insertion.

Remove the graph.highTypeLikelyhood flag which forced the use of
speculative type assumptions for everything if there was a field with
a likely type. That seems too aggressive to me.

R=floitsch@google.com
BUG=
TEST=language/field_optimization3_test.dart

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9591 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-12 13:11:07 +00:00
johnniwinther@google.com 1274e083f5 Error produced for missing var, final, const or type on field declarations.
BUG=2997
TEST=tests/language/field_decl_missing_var_type_test

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9585 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-12 09:22:53 +00:00
floitsch@google.com c8cd641308 Fix usage of UNKNOWN/CONFLICTING types for union.
Fixes issue 4033.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9547 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-11 10:34:58 +00:00
regis@google.com 5919998308 Fix static type analysis of closure calls (issue 3959).
Add test.
Review URL: https://chromiumcodereview.appspot.com//10762003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9473 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-09 18:02:40 +00:00
floitsch@google.com d356ee6c96 Fix very subtle bug in HNode.changeUse.
Review URL: https://chromiumcodereview.appspot.com//10696120

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9441 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-06 15:22:00 +00:00
kasperl@google.com 8151ee080c Update status files. More stuff pass.
R=efortuna@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9420 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-05 14:00:06 +00:00
kasperl@google.com a9a9ab6b58 Mark more tests as passing on IE.
Lots of stuff works now! More to come.

R=efortuna@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9419 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-05 12:52:12 +00:00
ager@google.com 72b997b522 Reapply change to update dart2js operator equals semantics to follow the latest spec.
Changes since the version that was reverted are in patch set 2:

1. Fix one remaining dart2js test that relied on the old operator== behavior.

2. Fix type intersection operation to actually take null into account. Because of bounded types they should always use canBeNull.

R=floitsch@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9396 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-04 11:29:47 +00:00
regis@google.com 09d3ecf285 Compile an instance setter call when a static getter is declared, but no field
or static setter are declared (issue 3941).
Add test.
Review URL: https://chromiumcodereview.appspot.com//10689083

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9376 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-03 20:40:02 +00:00
ager@google.com 8bca3e8dcb Revert all the changes to equals operator. Causing buildbot trouble.
R=floitsch@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9357 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-03 15:39:14 +00:00
ager@google.com 91704fb99d Fix VM tests by removing test that was not enabled before my commit in any case.
I enabled the test and updated it with the new equality semantics that the
VM does not implement yet. I don't think the test adds much value.

R=floitsch@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9350 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-03 13:47:40 +00:00
ager@google.com 6d5bb70430 Change dart2js to follow the new spec on the equality operator.
'null' is only equals to 'null' and nothing else. The user-defined
operator== is never called with null.

This also means that a 'a == null' and 'null == a' can always be
treated as a builtin when compiling to javascript.

Update the test expectations for co19. I will file co19 bugs about
updating the tests.

R=floitsch@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9348 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-03 13:38:25 +00:00
lrn@google.com b9cf01633f Throw a NullPointerException when throwing null.
BUG=2940

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9280 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-02 07:21:34 +00:00
brianwilkerson@google.com d86c0dc9f9 Fix for issues 3729 and 3523
Review URL: https://chromiumcodereview.appspot.com//10696056

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9270 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-29 21:31:07 +00:00
zundel@google.com f467653c17 Report type warning on assigning to some types of elements
For elements that are instance members, we want to emit a type warning
as opposed to a hard compile-time error.

Issue 3662 : http://code.google.com/p/dart/issues/detail?id=3662

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9255 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-29 17:21:01 +00:00
zundel@google.com 825f8b9cb9 Flag uninitialized final variables in a class.
Issue 3655 : http://code.google.com/p/dart/issues/detail?id=3655

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9233 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-28 22:08:12 +00:00
zundel@google.com f0dac6bd73 Validate the target of break and continue statments from within a switch
Issue 3658 http://code.google.com/p/dart/issues/detail?id=3658

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9220 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-28 20:52:31 +00:00
zundel@google.com 74a356e682 Fixes the scope of case labels so that duplicate case labels are properly detected
Issue 2441 http://code.google.com/p/dart/issues/detail?id=2441

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9200 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-28 14:29:59 +00:00
zundel@google.com f2e095cba3 No compile-time error when overriding a static field or method
In some cases, you need a warning though

Issue 3659 http://code.google.com/p/dart/issues/detail?id=3659
Issue 3779 http://code.google.com/p/dart/issues/detail?id=3779

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9191 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-27 22:18:01 +00:00
zundel@google.com 230d02406c When a variable name is used as a type, emit a warning, not an error
Issue 3474 http://code.google.com/p/dart/issues/detail?id=3474

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9171 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-27 14:21:37 +00:00
floitsch@google.com bc1ecef460 Don't allow statement-nodes in expression contexts.
Review URL: https://chromiumcodereview.appspot.com//10660026

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9163 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-27 13:14:16 +00:00
floitsch@google.com 232fbebdfa Don't lose the expected precedence during && compilation.
When transforming if (foo) bar; to foo && bar make sure that
bar is compiled with the correct precedence.
In particular avoid foo && toto = 499;
instead of
foo && (toto = 499).

Fixes issue 3862.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9157 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-27 11:40:55 +00:00
ahe@google.com 2096714de0 Update status file and fix a "static inheritance" bug.
Review URL: https://chromiumcodereview.appspot.com//10703004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9156 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-27 10:44:21 +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
zundel@google.com cf2fecd6aa An implicit super() invocation wasn't being checked for the wrong # of args
Issue 2580 http://code.google.com/p/dart/issues/detail?id=2580

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9136 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-26 21:14:13 +00:00
zundel@google.com 0d2b905b50 Remove warning about instantiating an abstract class without implementing a member
Issue 2619 : http://code.google.com/p/dart/issues/detail?id=2619

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9128 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-26 19:29:08 +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
lrn@google.com cadba87302 Implement 'as' operator.
This is a quick implementation with room for improvement.
It might work.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9109 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-26 14:23:50 +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
brianwilkerson@google.com 8b400d2dd6 Fix for issue 3519
Review URL: https://chromiumcodereview.appspot.com//10660012

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9083 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-25 20:02:48 +00:00
scheglov@google.com f9b4e096e6 Issue 3748. Support for 'factory lib.Interface.namedConstructor()'
http://code.google.com/p/dart/issues/detail?id=2478

R=brianwilkerson@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9077 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-25 18:23:58 +00:00
regis@google.com f42116940a Disable failing test for dartc.
Review URL: https://chromiumcodereview.appspot.com//10661033

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9074 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-25 18:03:42 +00:00
regis@google.com a966059b8f Add filter for vm specific tests to dart2js status file.
Review URL: https://chromiumcodereview.appspot.com//10665028

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9073 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-25 18:03:24 +00:00
regis@google.com 0532a90a2f Implement type cast in the VM.
Review URL: https://chromiumcodereview.appspot.com//10659005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9070 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-25 17:23:11 +00:00