Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(67)

Unified Diff: pkg/path/lib/path.dart

Issue 19939004: Use window.location.href in path under dart2js. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/path/test/browser_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/path/lib/path.dart
diff --git a/pkg/path/lib/path.dart b/pkg/path/lib/path.dart
index 1d83c00cfc9f231b5acc176bde7e1da24ab0d7a4..3d533e101625621c83433590dafe51ce71eabb05 100644
--- a/pkg/path/lib/path.dart
+++ b/pkg/path/lib/path.dart
@@ -20,6 +20,9 @@
/// [pkg]: http://pub.dartlang.org/packages/path
library path;
+@MirrorsUsed(targets: 'dart.dom.html.window, '
+ 'dart.io.Directory.current, '
+ 'dart.io.Platform.operatingSystem')
import 'dart:mirrors';
/// An internal builder for the current OS so we can provide a straight
@@ -37,26 +40,15 @@ void _growListFront(List list, int length, fillValue) =>
/// [LibraryMirror] that gives access to the `dart:io` library.
///
/// If `dart:io` is not available, this returns null.
-LibraryMirror get _io {
- try {
- return currentMirrorSystem().libraries[Uri.parse('dart:io')];
- } catch (_) {
- return null;
- }
-}
+LibraryMirror get _io => currentMirrorSystem().libraries[Uri.parse('dart:io')];
// TODO(nweiz): when issue 6490 or 6943 are fixed, make this work under dart2js.
/// If we're running in Dartium, this will return a [LibraryMirror] that gives
/// access to the `dart:html` library.
///
/// If `dart:html` is not available, this returns null.
-LibraryMirror get _html {
- try {
- return currentMirrorSystem().libraries[Uri.parse('dart:html')];
- } catch (_) {
- return null;
- }
-}
+LibraryMirror get _html =>
+ currentMirrorSystem().libraries[Uri.parse('dart:html')];
/// Gets the path to the current working directory.
///
« no previous file with comments | « no previous file | pkg/path/test/browser_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698