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 #source('date_helper.dart'); | 9 #source('date_helper.dart'); |
| 10 #source('regexp_helper.dart'); | 10 #source('regexp_helper.dart'); |
| (...skipping 1154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1165 throw 'String.hashCode is not implemented'; | 1165 throw 'String.hashCode is not implemented'; |
| 1166 } | 1166 } |
| 1167 if (isJsArray(receiver)) { | 1167 if (isJsArray(receiver)) { |
| 1168 throw 'List.hashCode is not implemented'; | 1168 throw 'List.hashCode is not implemented'; |
| 1169 } | 1169 } |
| 1170 return UNINTERCEPTED(receiver.hashCode()); | 1170 return UNINTERCEPTED(receiver.hashCode()); |
| 1171 } | 1171 } |
| 1172 | 1172 |
| 1173 // TODO(ahe): Dynamic may be overridden. | 1173 // TODO(ahe): Dynamic may be overridden. |
| 1174 builtin$get$dynamic(receiver) => receiver; | 1174 builtin$get$dynamic(receiver) => receiver; |
| 1175 | |
| 1176 /** | |
| 1177 * Called by generated code to capture the stacktrace before throwing | |
| 1178 * an exception. | |
| 1179 */ | |
| 1180 captureStackTrace(ex) { | |
| 1181 return ex; | |
|
ngeoffray
2012/02/22 11:12:36
Remove this line.
ahe
2012/02/22 21:51:24
Done.
| |
| 1182 if (ex === null) return ex; | |
|
ngeoffray
2012/02/22 11:12:36
You could change that to:
if (JS('bool', @'typeof
ahe
2012/02/22 21:51:24
Great idea!
| |
| 1183 if (JS('bool', @'typeof $0 === "object"', ex)) { | |
| 1184 var hasCapture = JS('bool', @'!!(Error.captureStackTrace)'); | |
| 1185 if (hasCapture) { | |
| 1186 JS('Object', @'Error.captureStackTrace($0)', ex); | |
| 1187 } | |
| 1188 } | |
| 1189 return ex; | |
| 1190 } | |
| OLD | NEW |