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

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

Issue 1944483002: Redo how Type objects are exposed from DDC. (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: More tweaks. Created 4 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
« no previous file with comments | « tool/input_sdk/private/debugger.dart ('k') | tool/input_sdk/private/js_rti.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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 library dart._js_helper; 5 library dart._js_helper;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 8
9 import 'dart:_foreign_helper' show 9 import 'dart:_foreign_helper' show
10 JS, 10 JS,
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 /// Returns the type of [object] as a string (including type arguments). 169 /// Returns the type of [object] as a string (including type arguments).
170 /// 170 ///
171 /// In minified mode, uses the unminified names if available. 171 /// In minified mode, uses the unminified names if available.
172 static String objectTypeName(Object object) { 172 static String objectTypeName(Object object) {
173 return getRuntimeType(object).toString(); 173 return getRuntimeType(object).toString();
174 } 174 }
175 175
176 /// In minified mode, uses the unminified names if available. 176 /// In minified mode, uses the unminified names if available.
177 static String objectToString(Object object) { 177 static String objectToString(Object object) {
178 // String name = objectTypeName(object); 178 // String name = objectTypeName(object);
179 String name = JS('String', 'dart.typeName(dart.realRuntimeType(#))', object) ; 179 String name = JS('String', 'dart.typeName(dart.getReifiedType(#))', object);
180 return "Instance of '$name'"; 180 return "Instance of '$name'";
181 } 181 }
182 182
183 static int dateNow() => JS('int', r'Date.now()'); 183 static int dateNow() => JS('int', r'Date.now()');
184 184
185 static void initTicker() { 185 static void initTicker() {
186 if (timerFrequency != null) return; 186 if (timerFrequency != null) return;
187 // Start with low-resolution. We overwrite the fields if we find better. 187 // Start with low-resolution. We overwrite the fields if we find better.
188 timerFrequency = 1000; 188 timerFrequency = 1000;
189 timerTicks = dateNow; 189 timerTicks = dateNow;
(...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after
788 788
789 SyncIterable(this._generator, this._args); 789 SyncIterable(this._generator, this._args);
790 790
791 // TODO(jmesserly): this should be [Symbol.iterator]() method. Unfortunately 791 // TODO(jmesserly): this should be [Symbol.iterator]() method. Unfortunately
792 // we have no way of telling the compiler yet, so it will generate an extra 792 // we have no way of telling the compiler yet, so it will generate an extra
793 // layer of indirection that wraps the SyncIterator. 793 // layer of indirection that wraps the SyncIterator.
794 _jsIterator() => JS('', '#(...#)', _generator, _args); 794 _jsIterator() => JS('', '#(...#)', _generator, _args);
795 795
796 Iterator<E> get iterator => new SyncIterator<E>(_jsIterator()); 796 Iterator<E> get iterator => new SyncIterator<E>(_jsIterator());
797 } 797 }
OLDNEW
« no previous file with comments | « tool/input_sdk/private/debugger.dart ('k') | tool/input_sdk/private/js_rti.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698