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 import 'dart:_foreign_helper' show DART_CLOSURE_TO_JS, | 8 import 'dart:_foreign_helper' show DART_CLOSURE_TO_JS, |
9 JS, | 9 JS, |
10 JS_CALL_IN_ISOLATE, | 10 JS_CALL_IN_ISOLATE, |
(...skipping 806 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
817 // the exception comes from the DOM, it is a JavaScript | 817 // the exception comes from the DOM, it is a JavaScript |
818 // object backed by a native Dart class. | 818 // object backed by a native Dart class. |
819 return ex; | 819 return ex; |
820 } | 820 } |
821 | 821 |
822 /** | 822 /** |
823 * Called by generated code to fetch the stack trace from an | 823 * Called by generated code to fetch the stack trace from an |
824 * exception. | 824 * exception. |
825 */ | 825 */ |
826 StackTrace getTraceFromException(exception) { | 826 StackTrace getTraceFromException(exception) { |
827 return new StackTrace(JS("var", r"#.stack", exception)); | 827 return new _StackTrace(JS("var", r"#.stack", exception)); |
828 } | 828 } |
829 | 829 |
830 class StackTrace { | 830 class _StackTrace implements StackTrace { |
831 var stack; | 831 var _stack; |
832 StackTrace(this.stack); | 832 _StackTrace(this._stack); |
833 String toString() => stack != null ? stack : ''; | 833 String toString() => _stack != null ? _stack : ''; |
834 } | 834 } |
835 | 835 |
836 | 836 |
837 /** | 837 /** |
838 * Called by generated code to build a map literal. [keyValuePairs] is | 838 * Called by generated code to build a map literal. [keyValuePairs] is |
839 * a list of key, value, key, value, ..., etc. | 839 * a list of key, value, key, value, ..., etc. |
840 */ | 840 */ |
841 makeLiteralMap(List keyValuePairs) { | 841 makeLiteralMap(List keyValuePairs) { |
842 Iterator iterator = keyValuePairs.iterator; | 842 Iterator iterator = keyValuePairs.iterator; |
843 Map result = new LinkedHashMap(); | 843 Map result = new LinkedHashMap(); |
(...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1371 expectedArgumentNames); | 1371 expectedArgumentNames); |
1372 } | 1372 } |
1373 | 1373 |
1374 /** | 1374 /** |
1375 * Called by generated code when a static field's initializer references the | 1375 * Called by generated code when a static field's initializer references the |
1376 * field that is currently being initialized. | 1376 * field that is currently being initialized. |
1377 */ | 1377 */ |
1378 void throwCyclicInit(String staticName) { | 1378 void throwCyclicInit(String staticName) { |
1379 throw new RuntimeError("Cyclic initialization for static $staticName"); | 1379 throw new RuntimeError("Cyclic initialization for static $staticName"); |
1380 } | 1380 } |
OLD | NEW |