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

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

Issue 12211013: Allow intercepted calls to have typed selectors. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 10 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: sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/js_backend/backend.dart (revision 18164)
+++ sdk/lib/_internal/compiler/implementation/js_backend/backend.dart (working copy)
@@ -1111,6 +1111,13 @@
return fieldTypes.optimisticFieldType(element);
}
+ /**
+ * Return the checked mode helper name that will be needed to do a
+ * type check on [type] at runtime. Note that this method is being
+ * called both by the resolver with interface types (int, String,
+ * ...), and by the SSA backend with implementation types (JSInt,
+ * JSString, ...).
+ */
SourceString getCheckedModeHelper(DartType type) {
Element element = type.element;
bool nativeCheck =
@@ -1121,17 +1128,18 @@
return const SourceString('malformedTypeCheck');
} else if (type == compiler.types.voidType) {
return const SourceString('voidTypeCheck');
- } else if (element == compiler.stringClass) {
+ } else if (element == jsStringClass || element == compiler.stringClass) {
return const SourceString('stringTypeCheck');
- } else if (element == compiler.doubleClass) {
+ } else if (element == jsDoubleClass || element == compiler.doubleClass) {
return const SourceString('doubleTypeCheck');
- } else if (element == compiler.numClass) {
+ } else if (element == jsNumberClass || element == compiler.numClass) {
return const SourceString('numTypeCheck');
- } else if (element == compiler.boolClass) {
+ } else if (element == jsBoolClass || element == compiler.boolClass) {
return const SourceString('boolTypeCheck');
- } else if (element == compiler.functionClass) {
+ } else if (element == jsFunctionClass
+ || element == compiler.functionClass) {
return const SourceString('functionTypeCheck');
- } else if (element == compiler.intClass) {
+ } else if (element == jsIntClass || element == compiler.intClass) {
return const SourceString('intTypeCheck');
} else if (Elements.isNumberOrStringSupertype(element, compiler)) {
return nativeCheck
@@ -1141,7 +1149,7 @@
return nativeCheck
? const SourceString('stringSuperNativeTypeCheck')
: const SourceString('stringSuperTypeCheck');
- } else if (identical(element, compiler.listClass)) {
+ } else if (element == compiler.listClass || element == jsArrayClass) {
return const SourceString('listTypeCheck');
} else {
if (Elements.isListSupertype(element, compiler)) {
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/enqueue.dart ('k') | sdk/lib/_internal/compiler/implementation/lib/js_number.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698