OLD | NEW |
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 // Patch file for dart:core classes. | 5 // Patch file for dart:core classes. |
6 | 6 |
7 // Patch for 'print' function. | 7 // Patch for 'print' function. |
8 patch void print(var object) { | 8 patch void print(var object) { |
9 if (object is String) { | 9 if (object is String) { |
10 Primitives.printString(object); | 10 Primitives.printString(object); |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 patch int get second => Primitives.getSeconds(this); | 141 patch int get second => Primitives.getSeconds(this); |
142 | 142 |
143 patch int get millisecond => Primitives.getMilliseconds(this); | 143 patch int get millisecond => Primitives.getMilliseconds(this); |
144 | 144 |
145 patch int get weekday => Primitives.getWeekday(this); | 145 patch int get weekday => Primitives.getWeekday(this); |
146 } | 146 } |
147 | 147 |
148 | 148 |
149 // Patch for Stopwatch implementation. | 149 // Patch for Stopwatch implementation. |
150 patch class _StopwatchImpl { | 150 patch class _StopwatchImpl { |
151 patch static int _frequency() => 1000; | 151 patch static int _frequency() => 1000000; |
152 patch static int _now() => Primitives.dateNow(); | 152 patch static int _now() => Primitives.numMicroseconds(); |
153 } | 153 } |
154 | 154 |
155 | 155 |
156 // Patch for List implementation. | 156 // Patch for List implementation. |
157 patch class List<E> { | 157 patch class List<E> { |
158 patch factory List([int length]) => Primitives.newList(length); | 158 patch factory List([int length]) => Primitives.newList(length); |
159 } | 159 } |
160 | 160 |
161 | 161 |
162 patch class String { | 162 patch class String { |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 } | 204 } |
205 | 205 |
206 patch class RegExp { | 206 patch class RegExp { |
207 patch factory RegExp(String pattern, | 207 patch factory RegExp(String pattern, |
208 {bool multiLine: false, | 208 {bool multiLine: false, |
209 bool ignoreCase: false}) | 209 bool ignoreCase: false}) |
210 => new JSSyntaxRegExp(pattern, | 210 => new JSSyntaxRegExp(pattern, |
211 multiLine: multiLine, | 211 multiLine: multiLine, |
212 ignoreCase: ignoreCase); | 212 ignoreCase: ignoreCase); |
213 } | 213 } |
OLD | NEW |