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

Unified Diff: tool/input_sdk/private/errors.dart

Issue 1530563003: Generate all runtime files from dart. (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Reverted to new .dart files in input_sdk: please compare them against previous patchset Created 5 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 side-by-side diff with in-line comments
Download patch
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));
+})()''');

Powered by Google App Engine
This is Rietveld 408576698