Merge pull request #2422 from abarth/init_bundle

Make _initRootBundle more robust
This commit is contained in:
Adam Barth 2016-03-04 18:15:45 -08:00
commit 7c4aef60b7
2 changed files with 5 additions and 12 deletions

View File

@ -96,14 +96,11 @@ class MojoAssetBundle extends CachingAssetBundle {
} }
AssetBundle _initRootBundle() { AssetBundle _initRootBundle() {
try { int h = ui.takeRootBundleHandle();
AssetBundleProxy bundle = new AssetBundleProxy.fromHandle( if (h == core.MojoHandle.INVALID)
new core.MojoHandle(ui.takeRootBundleHandle())
);
return new MojoAssetBundle(bundle);
} catch (e) {
return null; return null;
} core.MojoHandle handle = new core.MojoHandle(h);
return new MojoAssetBundle(new AssetBundleProxy.fromHandle(handle));
} }
final AssetBundle rootBundle = _initRootBundle(); final AssetBundle rootBundle = _initRootBundle();

View File

@ -46,9 +46,5 @@ void _debugPrintTask() {
} }
void debugPrintStack() { void debugPrintStack() {
try { debugPrint(StackTrace.current.toString());
throw new Exception();
} catch (e, stack) {
debugPrint(stack.toString());
}
} }