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 checkInt, | 8 import 'dart:_js_helper' show checkInt, |
9 Closure, | 9 Closure, |
10 ConstantMap, | 10 ConstantMap, |
(...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
580 "Receiver: ${receiverText}\n" | 580 "Receiver: ${receiverText}\n" |
581 "Tried calling: $memberName($actualParameters)\n" | 581 "Tried calling: $memberName($actualParameters)\n" |
582 "Found: $memberName($formalParameters)"; | 582 "Found: $memberName($formalParameters)"; |
583 } | 583 } |
584 } | 584 } |
585 } | 585 } |
586 | 586 |
587 @patch | 587 @patch |
588 class Uri { | 588 class Uri { |
589 @patch | 589 @patch |
| 590 static bool get _isWindows => false; |
| 591 |
| 592 @patch |
590 static Uri get base { | 593 static Uri get base { |
591 String uri = Primitives.currentUri(); | 594 String uri = Primitives.currentUri(); |
592 if (uri != null) return Uri.parse(uri); | 595 if (uri != null) return Uri.parse(uri); |
593 throw new UnsupportedError("'Uri.base' is not supported"); | 596 throw new UnsupportedError("'Uri.base' is not supported"); |
594 } | 597 } |
595 } | |
596 | 598 |
597 @patch | |
598 class _Uri { | |
599 @patch | |
600 static bool get _isWindows => false; | |
601 | 599 |
602 // Matches a String that _uriEncodes to itself regardless of the kind of | 600 // Matches a String that _uriEncodes to itself regardless of the kind of |
603 // component. This corresponds to [_unreservedTable], i.e. characters that | 601 // component. This corresponds to [_unreservedTable], i.e. characters that |
604 // are not encoded by any encoding table. | 602 // are not encoded by any encoding table. |
605 static final RegExp _needsNoEncoding = new RegExp(r'^[\-\.0-9A-Z_a-z~]*$'); | 603 static final RegExp _needsNoEncoding = new RegExp(r'^[\-\.0-9A-Z_a-z~]*$'); |
606 | 604 |
607 /** | 605 /** |
608 * This is the internal implementation of JavaScript's encodeURI function. | 606 * This is the internal implementation of JavaScript's encodeURI function. |
609 * It encodes all characters in the string [text] except for those | 607 * It encodes all characters in the string [text] except for those |
610 * that appear in [canonicalTable], and returns the escaped string. | 608 * that appear in [canonicalTable], and returns the escaped string. |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
752 return getTraceFromException(error); | 750 return getTraceFromException(error); |
753 } | 751 } |
754 // Fallback if Error.captureStackTrace does not exist. | 752 // Fallback if Error.captureStackTrace does not exist. |
755 try { | 753 try { |
756 throw ''; | 754 throw ''; |
757 } catch (_, stackTrace) { | 755 } catch (_, stackTrace) { |
758 return stackTrace; | 756 return stackTrace; |
759 } | 757 } |
760 } | 758 } |
761 } | 759 } |
OLD | NEW |