| 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 // Patch file for dart:core classes. | 5 // Patch file for dart:core classes. |
| 6 import "dart:_internal" as _symbol_dev; | 6 import "dart:_internal" as _symbol_dev; |
| 7 import 'dart:_interceptors'; | 7 import 'dart:_interceptors'; |
| 8 import 'dart:_js_helper' show patch, | 8 import 'dart:_js_helper' show patch, |
| 9 checkInt, | 9 checkInt, |
| 10 getRuntimeType, | 10 getRuntimeType, |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 @patch | 35 @patch |
| 36 dynamic noSuchMethod(Invocation invocation) { | 36 dynamic noSuchMethod(Invocation invocation) { |
| 37 throw new NoSuchMethodError( | 37 throw new NoSuchMethodError( |
| 38 this, | 38 this, |
| 39 invocation.memberName, | 39 invocation.memberName, |
| 40 invocation.positionalArguments, | 40 invocation.positionalArguments, |
| 41 invocation.namedArguments); | 41 invocation.namedArguments); |
| 42 } | 42 } |
| 43 | 43 |
| 44 @patch | 44 @patch |
| 45 Type get runtimeType => JS('Type', 'dart.realRuntimeType(#)', this); | 45 Type get runtimeType => JS('Type', 'dart.objectRuntimeType(#)', this); |
| 46 } | 46 } |
| 47 | 47 |
| 48 // Patch for Function implementation. | 48 // Patch for Function implementation. |
| 49 @patch | 49 @patch |
| 50 class Function { | 50 class Function { |
| 51 @patch | 51 @patch |
| 52 static apply(Function f, | 52 static apply(Function f, |
| 53 List positionalArguments, | 53 List positionalArguments, |
| 54 [Map<Symbol, dynamic> namedArguments]) { | 54 [Map<Symbol, dynamic> namedArguments]) { |
| 55 // TODO(vsm): Handle named args. | 55 // TODO(vsm): Handle named args. |
| (...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 465 return getTraceFromException(error); | 465 return getTraceFromException(error); |
| 466 } | 466 } |
| 467 // Fallback if Error.captureStackTrace does not exist. | 467 // Fallback if Error.captureStackTrace does not exist. |
| 468 try { | 468 try { |
| 469 throw ''; | 469 throw ''; |
| 470 } catch (_, stackTrace) { | 470 } catch (_, stackTrace) { |
| 471 return stackTrace; | 471 return stackTrace; |
| 472 } | 472 } |
| 473 } | 473 } |
| 474 } | 474 } |
| OLD | NEW |