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

Side by Side Diff: dart/sdk/lib/_internal/compiler/implementation/library_loader.dart

Issue 11464025: dart2js: complain about missing part-of tags. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 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
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 dart2js; 5 part of dart2js;
6 6
7 /** 7 /**
8 * [CompilerTask] for loading libraries and setting up the import/export scopes. 8 * [CompilerTask] for loading libraries and setting up the import/export scopes.
9 */ 9 */
10 abstract class LibraryLoader extends CompilerTask { 10 abstract class LibraryLoader extends CompilerTask {
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 261
262 /** 262 /**
263 * Handle a part tag in the scope of [library]. The [path] given is used as 263 * Handle a part tag in the scope of [library]. The [path] given is used as
264 * is, any URI resolution should be done beforehand. 264 * is, any URI resolution should be done beforehand.
265 */ 265 */
266 void scanPart(Part part, Uri path, LibraryElement library) { 266 void scanPart(Part part, Uri path, LibraryElement library) {
267 if (!path.isAbsolute()) throw new ArgumentError(path); 267 if (!path.isAbsolute()) throw new ArgumentError(path);
268 Script sourceScript = compiler.readScript(path, part); 268 Script sourceScript = compiler.readScript(path, part);
269 CompilationUnitElement unit = 269 CompilationUnitElement unit =
270 new CompilationUnitElement(sourceScript, library); 270 new CompilationUnitElement(sourceScript, library);
271 compiler.withCurrentElement(unit, () => compiler.scanner.scan(unit)); 271 compiler.withCurrentElement(unit, () {
272 compiler.scanner.scan(unit);
273 if (!library.isPlatformLibrary && unit.partTag == null) {
274 compiler.withCurrentElement(library, () {
275 compiler.onDeprecatedFeature(part, 'missing part-of tag');
ngeoffray 2012/12/10 13:06:51 Should onDeprecatedFeature check isPlatformLibrary
ahe 2012/12/10 13:29:33 Done.
276 });
277 compiler.reportMessage(
278 compiler.spanFromElement(unit),
279 MessageKind.MISSING_PART_OF_TAG.error([]),
280 api.Diagnostic.INFO);
281 }
282 });
272 } 283 }
273 284
274 /** 285 /**
275 * Handle an import/export tag by loading the referenced library and 286 * Handle an import/export tag by loading the referenced library and
276 * registering its dependency in [handler] for the computation of the import/ 287 * registering its dependency in [handler] for the computation of the import/
277 * export scope. 288 * export scope.
278 */ 289 */
279 void registerLibraryFromTag(LibraryDependencyHandler handler, 290 void registerLibraryFromTag(LibraryDependencyHandler handler,
280 LibraryElement library, 291 LibraryElement library,
281 LibraryDependency tag) { 292 LibraryDependency tag) {
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
700 } 711 }
701 712
702 /** 713 /**
703 * Registers all top-level entities of [library] as starting point for the 714 * Registers all top-level entities of [library] as starting point for the
704 * fixed-point computation of the import/export scopes. 715 * fixed-point computation of the import/export scopes.
705 */ 716 */
706 void registerLibraryExports(LibraryElement library) { 717 void registerLibraryExports(LibraryElement library) {
707 nodeMap[library].registerInitialExports(); 718 nodeMap[library].registerInitialExports();
708 } 719 }
709 } 720 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698