| OLD | NEW |
| 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 class MessageKind { | 7 class MessageKind { |
| 8 final String template; | 8 final String template; |
| 9 const MessageKind(this.template); | 9 const MessageKind(this.template); |
| 10 | 10 |
| (...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 static const MISSING_FACTORY_KEYWORD = const MessageKind( | 386 static const MISSING_FACTORY_KEYWORD = const MessageKind( |
| 387 "Did you forget a factory keyword here?"); | 387 "Did you forget a factory keyword here?"); |
| 388 | 388 |
| 389 static const DEFERRED_LIBRARY_NAME_MISMATCH = const MessageKind( | 389 static const DEFERRED_LIBRARY_NAME_MISMATCH = const MessageKind( |
| 390 'Error: Library name mismatch "#{expectedName}" != "#{actualName}".'); | 390 'Error: Library name mismatch "#{expectedName}" != "#{actualName}".'); |
| 391 | 391 |
| 392 static const ILLEGAL_STATIC = const MessageKind( | 392 static const ILLEGAL_STATIC = const MessageKind( |
| 393 "Error: Modifier static is only allowed on functions declared in" | 393 "Error: Modifier static is only allowed on functions declared in" |
| 394 " a class."); | 394 " a class."); |
| 395 | 395 |
| 396 static const STATIC_FUNCTION_BLOAT = const MessageKind( |
| 397 'Warning: Using "#{class}.#{name}" may result in larger output.'); |
| 398 |
| 399 static const NON_CONST_BLOAT = const MessageKind(''' |
| 400 Warning: Using "new #{name}" may result in larger output. |
| 401 Use "const #{name}" if possible.'''); |
| 402 |
| 403 static const STRING_EXPECTED = const MessageKind( |
| 404 'Error: Expected a "String", but got an instance of "#{type}".'); |
| 405 |
| 406 static const PRIVATE_IDENTIFIER = const MessageKind( |
| 407 'Error: "#{value}" is not a valid Symbol name because it starts with ' |
| 408 '"_".'); |
| 409 |
| 410 static const INVALID_SYMBOL = const MessageKind(''' |
| 411 Error: "#{value}" is not a valid Symbol name because is not: |
| 412 * an empty String, |
| 413 * a user defined operator, |
| 414 * a qualified non-private identifier optionally followed by "=", or |
| 415 * a qualified non-private identifier followed by "." and a user-defined operato
r.'''); |
| 416 |
| 396 static const COMPILER_CRASHED = const MessageKind( | 417 static const COMPILER_CRASHED = const MessageKind( |
| 397 "Error: The compiler crashed when compiling this element."); | 418 "Error: The compiler crashed when compiling this element."); |
| 398 | 419 |
| 399 static const PLEASE_REPORT_THE_CRASH = const MessageKind(''' | 420 static const PLEASE_REPORT_THE_CRASH = const MessageKind(''' |
| 400 The compiler is broken. | 421 The compiler is broken. |
| 401 | 422 |
| 402 When compiling the above element, the compiler crashed. It is not | 423 When compiling the above element, the compiler crashed. It is not |
| 403 possible to tell if this is caused by a problem in your program or | 424 possible to tell if this is caused by a problem in your program or |
| 404 not. Regardless, the compiler should not crash. | 425 not. Regardless, the compiler should not crash. |
| 405 | 426 |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 574 | 595 |
| 575 class CompileTimeConstantError extends Diagnostic { | 596 class CompileTimeConstantError extends Diagnostic { |
| 576 CompileTimeConstantError(MessageKind kind, [Map arguments = const {}]) | 597 CompileTimeConstantError(MessageKind kind, [Map arguments = const {}]) |
| 577 : super(kind, arguments); | 598 : super(kind, arguments); |
| 578 } | 599 } |
| 579 | 600 |
| 580 class CompilationError extends Diagnostic { | 601 class CompilationError extends Diagnostic { |
| 581 CompilationError(MessageKind kind, [Map arguments = const {}]) | 602 CompilationError(MessageKind kind, [Map arguments = const {}]) |
| 582 : super(kind, arguments); | 603 : super(kind, arguments); |
| 583 } | 604 } |
| OLD | NEW |