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

Side by Side Diff: pkg/compiler/lib/src/warnings.dart

Issue 1023673012: Emit diagnostics for bad NSM implementations (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 const DONT_KNOW_HOW_TO_FIX = "Computer says no!"; 7 const DONT_KNOW_HOW_TO_FIX = "Computer says no!";
8 8
9 /** 9 /**
10 * The messages in this file should meet the following guide lines: 10 * The messages in this file should meet the following guide lines:
(...skipping 2392 matching lines...) Expand 10 before | Expand all | Expand 10 after
2403 static const MessageKind MIRRORS_LIBRARY_NEW_EMITTER = 2403 static const MessageKind MIRRORS_LIBRARY_NEW_EMITTER =
2404 const MessageKind( 2404 const MessageKind(
2405 "dart:mirrors library is not supported when using the new emitter " 2405 "dart:mirrors library is not supported when using the new emitter "
2406 "(DART_VM_OPTIONS='-Ddart2js.use.new.emitter=true')"); 2406 "(DART_VM_OPTIONS='-Ddart2js.use.new.emitter=true')");
2407 2407
2408 static const MessageKind CALL_NOT_SUPPORTED_ON_NATIVE_CLASS = 2408 static const MessageKind CALL_NOT_SUPPORTED_ON_NATIVE_CLASS =
2409 const MessageKind( 2409 const MessageKind(
2410 "Non-supported 'call' member on a native class, or a " 2410 "Non-supported 'call' member on a native class, or a "
2411 "subclass of a native class."); 2411 "subclass of a native class.");
2412 2412
2413 static const MessageKind DIRECTLY_THROWING_NSM =
2414 const MessageKind(
2415 "This 'noSuchMethod' implementation is guaranteed to throw an "
2416 "exception. The generated code will be smaller if it is "
2417 "rewritten.",
2418 howToFix: "Rewrite to "
2419 "'noSuchMethod(Invocation i) => super.noSuchMethod(i)'.");
sra1 2015/03/31 02:19:14 Missing semicolon in rewrite text
2420
2421 static const MessageKind COMPLEX_THROWING_NSM =
2422 const MessageKind(
2423 "This 'noSuchMethod' implementation is guaranteed to throw an "
2424 "exception. The generated code will be smaller and the compiler "
2425 "will be able to perform more optimizations if it is rewritten.",
2426 howToFix: "Rewrite to "
2427 "'noSuchMethod(Invocation i) => super.noSuchMethod(i)'.");
2428
2429 static const MessageKind COMPLEX_RETURNING_NSM =
2430 const MessageKind(
2431 "Overriding 'noSuchMethod' causes the compiler to generate "
2432 "more code and prevents the compiler from doing some optimizations.",
2433 howToFix: "Consider removing this 'noSuchMethod' implementation.");
2434
2413 toString() => template; 2435 toString() => template;
2414 2436
2415 Message message([Map arguments = const {}, bool terse = false]) { 2437 Message message([Map arguments = const {}, bool terse = false]) {
2416 return new Message(this, arguments, terse); 2438 return new Message(this, arguments, terse);
2417 } 2439 }
2418 2440
2419 bool get hasHowToFix => howToFix != null && howToFix != DONT_KNOW_HOW_TO_FIX; 2441 bool get hasHowToFix => howToFix != null && howToFix != DONT_KNOW_HOW_TO_FIX;
2420 } 2442 }
2421 2443
2422 class Message { 2444 class Message {
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
2465 static String convertToString(value) { 2487 static String convertToString(value) {
2466 if (value is ErrorToken) { 2488 if (value is ErrorToken) {
2467 // Shouldn't happen. 2489 // Shouldn't happen.
2468 return value.assertionMessage; 2490 return value.assertionMessage;
2469 } else if (value is Token) { 2491 } else if (value is Token) {
2470 value = value.value; 2492 value = value.value;
2471 } 2493 }
2472 return '$value'; 2494 return '$value';
2473 } 2495 }
2474 } 2496 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698