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

Unified Diff: lib/compiler/implementation/js_backend/backend.dart

Issue 10908012: Support checked mode for field setters. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
Index: lib/compiler/implementation/js_backend/backend.dart
===================================================================
--- lib/compiler/implementation/js_backend/backend.dart (revision 11628)
+++ lib/compiler/implementation/js_backend/backend.dart (working copy)
@@ -544,4 +544,43 @@
}
return info.returnType;
}
+
+ SourceString getCheckedModeHelper(Type type) {
+ Element element = type.element;
+ bool nativeCheck =
+ emitter.nativeEmitter.requiresNativeIsCheck(element);
+ if (element == compiler.stringClass) {
+ return const SourceString('stringTypeCheck');
+ } else if (element == compiler.doubleClass) {
+ return const SourceString('doubleTypeCheck');
+ } else if (element == compiler.numClass) {
+ return const SourceString('numTypeCheck');
+ } else if (element == compiler.boolClass) {
+ return const SourceString('boolTypeCheck');
+ } else if (element == compiler.functionClass || element.isTypedef()) {
+ return const SourceString('functionTypeCheck');
+ } else if (element == compiler.intClass) {
+ return const SourceString('intTypeCheck');
+ } else if (Elements.isStringSupertype(element, compiler)) {
+ if (nativeCheck) {
+ return const SourceString('stringSuperNativeTypeCheck');
+ } else {
+ return const SourceString('stringSuperTypeCheck');
+ }
+ } else if (element === compiler.listClass) {
+ return const SourceString('listTypeCheck');
+ } else {
+ if (Elements.isListSupertype(element, compiler)) {
+ if (nativeCheck) {
+ return const SourceString('listSuperNativeTypeCheck');
+ } else {
+ return const SourceString('listSuperTypeCheck');
+ }
+ } else if (nativeCheck) {
+ return const SourceString('callTypeCheck');
+ } else {
+ return const SourceString('propertyTypeCheck');
+ }
+ }
+ }
}

Powered by Google App Engine
This is Rietveld 408576698