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 26 matching lines...) Expand all Loading... |
37 @patch | 37 @patch |
38 dynamic noSuchMethod(Invocation invocation) { | 38 dynamic noSuchMethod(Invocation invocation) { |
39 throw new NoSuchMethodError( | 39 throw new NoSuchMethodError( |
40 this, | 40 this, |
41 invocation.memberName, | 41 invocation.memberName, |
42 invocation.positionalArguments, | 42 invocation.positionalArguments, |
43 invocation.namedArguments); | 43 invocation.namedArguments); |
44 } | 44 } |
45 | 45 |
46 @patch | 46 @patch |
47 Type get runtimeType => JS('Type', 'dart.objectRuntimeType(#)', this); | 47 Type get runtimeType => |
| 48 JS('Type', 'dart.wrapType(dart.getReifiedType(#))', this); |
48 } | 49 } |
49 | 50 |
50 // Patch for Function implementation. | 51 // Patch for Function implementation. |
51 @patch | 52 @patch |
52 class Function { | 53 class Function { |
53 @patch | 54 @patch |
54 static apply(Function f, | 55 static apply(Function f, |
55 List positionalArguments, | 56 List positionalArguments, |
56 [Map<Symbol, dynamic> namedArguments]) { | 57 [Map<Symbol, dynamic> namedArguments]) { |
57 // TODO(vsm): Handle named args. | 58 // TODO(vsm): Handle named args. |
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
569 return getTraceFromException(error); | 570 return getTraceFromException(error); |
570 } | 571 } |
571 // Fallback if Error.captureStackTrace does not exist. | 572 // Fallback if Error.captureStackTrace does not exist. |
572 try { | 573 try { |
573 throw ''; | 574 throw ''; |
574 } catch (_, stackTrace) { | 575 } catch (_, stackTrace) { |
575 return stackTrace; | 576 return stackTrace; |
576 } | 577 } |
577 } | 578 } |
578 } | 579 } |
OLD | NEW |