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 _js_helper; |
6 | 6 |
7 #import('dart:collection'); | 7 import 'dart:collection'; |
8 | 8 |
9 #source('constant_map.dart'); | 9 part 'constant_map.dart'; |
10 #source('native_helper.dart'); | 10 part 'native_helper.dart'; |
11 #source('regexp_helper.dart'); | 11 part 'regexp_helper.dart'; |
12 #source('string_helper.dart'); | 12 part 'string_helper.dart'; |
13 #source('mirror_opt_in_message.dart'); | 13 part 'mirror_opt_in_message.dart'; |
14 | 14 |
15 // Performance critical helper methods. | 15 // Performance critical helper methods. |
16 add(var a, var b) => (a is num && b is num) | 16 add(var a, var b) => (a is num && b is num) |
17 ? JS('num', r'# + #', a, b) | 17 ? JS('num', r'# + #', a, b) |
18 : add$slow(a, b); | 18 : add$slow(a, b); |
19 | 19 |
20 sub(var a, var b) => (a is num && b is num) | 20 sub(var a, var b) => (a is num && b is num) |
21 ? JS('num', r'# - #', a, b) | 21 ? JS('num', r'# - #', a, b) |
22 : sub$slow(a, b); | 22 : sub$slow(a, b); |
23 | 23 |
(...skipping 1469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1493 result = new TypeImpl(key); | 1493 result = new TypeImpl(key); |
1494 JS('var', r'#[#] = #', runtimeTypeCache, key, result); | 1494 JS('var', r'#[#] = #', runtimeTypeCache, key, result); |
1495 } | 1495 } |
1496 return result; | 1496 return result; |
1497 } | 1497 } |
1498 | 1498 |
1499 String getRuntimeTypeString(var object) { | 1499 String getRuntimeTypeString(var object) { |
1500 var typeInfo = JS('var', r'#.builtin$typeInfo', object); | 1500 var typeInfo = JS('var', r'#.builtin$typeInfo', object); |
1501 return JS('String', r'#.runtimeType', typeInfo); | 1501 return JS('String', r'#.runtimeType', typeInfo); |
1502 } | 1502 } |
OLD | NEW |