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

Side by Side Diff: pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/errors.dart

Issue 2985333002: fix #30290, assertion messages that contain `yield` (Closed)
Patch Set: merge and update status Created 3 years, 4 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
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 part of dart._runtime; 4 part of dart._runtime;
5 5
6 // We need to set these properties while the sdk is only partially initialized 6 // We need to set these properties while the sdk is only partially initialized
7 // so we cannot use regular Dart fields. 7 // so we cannot use regular Dart fields.
8 // The default values for these properties are set when the global_ final field 8 // The default values for these properties are set when the global_ final field
9 // in runtime.dart is initialized. 9 // in runtime.dart is initialized.
10 10
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 var expected = typeName(type); 66 var expected = typeName(type);
67 if (JS('bool', 'dart.__trapRuntimeErrors')) JS('', 'debugger'); 67 if (JS('bool', 'dart.__trapRuntimeErrors')) JS('', 'debugger');
68 throw new StrongModeTypeError(object, found, expected); 68 throw new StrongModeTypeError(object, found, expected);
69 } 69 }
70 70
71 throwUnimplementedError(String message) { 71 throwUnimplementedError(String message) {
72 if (JS('bool', 'dart.__trapRuntimeErrors')) JS('', 'debugger'); 72 if (JS('bool', 'dart.__trapRuntimeErrors')) JS('', 'debugger');
73 throw new UnimplementedError(message); 73 throw new UnimplementedError(message);
74 } 74 }
75 75
76 throwAssertionError(messageFn()) { 76 assertFailed(message) {
77 if (JS('bool', 'dart.__trapRuntimeErrors')) JS('', 'debugger'); 77 if (JS('bool', 'dart.__trapRuntimeErrors')) JS('', 'debugger');
78 var message = messageFn != null ? messageFn() : null;
79 throw new AssertionErrorImpl(message); 78 throw new AssertionErrorImpl(message);
80 } 79 }
81 80
82 throwCyclicInitializationError([String message]) { 81 throwCyclicInitializationError([String message]) {
83 if (JS('bool', 'dart.__trapRuntimeErrors')) JS('', 'debugger'); 82 if (JS('bool', 'dart.__trapRuntimeErrors')) JS('', 'debugger');
84 throw new CyclicInitializationError(message); 83 throw new CyclicInitializationError(message);
85 } 84 }
86 85
87 throwNullValueError() { 86 throwNullValueError() {
88 // TODO(vsm): Per spec, we should throw an NSM here. Technically, we ought 87 // TODO(vsm): Per spec, we should throw an NSM here. Technically, we ought
89 // to thread through method info, but that uglifies the code and can't 88 // to thread through method info, but that uglifies the code and can't
90 // actually be queried ... it only affects how the error is printed. 89 // actually be queried ... it only affects how the error is printed.
91 if (JS('bool', 'dart.__trapRuntimeErrors')) JS('', 'debugger'); 90 if (JS('bool', 'dart.__trapRuntimeErrors')) JS('', 'debugger');
92 throw new NoSuchMethodError( 91 throw new NoSuchMethodError(
93 null, new Symbol('<Unexpected Null Value>'), null, null, null); 92 null, new Symbol('<Unexpected Null Value>'), null, null, null);
94 } 93 }
95 94
96 throwNoSuchMethodError(Object receiver, Symbol memberName, 95 throwNoSuchMethodError(Object receiver, Symbol memberName,
97 List positionalArguments, Map<Symbol, dynamic> namedArguments) { 96 List positionalArguments, Map<Symbol, dynamic> namedArguments) {
98 if (JS('bool', 'dart.__trapRuntimeErrors')) JS('', 'debugger'); 97 if (JS('bool', 'dart.__trapRuntimeErrors')) JS('', 'debugger');
99 throw new NoSuchMethodError( 98 throw new NoSuchMethodError(
100 receiver, memberName, positionalArguments, namedArguments); 99 receiver, memberName, positionalArguments, namedArguments);
101 } 100 }
OLDNEW
« no previous file with comments | « pkg/dev_compiler/test/browser/language_tests.js ('k') | pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/operations.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698