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

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

Issue 125033003: Version 1.1.0-dev.5.1 (Closed) Base URL: http://dart.googlecode.com/svn/trunk/
Patch Set: Created 6 years, 11 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 | « dart/sdk/lib/_internal/lib/js_helper.dart ('k') | dart/sdk/lib/js/dart2js/js_dart2js.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/sdk/lib/_internal/lib/js_rti.dart
===================================================================
--- dart/sdk/lib/_internal/lib/js_rti.dart (revision 31466)
+++ dart/sdk/lib/_internal/lib/js_rti.dart (working copy)
@@ -523,21 +523,18 @@
assert(isJsObject(s));
assert(isJsObject(t));
- return JS('bool', r'''
- function (t, s, isAssignable) {
- for (var $name in t) {
- if (!s.hasOwnProperty($name)) {
- return false;
- }
- var tType = t[$name];
- var sType = s[$name];
- if (!isAssignable.call$2(sType, tType)) {
- return false;
- }
- }
- return true;
- }(#, #, #)
- ''', t, s, RAW_DART_FUNCTION_REF(isAssignable));
+ List names =
+ JSArray.markFixedList(JS('', 'Object.getOwnPropertyNames(#)', t));
+ for (int i = 0; i < names.length; i++) {
+ var name = names[i];
+ if (JS('bool', '!Object.hasOwnProperty.call(#, #)', s, name)) {
+ return false;
+ }
+ var tType = JS('', '#[#]', t, name);
+ var sType = JS('', '#[#]', s, name);
+ if (!isAssignable(tType, sType)) return false;
+ }
+ return true;
}
bool isFunctionSubtype(var s, var t) {
« no previous file with comments | « dart/sdk/lib/_internal/lib/js_helper.dart ('k') | dart/sdk/lib/js/dart2js/js_dart2js.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698