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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/lib/native_helper.dart

Issue 15744017: Make int a double in argument type checks. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of _js_helper; 5 part of _js_helper;
6 6
7 String typeNameInChrome(obj) { 7 String typeNameInChrome(obj) {
8 String name = JS('String', "#.constructor.name", obj); 8 String name = JS('String', "#.constructor.name", obj);
9 return typeNameInWebKitCommon(name); 9 return typeNameInWebKitCommon(name);
10 } 10 }
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 if (name == 'Object') { 70 if (name == 'Object') {
71 if (JS('bool', 'window.DataView && (# instanceof window.DataView)', obj)) { 71 if (JS('bool', 'window.DataView && (# instanceof window.DataView)', obj)) {
72 return 'DataView'; 72 return 'DataView';
73 } 73 }
74 } 74 }
75 return name; 75 return name;
76 } 76 }
77 77
78 String constructorNameFallback(object) { 78 String constructorNameFallback(object) {
79 if (object == null) return 'Null'; 79 if (object == null) return 'Null';
80 object = getInterceptor(object);
80 var constructor = JS('var', "#.constructor", object); 81 var constructor = JS('var', "#.constructor", object);
81 if (identical(JS('String', "typeof(#)", constructor), 'function')) { 82 if (identical(JS('String', "typeof(#)", constructor), 'function')) {
82 var name = JS('var', r'#.builtin$cls', constructor); 83 var name = JS('var', r'#.builtin$cls', constructor);
83 if (name != null) return name; 84 if (name != null) return name;
84 // The constructor isn't null or undefined at this point. Try 85 // The constructor isn't null or undefined at this point. Try
85 // to grab hold of its name. 86 // to grab hold of its name.
86 name = JS('var', '#.name', constructor); 87 name = JS('var', '#.name', constructor);
87 // If the name is a non-empty string, we use that as the type 88 // If the name is a non-empty string, we use that as the type
88 // name of this object. On Firefox, we often get 'Object' as 89 // name of this object. On Firefox, we often get 'Object' as
89 // the constructor name even for more specialized objects so 90 // the constructor name even for more specialized objects so
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 } 302 }
302 var isLeaf = 303 var isLeaf =
303 (leafTags != null) && JS('bool', '(#[#]) === true', leafTags, tag); 304 (leafTags != null) && JS('bool', '(#[#]) === true', leafTags, tag);
304 if (isLeaf) { 305 if (isLeaf) {
305 return makeDispatchRecord(interceptor, false, null); 306 return makeDispatchRecord(interceptor, false, null);
306 } else { 307 } else {
307 var proto = JS('', 'Object.getPrototypeOf(#)', obj); 308 var proto = JS('', 'Object.getPrototypeOf(#)', obj);
308 return makeDispatchRecord(interceptor, proto, null); 309 return makeDispatchRecord(interceptor, proto, null);
309 } 310 }
310 } 311 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698