Commit Graph

187 Commits

Author SHA1 Message Date
lrn@google.com 2ab1f1238f Trying to make preamble for d8.
Preamble handles timers and task queue.

R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34967 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-11 10:29:06 +00:00
sigurdm@google.com dc92146b57 Load deferred chunks in the right order.
A chunk can depend on classes in shared chunks. Therefore sort they are
sorted, and loaded sequentially.

BUG= dartbug.com/17890
R=floitsch@google.com

Committed: https://code.google.com/p/dart/source/detail?r=34698

Reverted: r34702

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34915 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-10 08:48:11 +00:00
sigurdm@google.com 9150d1ce0c Revert "Load deferred chunks in the right order."
This reverts commit 34698.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34702 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-03 12:47:20 +00:00
sigurdm@google.com 22d8c97cd2 Load deferred chunks in the right order.
A chunk can depend on classes in shared chunks. Therefore sort they are
sorted, and loaded sequentially.

BUG= dartbug.com/17890
R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34698 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-03 12:15:18 +00:00
kevmoo@google.com 0726458e52 tests: import unittest via package: url
R=ricow@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34602 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-01 16:12:39 +00:00
kevmoo@google.com 5952d7a067 Upgrading tests with unittest deprecations
R=ricow@google.com, sigmund@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34569 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-31 18:33:18 +00:00
ajohnsen@google.com 9da7487c36 Revert accidental parts of "Speed up toLowerCase, by manually inlining the upper-case part."
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34425 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-26 12:32:58 +00:00
ajohnsen@google.com a9f357b4b6 Speed up toLowerCase, by manually inlining the upper-case part.
Some benchmarks show up to 25% faster toLowerCase.

BUG=
R=lrn@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34423 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-26 12:19:55 +00:00
lrn@google.com dc091c476c Make zone variables accept any value as key.
R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34248 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-21 13:30:19 +00:00
floitsch@google.com 7b49ffc729 Make stream_timeout_test less likely to flake.
R=lrn@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33214 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-03 13:18:29 +00:00
sigurdm@google.com d807878bbd Add prefix constraints for deferred imports.
R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32881 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-21 09:39:50 +00:00
sigurdm@google.com 5c95691ada Let deferred load work from worker isolates.
If we try to load a deferred library from a worker-isolate we cannot
inject a script tag because we do not have access to the dom. Instead we
make an XMLHttpRequest object and load the code with that.

I tried to take some care of error handling introducing a new exception.

R=floitsch@google.com

Committed: https://code.google.com/p/dart/source/detail?r=32693

Committed: https://code.google.com/p/dart/source/detail?r=32695

Committed: https://code.google.com/p/dart/source/detail?r=32698

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32700 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-14 14:04:22 +00:00
sigurdm@google.com 0b1fee8131 Let deferred load work from worker isolates.
If we try to load a deferred library from a worker-isolate we cannot
inject a script tag because we do not have access to the dom. Instead we
make an XMLHttpRequest object and load the code with that.

I tried to take some care of error handling introducing a new exception.

R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32693 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-14 12:12:58 +00:00
kevmoo@google.com b565b6296f pkg/unittest: Run tests in zones
Added a changelog to unittest
Deprecated a number of methods made extraneous by zone change
Fixed related issues in html and html tests

BUG= https://code.google.com/p/dart/issues/detail?id=13277
BUG= https://code.google.com/p/dart/issues/detail?id=16541
R=sigmund@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32400 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-07 01:34:20 +00:00
kevmoo@google.com 9b5165c2f8 Reverting 32284 - unittest using zones - investigating breaks in html
R=blois@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32288 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-04 20:51:44 +00:00
kevmoo@google.com 245640e3d9 pkg/unittest: Run each test in a Zone
added a change log
Deprecate methods with behavior subsumed by runZoned
removed rerunTests
updated async/future_timeout_test to not assume Zone.ROOT during test run

BUG= https://code.google.com/p/dart/issues/detail?id=13277
R=nweiz@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32284 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-04 17:52:44 +00:00
ajohnsen@google.com 10c04ad443 Introduce and use Zone:_enter and Zone:_leave, in Future.
This is the first step toward clearer zone specification usage, and
potential ZoneSpecification.onEnter/onLeave callbacks.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32123 260f80e4-7a28-3924-810f-c04153c831b5
2014-01-29 15:31:12 +00:00
lrn@google.com e31e81144d Attempt to make stream-timeout test less flaky.
If the periodic timer gets starved long enough, the timeout might
happen. If the 5ms periodic timer hasn't triggered in 250ms, discard
the test (i.e., don't fail anyway).

R=ajohnsen@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32054 260f80e4-7a28-3924-810f-c04153c831b5
2014-01-28 08:58:21 +00:00
lrn@google.com 30683bdc79 Fix typo in failure-branch of stream iterator test.
Also increment pkg/async version to fix broken first upload.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31322 260f80e4-7a28-3924-810f-c04153c831b5
2013-12-20 07:58:49 +00:00
lrn@google.com d4be6ccd68 Update stream iterator doc and add test.
BUG= http://dartbug.com/15449
R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31317 260f80e4-7a28-3924-810f-c04153c831b5
2013-12-20 07:14:37 +00:00
lrn@google.com 70f6617532 Revert "Fix VM timer firing too early."
Committed: https://code.google.com/p/dart/source/detail?r=30987

R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31009 260f80e4-7a28-3924-810f-c04153c831b5
2013-12-10 08:40:56 +00:00
lrn@google.com dd6ee012d1 Revert "Fix VM timer firing too early."
Review URL: https://codereview.chromium.org//101293006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30987 260f80e4-7a28-3924-810f-c04153c831b5
2013-12-09 13:43:52 +00:00
lrn@google.com 2aa9f026f2 Change Future.timeout callback to a named parameter.
R=floitsch@google.com

Committed: https://code.google.com/p/dart/source/detail?r=30790

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30985 260f80e4-7a28-3924-810f-c04153c831b5
2013-12-09 12:06:12 +00:00
lrn@google.com c5a3337ae3 Change the zone that late-added stream subscription callbacks are registered in.
They are always called in the subscription's zone, but they were
registered in the current zone.

R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30896 260f80e4-7a28-3924-810f-c04153c831b5
2013-12-05 14:45:46 +00:00
lrn@google.com 6af11cac37 Add Stream.timeout method.
R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30895 260f80e4-7a28-3924-810f-c04153c831b5
2013-12-05 13:32:31 +00:00
lrn@google.com 8744794212 Change other futures to also have timeout take a named parameter.
Review URL: https://codereview.chromium.org//98683002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30792 260f80e4-7a28-3924-810f-c04153c831b5
2013-12-02 09:13:49 +00:00
lrn@google.com 3d819ee9cb Change Future.timeout callback to a named parameter.
R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30790 260f80e4-7a28-3924-810f-c04153c831b5
2013-12-02 08:48:00 +00:00
lrn@google.com e0314a6117 Add Future.timeout.
R=floitsch@google.com, nweiz@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30745 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-28 08:16:01 +00:00
lrn@google.com 726b72771e Make the root zone's schduleMicrotask and create[Periodic]Timer bind the callback.
BUG= http://dartbug.com/15232
R=floitsch@google.com

Committed: https://code.google.com/p/dart/source/detail?r=30708

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30711 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-27 11:55:35 +00:00
lrn@google.com 1d9e1d5b93 Make the root zone's schduleMicrotask and create[Periodic]Timer bind the callback.
BUG= http://dartbug.com/15232
R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30708 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-27 11:42:04 +00:00
lrn@google.com f3a501e7c6 Make Future.wait have an eagerError option that defaults to false.
This means that Future.wait will, by default, wait for all futures to
complete, even if there is an error.
All but the first error are dropped, and the future completes with the
first error.

If eagerError is set to true, the returned future completes immediately
on the first error.

BUG= http://dartbug.com/14794
R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30443 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-20 09:28:48 +00:00
floitsch@google.com 91b5e131ee Make catch_errors13_test non-flaky.
Was flaky on buildbot:
http://build.chromium.org/p/client.dart/builders/dartium-mac-debug-be/builds/410/steps/drt_core_checked_tests/logs/stdio

R=sra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30087 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-08 00:19:57 +00:00
floitsch@google.com 6bdd901604 Add test that makes sure print deals with broken toStrings.
R=ahe@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29994 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-06 20:40:03 +00:00
floitsch@google.com 8fdee3bb18 Propagate stack trace when using Future.wait.
BUG= http://dartbug.com/14755
R=ajohnsen@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29923 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-05 18:42:48 +00:00
floitsch@google.com 1532e6db73 Add safety margin to timer_isolate_test.dart
Should make the test less flaky.

R=ajohnsen@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29921 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-05 18:20:34 +00:00
floitsch@google.com 35e9ae50d9 Fix warnings in library-tests.
R=lrn@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29756 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-01 17:01:11 +00:00
floitsch@google.com 7006de6f23 Remove deprecated parts of dart:async.
Attempt to fix most uses of the deprecated features.

R=floitsch@google.com, nweiz@google.com, rnystrom@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29628 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-31 02:24:29 +00:00
regis@google.com 3fa7a61efc Implement latest spec changes regarding malformed types (see issue 14006):
- a malformed type used in a is, as, or catch type test results in a dynamic
  type error being thrown.
- a malformed type is not mapped to dynamic anymore.

For now, this applies to type tests in checked mode as well, but discussion is
still on-going.

R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29608 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-30 23:30:32 +00:00
lrn@google.com 72e6685c6a Change and documentat how completer handles futures.
Completer.complete changes signature to accept 'var' and chain if the
argument is a future.
Completer.completeError throws if error is a future or null.
Documentation updated to match.
Fix error in implementation of completeError which dropped listeners when
chained. If the chained-to future is not a _Future, the listeners cannot
be forwarded.

BUG= http://dartbug.com/14211 http://dartbug.com/14212 http://dartbug.com/14435
R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29518 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-30 09:22:29 +00:00
lrn@google.com c0bbe6e388 Expose the cancelOnError in the StreamController.addStream.
Type tests, so this would have been caught.

R=ajohnsen@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29434 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-29 11:28:29 +00:00
lrn@google.com 5b0ac43e80 Fix bugs in StreamController.addStream.
Add optional 'cancelOnError' to addStream method. It still defaults
to true.
Resume the added stream when adding a listener (14332).
Handle cancel-on-error correctly, so the future completes as well (14334).

BUG= http://dartbug.com/14332 http://dartbug.com/14334
R=ajohnsen@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29419 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-29 08:59:52 +00:00
lrn@google.com 4e69511eac Make Stream.fromIterable only accept a single listen call.
BUG= http://dartbug.com/13722
R=ajohnsen@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29357 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-28 12:18:00 +00:00
floitsch@google.com 6a72655d1b Very simple version of Isolates.
R=ajohnsen@google.com, iposva@google.com, kasperl@google.com, lrn@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29271 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-25 19:23:00 +00:00
floitsch@google.com 930cf81a5a Fix indentation.
Review URL: https://codereview.chromium.org//44113003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29250 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-25 13:08:43 +00:00
floitsch@google.com d8ebf58a39 Remove default value in factory constructor.
BUG= http://dartbug.com/14284
R=lrn@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29064 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-23 08:27:15 +00:00
ajohnsen@google.com a969c5297b Don't use non-0 Timers for async tests.
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28930 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-21 13:03:52 +00:00
ajohnsen@google.com eb64b2486f Let StreamSubscription.cancel return a Future.
This gives the ability mark a subscription cancel as asynchrouns. Thiw
now means that StreamController's onCancel takes either a value (null in
    most cases) and a Future, just like 'new Future(() => value)'.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28925 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-21 12:09:41 +00:00
floitsch@google.com af06e8ba5a Fix scheduleImmediate in Dartium.
BUG= http://dartbug.com/14146
R=blois@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28792 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-17 08:59:32 +00:00
lrn@google.com a2e03e5463 Fix flaky stream_controller_async_test.
BUG= http://dartbug.com/163608
R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28719 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-16 11:29:13 +00:00
ajohnsen@google.com 732ab1ce4d Add factory-method for scheduleMicrotask, as well as a (failing) test.
BUG=
R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28653 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-15 16:22:04 +00:00