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 'dart:collection'; | 7 import 'dart:collection'; |
| 8 | 8 |
| 9 part 'constant_map.dart'; | 9 part 'constant_map.dart'; |
| 10 part 'native_helper.dart'; | 10 part 'native_helper.dart'; |
| (...skipping 962 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 973 throw new AbstractClassInstantiationError(className); | 973 throw new AbstractClassInstantiationError(className); |
| 974 } | 974 } |
| 975 | 975 |
| 976 /** | 976 /** |
| 977 * Called from catch blocks in generated code to extract the Dart | 977 * Called from catch blocks in generated code to extract the Dart |
| 978 * exception from the thrown value. The thrown value may have been | 978 * exception from the thrown value. The thrown value may have been |
| 979 * created by [$throw] or it may be a 'native' JS exception. | 979 * created by [$throw] or it may be a 'native' JS exception. |
| 980 * | 980 * |
| 981 * Some native exceptions are mapped to new Dart instances, others are | 981 * Some native exceptions are mapped to new Dart instances, others are |
| 982 * returned unmodified. | 982 * returned unmodified. |
| 983 * | |
| 984 * TODO(erikcorry): Fix this to produce consistent result regardless of | |
|
ngeoffray
2012/12/10 08:55:42
What's 'this' here?
erikcorry
2012/12/10 12:37:40
I no longer recall, so I deleted the comment.
| |
| 985 * minification. | |
| 983 */ | 986 */ |
| 984 unwrapException(ex) { | 987 unwrapException(ex) { |
| 985 // Note that we are checking if the object has the property. If it | 988 // Note that we are checking if the object has the property. If it |
| 986 // has, it could be set to null if the thrown value is null. | 989 // has, it could be set to null if the thrown value is null. |
| 987 if (JS('bool', r'"dartException" in #', ex)) { | 990 if (JS('bool', r'"dartException" in #', ex)) { |
| 988 return JS('', r'#.dartException', ex); | 991 return JS('', r'#.dartException', ex); |
| 989 } | 992 } |
| 990 | 993 |
| 991 // Grab hold of the exception message. This field is available on | 994 // Grab hold of the exception message. This field is available on |
| 992 // all supported browsers. | 995 // all supported browsers. |
| (...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1683 int len = s.length; | 1686 int len = s.length; |
| 1684 for (int i = 1; i < len; i++) { | 1687 for (int i = 1; i < len; i++) { |
| 1685 if (!isSubtype(s[i], t[i])) { | 1688 if (!isSubtype(s[i], t[i])) { |
| 1686 return false; | 1689 return false; |
| 1687 } | 1690 } |
| 1688 } | 1691 } |
| 1689 return true; | 1692 return true; |
| 1690 } | 1693 } |
| 1691 | 1694 |
| 1692 createRuntimeType(String name) => new TypeImpl(name); | 1695 createRuntimeType(String name) => new TypeImpl(name); |
| OLD | NEW |