| Index: tool/input_sdk/private/errors.dart
|
| diff --git a/tool/input_sdk/private/errors.dart b/tool/input_sdk/private/errors.dart
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..db1798cb90591b88433a7cbee4a7bca616e5e0a5
|
| --- /dev/null
|
| +++ b/tool/input_sdk/private/errors.dart
|
| @@ -0,0 +1,30 @@
|
| +// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
|
| +// for details. All rights reserved. Use of this source code is governed by a
|
| +// BSD-style license that can be found in the LICENSE file.
|
| +
|
| +/// This library encapsulates the core sdk errors that the runtime knows about.
|
| +
|
| +library dart._errors;
|
| +import 'dart:_foreign_helper' show JS, rest;
|
| +import 'dart:_js_helper' show CastErrorImplementation;
|
| +import 'dart:_operations' show throw_;
|
| +
|
| +throwNoSuchMethod(obj, name, pArgs, nArgs, extras) => JS('', '''(() => {
|
| + $throw_(new $NoSuchMethodError($obj, $name, $pArgs, $nArgs, $extras));
|
| +})()''');
|
| +
|
| +throwCastError(actual, type) => JS('', '''(() => {
|
| + $throw_(new $CastErrorImplementation($actual, $type));
|
| +})()''');
|
| +
|
| +throwAssertionError() => JS('', '''(() => {
|
| + $throw_(new $AssertionError());
|
| +})()''');
|
| +
|
| +throwNullValueError() => JS('', '''(() => {
|
| + // TODO(vsm): Per spec, we should throw an NSM here. Technically, we ought
|
| + // to thread through method info, but that uglifies the code and can't
|
| + // actually be queried ... it only affects how the error is printed.
|
| + $throw_(new $NoSuchMethodError(null,
|
| + new $Symbol('<Unexpected Null Value>'), null, null, null));
|
| +})()''');
|
|
|