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

Side by Side Diff: tool/input_sdk/private/operations.dart

Issue 1680263002: Support for dart:typed_data (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Address comments, rebase Created 4 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 unified diff | Download patch
« no previous file with comments | « tool/input_sdk/private/native_typed_data.dart ('k') | tool/input_sdk/private/rtti.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 /// This library defines runtime operations on objects used by the code 5 /// This library defines runtime operations on objects used by the code
6 /// generator. 6 /// generator.
7 part of dart._runtime; 7 part of dart._runtime;
8 8
9 _canonicalFieldName(obj, name, args, displayName) => JS('', '''(() => { 9 _canonicalFieldName(obj, name, args, displayName) => JS('', '''(() => {
10 $name = $canonicalMember($obj, $name); 10 $name = $canonicalMember($obj, $name);
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 isSubtype($actual, $StreamSubscription)) { 158 isSubtype($actual, $StreamSubscription)) {
159 console.warn('Ignoring cast fail from ' + $typeName($actual) + 159 console.warn('Ignoring cast fail from ' + $typeName($actual) +
160 ' to ' + $typeName($type)); 160 ' to ' + $typeName($type));
161 return true; 161 return true;
162 } 162 }
163 return false; 163 return false;
164 })()'''); 164 })()''');
165 165
166 strongInstanceOf(obj, type, ignoreFromWhiteList) => JS('', '''(() => { 166 strongInstanceOf(obj, type, ignoreFromWhiteList) => JS('', '''(() => {
167 let actual = $realRuntimeType($obj); 167 let actual = $realRuntimeType($obj);
168 if ($isSubtype(actual, $type) || actual == $jsobject) return true; 168 if ($isSubtype(actual, $type) || actual == $jsobject ||
169 actual == $int && type == $double) return true;
169 if ($ignoreFromWhiteList == void 0) return false; 170 if ($ignoreFromWhiteList == void 0) return false;
170 if ($isGroundType($type)) return false; 171 if ($isGroundType($type)) return false;
171 if ($_ignoreTypeFailure(actual, $type)) return true; 172 if ($_ignoreTypeFailure(actual, $type)) return true;
172 return false; 173 return false;
173 })()'''); 174 })()''');
174 175
175 instanceOfOrNull(obj, type) => JS('', '''(() => { 176 instanceOfOrNull(obj, type) => JS('', '''(() => {
176 if (($obj == null) || $strongInstanceOf($obj, $type, true)) return true; 177 if (($obj == null) || $strongInstanceOf($obj, $type, true)) return true;
177 return false; 178 return false;
178 })()'''); 179 })()''');
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 constructor(dartIterator) { 422 constructor(dartIterator) {
422 this.dartIterator = dartIterator; 423 this.dartIterator = dartIterator;
423 } 424 }
424 next() { 425 next() {
425 let i = this.dartIterator; 426 let i = this.dartIterator;
426 let done = !i.moveNext(); 427 let done = !i.moveNext();
427 return { done: done, value: done ? void 0 : i.current }; 428 return { done: done, value: done ? void 0 : i.current };
428 } 429 }
429 } 430 }
430 '''); 431 ''');
OLDNEW
« no previous file with comments | « tool/input_sdk/private/native_typed_data.dart ('k') | tool/input_sdk/private/rtti.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698