| OLD | NEW |
| 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 dart.core; | 5 part of dart.core; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * Error objects thrown in the case of a program failure. | 8 * Error objects thrown in the case of a program failure. |
| 9 * | 9 * |
| 10 * An `Error` object represents a program failure that the programmer | 10 * An `Error` object represents a program failure that the programmer |
| (...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 407 /** | 407 /** |
| 408 * Error thrown when control reaches the end of a switch case. | 408 * Error thrown when control reaches the end of a switch case. |
| 409 * | 409 * |
| 410 * The Dart specification requires this error to be thrown when | 410 * The Dart specification requires this error to be thrown when |
| 411 * control reaches the end of a switch case (except the last case | 411 * control reaches the end of a switch case (except the last case |
| 412 * of a switch) without meeting a break or similar end of the control | 412 * of a switch) without meeting a break or similar end of the control |
| 413 * flow. | 413 * flow. |
| 414 */ | 414 */ |
| 415 class FallThroughError extends Error { | 415 class FallThroughError extends Error { |
| 416 FallThroughError(); | 416 FallThroughError(); |
| 417 |
| 418 external String toString(); |
| 417 } | 419 } |
| 418 | 420 |
| 419 /** | 421 /** |
| 420 * Error thrown when trying to instantiate an abstract class. | 422 * Error thrown when trying to instantiate an abstract class. |
| 421 */ | 423 */ |
| 422 class AbstractClassInstantiationError extends Error { | 424 class AbstractClassInstantiationError extends Error { |
| 423 final String _className; | 425 final String _className; |
| 424 AbstractClassInstantiationError(String this._className); | 426 AbstractClassInstantiationError(String this._className); |
| 425 String toString() => "Cannot instantiate abstract class: '$_className'"; | 427 external String toString(); |
| 426 } | 428 } |
| 427 | 429 |
| 428 | 430 |
| 429 /** | 431 /** |
| 430 * Error thrown by the default implementation of [:noSuchMethod:] on [Object]. | 432 * Error thrown by the default implementation of [:noSuchMethod:] on [Object]. |
| 431 */ | 433 */ |
| 432 class NoSuchMethodError extends Error { | 434 class NoSuchMethodError extends Error { |
| 433 final Object _receiver; | 435 final Object _receiver; |
| 434 final Symbol _memberName; | 436 final Symbol _memberName; |
| 435 final List _arguments; | 437 final List _arguments; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 452 * empty list. | 454 * empty list. |
| 453 * | 455 * |
| 454 * The [namedArguments] is a map from [Symbol]s to the values of named | 456 * The [namedArguments] is a map from [Symbol]s to the values of named |
| 455 * arguments that the method was called with. | 457 * arguments that the method was called with. |
| 456 * | 458 * |
| 457 * The optional [exisitingArgumentNames] is the expected parameters of a | 459 * The optional [exisitingArgumentNames] is the expected parameters of a |
| 458 * method with the same name on the receiver, if available. This is | 460 * method with the same name on the receiver, if available. This is |
| 459 * the signature of the method that would have been called if the parameters | 461 * the signature of the method that would have been called if the parameters |
| 460 * had matched. | 462 * had matched. |
| 461 */ | 463 */ |
| 462 NoSuchMethodError(Object receiver, | 464 external NoSuchMethodError( |
| 463 Symbol memberName, | 465 this._receiver, |
| 464 List positionalArguments, | 466 this._memberName, |
| 465 Map<Symbol ,dynamic> namedArguments, | 467 this._arguments, |
| 466 [List existingArgumentNames = null]) | 468 this._namedArguments, |
| 467 : _receiver = receiver, | 469 [List existingArgumentNames = null]); |
| 468 _memberName = memberName, | 470 |
| 469 _arguments = positionalArguments, | 471 external NoSuchMethodError._withType( |
| 470 _namedArguments = namedArguments, | 472 Object this._receiver, |
| 471 _existingArgumentNames = existingArgumentNames; | 473 /*String|Symbol*/ memberName, |
| 474 int invocation_type, |
| 475 List this._arguments, |
| 476 Map<dynamic, dynamic> namedArguments, |
| 477 [List existingArgumentNames = null]); |
| 472 | 478 |
| 473 external String toString(); | 479 external String toString(); |
| 474 } | 480 } |
| 475 | 481 |
| 476 | 482 |
| 477 /** | 483 /** |
| 478 * The operation was not allowed by the object. | 484 * The operation was not allowed by the object. |
| 479 * | 485 * |
| 480 * This [Error] is thrown when an instance cannot implement one of the methods | 486 * This [Error] is thrown when an instance cannot implement one of the methods |
| 481 * in its signature. | 487 * in its signature. |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 564 * the first time it is read. If evaluating the initializer expression causes | 570 * the first time it is read. If evaluating the initializer expression causes |
| 565 * another read of the variable, this error is thrown. | 571 * another read of the variable, this error is thrown. |
| 566 */ | 572 */ |
| 567 class CyclicInitializationError extends Error { | 573 class CyclicInitializationError extends Error { |
| 568 final String variableName; | 574 final String variableName; |
| 569 CyclicInitializationError([this.variableName]); | 575 CyclicInitializationError([this.variableName]); |
| 570 String toString() => variableName == null | 576 String toString() => variableName == null |
| 571 ? "Reading static variable during its initialization" | 577 ? "Reading static variable during its initialization" |
| 572 : "Reading static variable '$variableName' during its initialization"; | 578 : "Reading static variable '$variableName' during its initialization"; |
| 573 } | 579 } |
| OLD | NEW |