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

Unified Diff: sdk/lib/_internal/js_runtime/lib/js_rti.dart

Issue 1355873003: Throw Error on unreachable code rather than a String. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sdk/lib/_internal/js_runtime/lib/js_helper.dart ('k') | tests/compiler/dart2js/mock_libraries.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/js_runtime/lib/js_rti.dart
diff --git a/sdk/lib/_internal/js_runtime/lib/js_rti.dart b/sdk/lib/_internal/js_runtime/lib/js_rti.dart
index ae8fc9d72f088c26b54579842fcaf22e57995f4d..60af58d2331934fe80ff2803951787b68ab29902 100644
--- a/sdk/lib/_internal/js_runtime/lib/js_rti.dart
+++ b/sdk/lib/_internal/js_runtime/lib/js_rti.dart
@@ -41,7 +41,11 @@
part of _js_helper;
-Type createRuntimeType(String name) => new TypeImpl(name);
+Type createRuntimeType(String name) {
+ // Use a 'JS' cast to String. Since this is registered as used by the
+ // backend, type inference assumes the worst (name is dynamic).
+ return new TypeImpl(JS('String', '#', name));
+}
class TypeImpl implements Type {
final String _typeName;
« no previous file with comments | « sdk/lib/_internal/js_runtime/lib/js_helper.dart ('k') | tests/compiler/dart2js/mock_libraries.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698