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('dart:_js_helper'); | 5 #library('dart:_js_helper'); |
| 6 | 6 |
| 7 #import('dart:coreimpl'); | 7 #import('dart:coreimpl'); |
| 8 | 8 |
| 9 #source('constant_map.dart'); | 9 #source('constant_map.dart'); |
| 10 #source('native_helper.dart'); | 10 #source('native_helper.dart'); |
| (...skipping 1394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1405 JS('void', r'#.runtimeTypeCache[#] = #', JS_CURRENT_ISOLATE(), key, | 1405 JS('void', r'#.runtimeTypeCache[#] = #', JS_CURRENT_ISOLATE(), key, |
| 1406 runtimeType); | 1406 runtimeType); |
| 1407 } | 1407 } |
| 1408 return runtimeType; | 1408 return runtimeType; |
| 1409 } | 1409 } |
| 1410 | 1410 |
| 1411 String getRuntimeTypeString(var object) { | 1411 String getRuntimeTypeString(var object) { |
| 1412 var typeInfo = JS('Object', r'#.builtin$typeInfo', object); | 1412 var typeInfo = JS('Object', r'#.builtin$typeInfo', object); |
| 1413 return JS('String', r'#.runtimeType', typeInfo); | 1413 return JS('String', r'#.runtimeType', typeInfo); |
| 1414 } | 1414 } |
| 1415 | |
| 1416 compareHelperNull(compare, a, b) { | |
| 1417 if (const NullSentinel() == a) { | |
| 1418 a = null; | |
| 1419 } | |
| 1420 if (const NullSentinel() == b) { | |
| 1421 b = null; | |
| 1422 } | |
| 1423 compare(a, b); | |
|
Lasse Reichstein Nielsen
2012/10/18 11:54:50
return result?
(I.e., is this tested? :)
| |
| 1424 } | |
| 1425 | |
| 1426 compareHelper(compare, a, b) => compare(a, b); | |
| 1427 | |
| 1428 class NullSentinel { | |
| 1429 const NullSentinel(); | |
| 1430 } | |
| OLD | NEW |