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

Unified Diff: lib/compiler/implementation/lib/js_helper.dart

Issue 10232011: Implement simple dynamic type check. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Minor edits. Created 8 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: lib/compiler/implementation/lib/js_helper.dart
diff --git a/lib/compiler/implementation/lib/js_helper.dart b/lib/compiler/implementation/lib/js_helper.dart
index 9f5bd4cbd54454bd4870bf8d37b0c16691e70600..9d1adbaf8a9849ba0d3a93775d7482f592e6d6a7 100644
--- a/lib/compiler/implementation/lib/js_helper.dart
+++ b/lib/compiler/implementation/lib/js_helper.dart
@@ -1397,3 +1397,13 @@ class Null {
}
builtin$get$toString(receiver) => () => builtin$toString$0(receiver);
+
+setRuntimeTypeInfo(target, typeInfo) {
+ // We have to check for null because factories may return null.
+ if (target !== null) JS('var', @'#.builtin$typeInfo = #', target, typeInfo);
+}
+
+getRuntimeTypeInfo(target) {
+ if (target === null) return null;
+ return JS('var', @'#.builtin$typeInfo', target);
+}

Powered by Google App Engine
This is Rietveld 408576698