From 5b3dc92bb9a77455d798f96daadae16552212500 Mon Sep 17 00:00:00 2001 From: Kasper Lund Date: Wed, 12 Mar 2014 08:05:41 +0100 Subject: [PATCH 1/2] fix(zone): Avoid silently ignoring uncaught exceptions by default. --- lib/core/zone.dart | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/core/zone.dart b/lib/core/zone.dart index 6d5eb3e39..808549882 100644 --- a/lib/core/zone.dart +++ b/lib/core/zone.dart @@ -29,18 +29,19 @@ class LongStackTrace { * A better zone API which implements onTurnDone. */ class NgZone { - final async.Zone _outerZone; + final async.Zone _outerZone = async.Zone.current; async.Zone _zone; - NgZone() - : _outerZone = async.Zone.current - { + NgZone() { _zone = _outerZone.fork(specification: new async.ZoneSpecification( run: _onRun, runUnary: _onRunUnary, scheduleMicrotask: _onScheduleMicrotask, handleUncaughtError: _uncaughtError )); + // Prevent silently ignoring uncaught exceptions by forwarding such + // exceptions to the outer zone by default. + onError = (e, s, ls) => _outerZone.handleUncaughtError(e, s); } @@ -99,7 +100,7 @@ class NgZone { _errorThrownFromOnRun = true; rethrow; } finally { - _inFinishTurn = false; + _inFinishTurn = false; } } From a2dbbabc7fad16b9990756baf48f25b8e3ce5b36 Mon Sep 17 00:00:00 2001 From: Kasper Lund Date: Wed, 12 Mar 2014 09:05:13 +0100 Subject: [PATCH 2/2] Fix static warnings/errors. --- lib/core_dom/view.dart | 9 +++++++-- lib/core_dom/view_factory.dart | 8 ++++++-- test/io/test_files/templates/partial.dart | 2 +- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/lib/core_dom/view.dart b/lib/core_dom/view.dart index 8e0ae2ddc..4c12e7405 100644 --- a/lib/core_dom/view.dart +++ b/lib/core_dom/view.dart @@ -62,5 +62,10 @@ class ViewPort { // TODO remove once everybody is using the new names -class Block extends View {} -class BlockHole extends ViewPort {} +class Block extends View { + Block(List nodes) : super(nodes); +} + +class BlockHole extends ViewPort { + BlockHole(dom.Node placeholder, NgAnimate animate) : super(placeholder, animate); +} diff --git a/lib/core_dom/view_factory.dart b/lib/core_dom/view_factory.dart index 9a117c06f..30e972177 100644 --- a/lib/core_dom/view_factory.dart +++ b/lib/core_dom/view_factory.dart @@ -291,5 +291,9 @@ class ElementProbe { // TODO remove once everybody is using the new names -class BlockFactory extends ViewFactory {} -class BoundBlockFactory extends BoundViewFactory {} +abstract class BlockFactory extends ViewFactory { +} + +class BoundBlockFactory extends BoundViewFactory { + BoundBlockFactory(ViewFactory viewFactory, Injector injector) : super(viewFactory, injector); +} diff --git a/test/io/test_files/templates/partial.dart b/test/io/test_files/templates/partial.dart index 0c3e1f05f..6ab9f0cfe 100644 --- a/test/io/test_files/templates/partial.dart +++ b/test/io/test_files/templates/partial.dart @@ -1,4 +1,4 @@ -part of 'main.dart'; +part of test_files.main; @NgComponent( selector: 'my-component',