mirror of
https://github.com/dart-lang/sdk
synced 2024-11-05 18:22:09 +00:00
Add fast-mode Uri class.
Optimize parser and make it recognize a class of URIs that don't need extra
handling: no escapes, no funny characters, already (nearly or completely)
normalized.
Have a class specifically for those URIs which retains the original
input string without having allocate any further strings.
R=floitsch@google.com
Committed: 00090a0c72
Review URL: https://codereview.chromium.org/2086613003 .
This commit is contained in:
parent
00090a0c72
commit
323ca7e410
3 changed files with 5 additions and 2 deletions
|
@ -2,6 +2,9 @@
|
|||
|
||||
### Core library changes
|
||||
|
||||
* `dart:core`
|
||||
* Improved performance when parsing some common URIs.
|
||||
* Fixed bug in `Uri.resolve` (SDK issue [26804](https://github.com/dart-lang/sdk/issues/26804)).
|
||||
* `dart:io`
|
||||
* Adds file locking modes `FileLock.BLOCKING_SHARED` and
|
||||
`FileLock.BLOCKING_EXCLUSIVE`.
|
||||
|
|
|
@ -179,7 +179,7 @@ Future compileAndCheck(String code,
|
|||
|
||||
Future compileSources(Map<String, String> sources,
|
||||
check(MockCompiler compiler)) {
|
||||
Uri base = new Uri(scheme: 'source');
|
||||
Uri base = new Uri(scheme: 'source', path: '/');
|
||||
Uri mainUri = base.resolve('main.dart');
|
||||
String mainCode = sources['main.dart'];
|
||||
Expect.isNotNull(mainCode, 'No source code found for "main.dart"');
|
||||
|
|
|
@ -196,7 +196,7 @@ testUriPerRFCs() {
|
|||
testResolve("s://h/", "../../../..");
|
||||
testResolve("s://h/", "../../../../");
|
||||
|
||||
base = Uri.parse("s://h/p?q#f%20"); // A non-simpe base
|
||||
base = Uri.parse("s://h/p?q#f%20"); // A non-simpe base.
|
||||
// Simple references:
|
||||
testResolve("s2://h2/P?Q#F", "s2://h2/P?Q#F");
|
||||
testResolve("s://h2/P?Q#F", "//h2/P?Q#F");
|
||||
|
|
Loading…
Reference in a new issue