Files
sdk/pkg/dev_compiler/test/testing.dart
T
Jenny Messerly dab7da78cd fix implicit casts in DDC
There are a few bug fixes here as well. Most notably, `.name.name`
instead of `.name` in DDK's analysis of virtual accessors. DDC/K's
handling of spread arguments in JS interop was also fairly broken
(it was generating a RestParameter instead of Spread). There's
also a lot of cleanup in js_ast as well, to make it a bit more
type safe.

Change-Id: Ia5333179e6dd0a62f20ce64a2b2b8bedf2ed7c49
Reviewed-on: https://dart-review.googlesource.com/44700
Commit-Queue: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2018-03-07 01:26:21 +00:00

35 lines
1.2 KiB
Dart

// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
library dev_compiler.src.testing;
import 'dart:mirrors';
import 'package:analyzer/file_system/file_system.dart';
import 'package:analyzer/file_system/memory_file_system.dart';
import 'package:analyzer/src/generated/source.dart';
import 'package:path/path.dart' as path;
final String testingPath =
path.fromUri((reflectClass(_TestUtils).owner as LibraryMirror).uri);
final String testDirectory = path.dirname(testingPath);
/// The local path to the root directory of the dev_compiler repo.
final String repoDirectory = path.dirname(testDirectory);
class _TestUtils {}
class TestUriResolver extends ResourceUriResolver {
final MemoryResourceProvider provider;
TestUriResolver(this.provider) : super(provider);
@override
Source resolveAbsolute(Uri uri, [Uri actualUri]) {
if (uri.scheme == 'package') {
return (provider.getResource('/packages/' + uri.path) as File)
.createSource(uri);
}
return super.resolveAbsolute(uri, actualUri);
}
}