Commit Graph

7628 Commits

Author SHA1 Message Date
scheglov@google.com 21fa0f35f8 Issue 21549. Fix for infinite loop in the Angular expression parser (Dart version).
R=brianwilkerson@google.com
BUG= https://code.google.com/p/dart/issues/detail?id=21549

Review URL: https://codereview.chromium.org//717723003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41672 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-11 21:10:57 +00:00
brianwilkerson@google.com bc1972c228 Add parser recovery tests. These correspond to some cases that dart2js is currently handling that I wanted to make sure we also handled.
R=paulberry@google.com

Review URL: https://codereview.chromium.org//703773004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41652 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-11 03:46:08 +00:00
scheglov@google.com 24a93f8cee Report HintCode.UNUSED_ELEMENT for classes.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//704413005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41650 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-11 02:57:23 +00:00
paulberry@google.com 5aa9f8cd8c Fix incorrect syntax in constant evaluation test.
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//711963002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41648 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-10 20:31:27 +00:00
brianwilkerson@google.com 93cecbd276 Fix hurt recovery
R=paulberry@google.com

Review URL: https://codereview.chromium.org//713953002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41646 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-10 19:38:15 +00:00
paulberry@google.com 3bf0ca6aa8 Fix analyzer's treatment of mixin constructors.
This changes analyzer to match the spec (and the VM behavior) with
regard to which base class constructors are forwarded through mixin
applications: only those constructors that take zero optional
parameters are forwarded.  In addition, the tests in tests/language/
are updated to match analyzer and the VM.

There is one small difference between analyzer and the VM behavior:
the spec says that if no constructors are forwarded at all, then the
mixin application will automatically acquire an implicit default
constructor.  The VM behavior is to issue an error in this
circumstance.  After consulting with Gilad, it seems like the VM
behavior is more consistent with the intent, so I've chosen to make
analyzer and the tests match the VM behavior, in the hopes that the
spec can be changed accordingly.

Should we change our minds in the future and decide that we want to
keep the spec as is, the tests and analyzer behavior can easily be
changed.

BUG=dartbug.com/19576
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//707073002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41645 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-10 19:28:40 +00:00
brianwilkerson@google.com c258a1d7f6 Create fewer unnecessary lists
R=scheglov@google.com

Review URL: https://codereview.chromium.org//712083003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41641 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-10 17:25:58 +00:00
brianwilkerson@google.com d23df4f448 Clean up references in comments
R=scheglov@google.com

Review URL: https://codereview.chromium.org//708263002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41623 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-08 15:45:19 +00:00
brianwilkerson@google.com f4f12546ad Fix for issue 20796
R=paulberry@google.com

Review URL: https://codereview.chromium.org//689383005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41622 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-08 04:48:44 +00:00
paulberry@google.com 9c1ea65f07 Prevent conflict between parameter names and local function names.
From section 9.2 (Formal Parameters) of the spec:

  The formal parameter list of a function introduces a new scope known
  as the function's formal parameter scope.  The formal parameter
  scope of a function f is enclosed in the scope where f is declared.

Therefore, if one of the function's parameters has the same name as
the function itself, that isn't a problem.

Previously, we would add a local function to its own formal parameter
scope before visiting it (to allow it to call itself recursively), and
then after visiting it we would add it to the scope of the enclosing
function (so that the enclosing function could call it).

The fix is to add the local function just to the scope of the
enclosing function, and to do it before visiting the local function so
that recursion still works.

BUG=dartbug.com/20074
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//688253004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41621 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-08 01:11:17 +00:00
brianwilkerson@google.com 009128c945 Fix issue 20577
R=paulberry@google.com

Review URL: https://codereview.chromium.org//705393002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41616 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-07 21:33:44 +00:00
brianwilkerson@google.com ec7979a9a2 Fix for issue 20125 - improved error messages
R=scheglov@google.com

Review URL: https://codereview.chromium.org//712663002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41613 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-07 19:29:12 +00:00
paulberry@google.com 8ff8367558 Additional fixes to printing of error codes.
R=scheglov@google.com

Review URL: https://codereview.chromium.org//706933005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41611 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-07 17:43:28 +00:00
brianwilkerson@google.com d289dda555 Fix remaining error code classes
R=scheglov@google.com

Review URL: https://codereview.chromium.org//706283002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41606 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-07 16:24:15 +00:00
paulberry@google.com d3101210b2 Fix printing of error codes in unit tests.
R=scheglov@google.com

Review URL: https://codereview.chromium.org//707733005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41590 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-06 22:31:43 +00:00
danrubel@google.com 668cb980bb ignore exceptions during shutdown
BUG=dartbug.com/21520
R=scheglov@google.com

Review URL: https://codereview.chromium.org//705173002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41585 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-06 21:40:29 +00:00
brianwilkerson@google.com debee8c776 Fix for issue 19100 - better recovery
R=scheglov@google.com

Review URL: https://codereview.chromium.org//692303003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41584 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-06 21:37:27 +00:00
scheglov@google.com 772a0c6b22 Fix 'Unused local variable' hints in analyzer and analysis_server.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//709493002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41576 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-06 18:32:54 +00:00
brianwilkerson@google.com 7ea594bff5 Clean up error codes
R=scheglov@google.com

Review URL: https://codereview.chromium.org//706823003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41574 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-06 17:55:11 +00:00
scheglov@google.com ca91f9f770 Report HintCode.UNUSED_LOCAL_VARIABLE for local variables whose value is never used.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//686113007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41568 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-06 17:00:28 +00:00
scheglov@google.com df6233ae4a Use Element's source paths instead of URIs as a key in the index.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//703963002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41530 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-05 21:02:37 +00:00
brianwilkerson@google.com ba4274b529 Fix documentation (for issue 19253)
R=paulberry@google.com

Review URL: https://codereview.chromium.org//679403005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41527 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-05 17:28:02 +00:00
brianwilkerson@google.com 750b5e426c Fix issue 19424
R=paulberry@google.com

Review URL: https://codereview.chromium.org//700943003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41526 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-05 17:05:58 +00:00
paulberry@google.com 92b1c25f83 Avoid traversing classes when looking for circular references in typedefs.
BUG=dartbug.com/19459
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//705553003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41525 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-05 16:58:56 +00:00
paulberry@google.com df62a0d75d Warn when implicit default value overrides explicit one that differs.
BUG=dartbug.com/18914
R=brianwilkerson@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org//700923002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41503 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-04 20:32:18 +00:00
paulberry@google.com e18464b912 Always check if instance method name collides with superclass static.
Previously we only did this check if nothing was overridden.
Persumably that was intended as a speed optimization, since at first
glance it would seem that if the instance method overrides something,
then it can't possibly conflict with a static method in the
superclass.  However, that optimization doesn't work if the method
being overridden is in an interface (in that case the superclass can
still have a static method with the same name).  So just go ahead and
check in all cases.

BUG=dartbug.com/18947
R=scheglov@google.com

Review URL: https://codereview.chromium.org//698973005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41501 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-04 19:31:31 +00:00
paulberry@google.com ae271bf236 Split the largest classes from resolver.dart to their own files.
This should make resolver.dart small enough to support side-by-side
diffs in the code review tool.

R=scheglov@google.com

Review URL: https://codereview.chromium.org//700753002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41489 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-04 14:04:36 +00:00
paulberry@google.com e5fcd1fd91 Properly restore context when leaving visitor functions in ErrorVerifier.
BUG=dartbug.com/15565
R=scheglov@google.com

Review URL: https://codereview.chromium.org//702623002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41478 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-04 04:17:06 +00:00
paulberry@google.com 18b71fa42a Fix type analysis of the keyword "dynamic".
The type of "dynamic" isn't "dynamic", it's "Type".

BUG=dartbug.com/18731
R=scheglov@google.com

Review URL: https://codereview.chromium.org//680423003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41477 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-04 04:13:06 +00:00
paulberry@google.com 31c3f90301 Properly implement identical() test in analyzer constant evaluation.
Previously we were treating identical(x, y) as equivalent to (x == y).
However the semantics aren't the same.

BUG=dartbug.com/21177
R=scheglov@google.com

Review URL: https://codereview.chromium.org//689173004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41475 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-04 01:32:33 +00:00
paulberry@google.com cd068eb106 Convert analysis starting point to an absolute path before analyzing.
This ensures that if the analysis starting point is part of an import
loop, then once the analysis engine reaches the starting point again,
it will recognize that it's the same file.

BUG=dartbug.com/21440
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//688593005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41473 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-03 22:42:52 +00:00
brianwilkerson@google.com b094516396 Fix early erasure of resolution data
R=scheglov@google.com

Review URL: https://codereview.chromium.org//696343002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41462 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-03 17:29:46 +00:00
paulberry@google.com 9b35b056a7 Fix deprecation warnings in analyzer and analysis server.
R=brianwilkerson@google.com, danrubel@google.com

Review URL: https://codereview.chromium.org//685133003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41461 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-03 17:10:08 +00:00
paulberry@google.com 35c6e351da Fix access semantics for foreach loops.
In a statement like:

  for (x in ...) { ... }

"x" needs to be considered to be in setter context, not getter
context.

R=scheglov@google.com

Review URL: https://codereview.chromium.org//702473002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41460 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-03 16:47:28 +00:00
brianwilkerson@google.com 08713a5230 Add debugging for issues 21013 and 21014
R=scheglov@google.com

Review URL: https://codereview.chromium.org//696293003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41459 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-03 16:37:01 +00:00
rnystrom@google.com 4d70e2f8a4 Optimize LineInfo.getLocation().
Three simple optimizations:

1. Do a binary search through _lineStarts to find the line instead of linear.
2. Store the last result and see if the offset starts there or later. If so, skip leading lines when searching.
3. See if the current offset is on the same line as the last result and exit early if so.

On my benchmark test for the formatter, this reduced it from 13.23ms to 7.57ms.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//692093004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41452 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-31 21:49:10 +00:00
brianwilkerson@google.com e9696e5f67 Clean up logging uses
R=scheglov@google.com

Review URL: https://codereview.chromium.org//685993004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41443 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-31 19:05:19 +00:00
brianwilkerson@google.com 20c13d4715 Fix logging API. This should fix the exception I'm seeing. I'll clean up uses of the deprecated API in a separate CL.
R=scheglov@google.com

Review URL: https://codereview.chromium.org//694833002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41439 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-31 16:22:50 +00:00
brianwilkerson@google.com 3d13808d7d Status page improvements: sort context names, right align numbers, add missing data descriptors.
R=paulberry@google.com

Review URL: https://codereview.chromium.org//685123006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41427 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-30 21:11:40 +00:00
brianwilkerson@google.com 678f9e2a3e Fix issue 21379
R=danrubel@google.com, paulberry@google.com

Review URL: https://codereview.chromium.org//683673004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41426 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-30 21:07:50 +00:00
danrubel@google.com 010f33956f cleanup warnings/hints
BUG=
R=scheglov@google.com

Review URL: https://codereview.chromium.org//685363003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41419 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-30 15:12:30 +00:00
brianwilkerson@google.com 40ad9b8eeb Improve cache entry tests
R=scheglov@google.com

Review URL: https://codereview.chromium.org//686293002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41408 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-29 21:56:56 +00:00
scheglov@google.com e96b29143c Rename ForEachStatement.iterator -> iterable.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//689793003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41405 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-29 21:33:04 +00:00
scheglov@google.com d37866dc50 Issue 21451. Fix for 'Add import' Quick Fix in case when package roots is in use.
R=brianwilkerson@google.com
BUG= https://code.google.com/p/dart/issues/detail?id=21451

Review URL: https://codereview.chromium.org//670263005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41402 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-29 20:51:07 +00:00
paulberry@google.com 03b3d16691 Make table entries on analysis server's '/status' page clickable.
Clicking on a table entry now takes you to a list of files in the
given state.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//685863003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41400 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-29 20:05:16 +00:00
brianwilkerson@google.com 0a20e03aa0 Add tests of incremental scanner
R=scheglov@google.com

Review URL: https://codereview.chromium.org//675173004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41374 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-28 21:51:42 +00:00
scheglov@google.com abeba4c773 Replace custom EngineTestCase.assertEquals() with 'unorderedEquals'.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//673233003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41365 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-28 17:00:06 +00:00
scheglov@google.com d9aa3d8946 Remove unused EngineTestCase.assertX() methods.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//683193002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41362 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-28 16:19:39 +00:00
scheglov@google.com 9a806f616d Replace EngineTestCase.assertSize() with hasLength().
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//686793002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41361 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-28 15:57:33 +00:00
brianwilkerson@google.com e4371e7e39 More code clean-up
R=scheglov@google.com

Review URL: https://codereview.chromium.org//687663002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41359 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-28 15:48:15 +00:00