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

Unified Diff: sdk/lib/_internal/compiler/js_lib/js_helper.dart

Issue 1106613006: dart2js: add classNameFromIsCheckProperty to compiler builtins. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Reformat. Created 5 years, 8 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/js_lib/js_helper.dart
diff --git a/sdk/lib/_internal/compiler/js_lib/js_helper.dart b/sdk/lib/_internal/compiler/js_lib/js_helper.dart
index 58ead91eccca459b81a8b306ed7d8bb499710967..0421f365610b92aea8b99935f2183ec95cbb9855 100644
--- a/sdk/lib/_internal/compiler/js_lib/js_helper.dart
+++ b/sdk/lib/_internal/compiler/js_lib/js_helper.dart
@@ -92,6 +92,15 @@ part 'linked_hash_map.dart';
abstract class InternalMap {
}
+/// Extracts the classname from the isCheckProperty.
+// TODO(floitsch): move this to foreign_helper.dart or similar.
+@ForceInline()
+String classNameFromIsCheckProperty(String isCheckProperty) {
+ return JS_BUILTIN('returns:String;depends:none;effects:none',
+ JsBuiltin.classNameFromIsCheckProperty,
+ isCheckProperty);
+}
+
/// Returns true if the given [type] is a function type object.
// TODO(floitsch): move this to foreign_helper.dart or similar.
@ForceInline()
@@ -2823,8 +2832,7 @@ intTypeCast(value) {
}
void propertyTypeError(value, property) {
- // Cuts the property name to the class name.
- String name = property.substring(3, property.length);
+ String name = classNameFromIsCheckProperty(property);
throw new TypeErrorImplementation(value, name);
}
« no previous file with comments | « pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart ('k') | sdk/lib/_internal/compiler/js_lib/js_rti.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698