Chromium Code Reviews| 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 #library('js_helper'); | 5 #library('js_helper'); |
| 6 | 6 |
| 7 #import('coreimpl.dart'); | 7 #import('coreimpl.dart'); |
| 8 | 8 |
| 9 /** | 9 /** |
| 10 * Returns true if both arguments are numbers. | 10 * Returns true if both arguments are numbers. |
| (...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 384 throw 'Primitives.getHours is not implemented'; | 384 throw 'Primitives.getHours is not implemented'; |
| 385 } | 385 } |
| 386 | 386 |
| 387 static int getMinutes(int secondsSinceEpoch, bool isUtc) { | 387 static int getMinutes(int secondsSinceEpoch, bool isUtc) { |
| 388 throw 'Primitives.getMinutes is not implemented'; | 388 throw 'Primitives.getMinutes is not implemented'; |
| 389 } | 389 } |
| 390 | 390 |
| 391 static int getSeconds(int secondsSinceEpoch, bool isUtc) { | 391 static int getSeconds(int secondsSinceEpoch, bool isUtc) { |
| 392 throw 'Primitives.getSeconds is not implemented'; | 392 throw 'Primitives.getSeconds is not implemented'; |
| 393 } | 393 } |
| 394 | |
| 395 static String stringFromCharCodes(charCodes) { | |
| 396 for (var i in charCodes) { | |
|
kasperl
2012/02/20 10:48:50
Would it make sense to check that charCodes is a l
ahe
2012/02/20 16:35:26
That is already done in StringBase.createFromCharC
| |
| 397 checkNum(i); | |
| 398 } | |
| 399 return JS('String', @'String.fromCharCode.apply($0, $1)', null, charCodes); | |
| 400 } | |
| 394 } | 401 } |
| 395 | 402 |
| 396 builtin$compareTo$1(a, b) { | 403 builtin$compareTo$1(a, b) { |
| 397 checkNull(a); | 404 checkNull(a); |
| 398 if (checkNumbers(a, b, 'illegal argument')) { | 405 if (checkNumbers(a, b, 'illegal argument')) { |
| 399 if (a < b) { | 406 if (a < b) { |
| 400 return -1; | 407 return -1; |
| 401 } else if (a > b) { | 408 } else if (a > b) { |
| 402 return 1; | 409 return 1; |
| 403 } else if (a == b) { | 410 } else if (a == b) { |
| (...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 964 builtin$hashCode$0(receiver) { | 971 builtin$hashCode$0(receiver) { |
| 965 if (receiver is num) return receiver & 0x1FFFFFFF; | 972 if (receiver is num) return receiver & 0x1FFFFFFF; |
| 966 if (receiver is String) { | 973 if (receiver is String) { |
| 967 throw new NotImplementedException(); | 974 throw new NotImplementedException(); |
| 968 } | 975 } |
| 969 if (isJSArray(receiver)) { | 976 if (isJSArray(receiver)) { |
| 970 throw new NotImplementedException(); | 977 throw new NotImplementedException(); |
| 971 } | 978 } |
| 972 return UNINTERCEPTED(receiver.hashCode()); | 979 return UNINTERCEPTED(receiver.hashCode()); |
| 973 } | 980 } |
| OLD | NEW |