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

Side by Side Diff: pkg/polymer/lib/src/loader.dart

Issue 116443007: Fix how we compute _packageRoot in loader.dart. This is to fix a rare (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/polymer/CHANGELOG.md ('k') | pkg/polymer/pubspec.yaml » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of polymer; 5 part of polymer;
6 6
7 /** Annotation used to automatically register polymer elements. */ 7 /** Annotation used to automatically register polymer elements. */
8 class CustomTag { 8 class CustomTag {
9 final String tagName; 9 final String tagName;
10 const CustomTag(this.tagName); 10 const CustomTag(this.tagName);
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 } 132 }
133 133
134 /** All libraries in the current isolate. */ 134 /** All libraries in the current isolate. */
135 final _libs = currentMirrorSystem().libraries; 135 final _libs = currentMirrorSystem().libraries;
136 136
137 // TODO(sigmund): explore other (cheaper) ways to resolve URIs relative to the 137 // TODO(sigmund): explore other (cheaper) ways to resolve URIs relative to the
138 // root library (see dartbug.com/12612) 138 // root library (see dartbug.com/12612)
139 final _rootUri = currentMirrorSystem().isolate.rootLibrary.uri; 139 final _rootUri = currentMirrorSystem().isolate.rootLibrary.uri;
140 140
141 final String _packageRoot = 141 final String _packageRoot =
142 '${path.dirname(Uri.parse(window.location.href).path)}/packages/'; 142 path.url.join(path.url.dirname(Uri.parse(window.location.href).path),
143 'packages') + '/';
143 144
144 final Logger _loaderLog = new Logger('polymer.loader'); 145 final Logger _loaderLog = new Logger('polymer.loader');
145 146
146 /** 147 /**
147 * Reads the library at [uriString] (which can be an absolute URI or a relative 148 * Reads the library at [uriString] (which can be an absolute URI or a relative
148 * URI from the root library), and: 149 * URI from the root library), and:
149 * 150 *
150 * * If present, invokes any top-level and static functions marked 151 * * If present, invokes any top-level and static functions marked
151 * with the [initMethod] annotation (in the order they appear). 152 * with the [initMethod] annotation (in the order they appear).
152 * 153 *
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 print("warning: methods marked with @initMethod should take no " 212 print("warning: methods marked with @initMethod should take no "
212 "arguments, ${method.simpleName} expects some."); 213 "arguments, ${method.simpleName} expects some.");
213 return; 214 return;
214 } 215 }
215 obj.invoke(method.simpleName, const []); 216 obj.invoke(method.simpleName, const []);
216 } 217 }
217 218
218 class _InitMethodAnnotation { 219 class _InitMethodAnnotation {
219 const _InitMethodAnnotation(); 220 const _InitMethodAnnotation();
220 } 221 }
OLDNEW
« no previous file with comments | « pkg/polymer/CHANGELOG.md ('k') | pkg/polymer/pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698