mirror of
https://github.com/dart-lang/sdk
synced 2024-11-05 18:22:09 +00:00
Merge commit '65401da92251a7318e3264b816ce0c4e14701751' into analyzer
This commit is contained in:
commit
670f9ab49b
57 changed files with 508 additions and 1034 deletions
10
CHANGELOG.md
10
CHANGELOG.md
|
@ -25,15 +25,21 @@
|
|||
|
||||
#### Linter
|
||||
|
||||
The linter was bumped to `0.1.73` which introduces the following new lints to the SDK:
|
||||
The linter was bumped to `0.1.75` which introduces the following new lints to the SDK:
|
||||
|
||||
* `unnecessary_await_in_return`
|
||||
* `use_function_type_syntax_for_parameters`
|
||||
* `avoid_returning_null_for_future`
|
||||
* `avoid_shadowing_type_parameters`
|
||||
|
||||
and:
|
||||
|
||||
* `unnecessary_parenthesis` lint has been improved to handle function expressions.
|
||||
|
||||
In addition, `prefer_bool_in_asserts` has been deprecated as its semantics are
|
||||
redundant with Dart 2 checks.
|
||||
redundant with Dart 2 checks and experimental lints `avoid_positional_boolean_parameters`,
|
||||
`literal_only_boolean_expressions`, `prefer_foreach`, `prefer_void_to_null` have all been
|
||||
promoted to stable.
|
||||
|
||||
#### Other Tools
|
||||
|
||||
|
|
2
DEPS
2
DEPS
|
@ -97,7 +97,7 @@ vars = {
|
|||
"intl_tag": "0.15.7",
|
||||
"jinja2_rev": "2222b31554f03e62600cd7e383376a7c187967a1",
|
||||
"json_rpc_2_tag": "2.0.9",
|
||||
"linter_tag": "0.1.73",
|
||||
"linter_tag": "0.1.75",
|
||||
"logging_tag": "0.11.3+2",
|
||||
"markdown_tag": "2.0.2",
|
||||
"matcher_tag": "0.12.3",
|
||||
|
|
|
@ -413,6 +413,7 @@ const List<ErrorCode> errorCodeValues = const [
|
|||
ParserErrorCode.FACTORY_WITHOUT_BODY,
|
||||
ParserErrorCode.FACTORY_WITH_INITIALIZERS,
|
||||
ParserErrorCode.FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR,
|
||||
ParserErrorCode.FIELD_INITIALIZED_OUTSIDE_DECLARING_CLASS,
|
||||
ParserErrorCode.FINAL_AND_COVARIANT,
|
||||
ParserErrorCode.FINAL_AND_VAR,
|
||||
ParserErrorCode.FINAL_CLASS,
|
||||
|
|
|
@ -256,6 +256,9 @@ class ParserErrorCode extends ErrorCode {
|
|||
static const ParserErrorCode FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR =
|
||||
_FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR;
|
||||
|
||||
static const ParserErrorCode FIELD_INITIALIZED_OUTSIDE_DECLARING_CLASS =
|
||||
_FIELD_INITIALIZED_OUTSIDE_DECLARING_CLASS;
|
||||
|
||||
static const ParserErrorCode FINAL_AND_COVARIANT = _FINAL_AND_COVARIANT;
|
||||
|
||||
static const ParserErrorCode FINAL_AND_VAR = _FINAL_AND_VAR;
|
||||
|
|
|
@ -95,6 +95,7 @@ final fastaAnalyzerErrorCodes = <ErrorCode>[
|
|||
_EXTERNAL_FACTORY_REDIRECTION,
|
||||
_EXTERNAL_FACTORY_WITH_BODY,
|
||||
_EXTERNAL_CONSTRUCTOR_WITH_BODY,
|
||||
_FIELD_INITIALIZED_OUTSIDE_DECLARING_CLASS,
|
||||
];
|
||||
|
||||
const ParserErrorCode _ABSTRACT_CLASS_MEMBER = const ParserErrorCode(
|
||||
|
@ -301,6 +302,12 @@ const ParserErrorCode _FACTORY_TOP_LEVEL_DECLARATION = const ParserErrorCode(
|
|||
r"Top-level declarations can't be declared to be 'factory'.",
|
||||
correction: "Try removing the keyword 'factory'.");
|
||||
|
||||
const ParserErrorCode _FIELD_INITIALIZED_OUTSIDE_DECLARING_CLASS =
|
||||
const ParserErrorCode('FIELD_INITIALIZED_OUTSIDE_DECLARING_CLASS',
|
||||
r"A field can only be initialized in it's declaring class",
|
||||
correction:
|
||||
"Try moving the field initialization into the constructor body.");
|
||||
|
||||
const ParserErrorCode _FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR =
|
||||
const ParserErrorCode('FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR',
|
||||
r"Field formal parameters can only be used in a constructor.",
|
||||
|
|
|
@ -625,12 +625,23 @@ class AstBuilder extends StackListener {
|
|||
SimpleIdentifier fieldName;
|
||||
Expression left = initializerObject.leftHandSide;
|
||||
if (left is PropertyAccess) {
|
||||
var thisExpression = left.target as ThisExpression;
|
||||
thisKeyword = thisExpression.thisKeyword;
|
||||
period = left.operator;
|
||||
Expression target = left.target;
|
||||
if (target is ThisExpression) {
|
||||
thisKeyword = target.thisKeyword;
|
||||
period = left.operator;
|
||||
} else {
|
||||
assert(target is SuperExpression);
|
||||
// Recovery:
|
||||
// Parser has reported FieldInitializedOutsideDeclaringClass.
|
||||
}
|
||||
fieldName = left.propertyName;
|
||||
} else if (left is SimpleIdentifier) {
|
||||
fieldName = left;
|
||||
} else {
|
||||
fieldName = left as SimpleIdentifier;
|
||||
// Recovery:
|
||||
// Parser has reported invalid assignment.
|
||||
SuperExpression superExpression = left;
|
||||
fieldName = ast.simpleIdentifier(superExpression.superKeyword);
|
||||
}
|
||||
initializers.add(ast.constructorFieldInitializer(
|
||||
thisKeyword,
|
||||
|
|
|
@ -3890,6 +3890,41 @@ class Wrong<T> {
|
|||
]);
|
||||
}
|
||||
|
||||
void test_invalidConstructorSuperAssignment() {
|
||||
createParser("C() : super = 42;");
|
||||
ClassMember member = parser.parseClassMember('C');
|
||||
expectNotNullIfNoErrors(member);
|
||||
listener.assertErrors(usingFastaParser
|
||||
? [expectedError(ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR, 6, 5)]
|
||||
: [
|
||||
expectedError(ParserErrorCode.EXPECTED_TOKEN, 14, 1),
|
||||
expectedError(ParserErrorCode.EXPECTED_TYPE_NAME, 16, 2),
|
||||
expectedError(ParserErrorCode.UNEXPECTED_TOKEN, 16, 2),
|
||||
expectedError(
|
||||
ParserErrorCode.REDIRECTION_IN_NON_FACTORY_CONSTRUCTOR, 16, 0),
|
||||
]);
|
||||
}
|
||||
|
||||
void test_invalidConstructorSuperFieldAssignment() {
|
||||
createParser("C() : super.a = 42;");
|
||||
ClassMember member = parser.parseClassMember('C');
|
||||
expectNotNullIfNoErrors(member);
|
||||
listener.assertErrors(usingFastaParser
|
||||
? [
|
||||
expectedError(
|
||||
ParserErrorCode.FIELD_INITIALIZED_OUTSIDE_DECLARING_CLASS,
|
||||
12,
|
||||
1)
|
||||
]
|
||||
: [
|
||||
expectedError(ParserErrorCode.EXPECTED_TOKEN, 14, 1),
|
||||
expectedError(ParserErrorCode.EXPECTED_TYPE_NAME, 16, 2),
|
||||
expectedError(ParserErrorCode.UNEXPECTED_TOKEN, 16, 2),
|
||||
expectedError(
|
||||
ParserErrorCode.REDIRECTION_IN_NON_FACTORY_CONSTRUCTOR, 16, 0),
|
||||
]);
|
||||
}
|
||||
|
||||
void test_invalidHexEscape_invalidDigit() {
|
||||
StringLiteral literal = parseExpression("'not \\x0 a'",
|
||||
errors: [expectedError(ParserErrorCode.INVALID_HEX_ESCAPE, 5, 3)]);
|
||||
|
|
|
@ -74,6 +74,7 @@ class Flags {
|
|||
|
||||
static const String readData = '--read-data';
|
||||
static const String writeData = '--write-data';
|
||||
static const String cfeOnly = '--cfe-only';
|
||||
|
||||
static const String serverMode = '--server-mode';
|
||||
|
||||
|
|
|
@ -168,8 +168,8 @@ abstract class Compiler {
|
|||
enqueuer = backend.makeEnqueuer();
|
||||
|
||||
tasks = [
|
||||
kernelLoader =
|
||||
new KernelLoaderTask(options, provider, reporter, measurer),
|
||||
kernelLoader = new KernelLoaderTask(
|
||||
options, provider, _outputProvider, reporter, measurer),
|
||||
kernelFrontEndTask,
|
||||
globalInference = new GlobalTypeInferenceTask(this),
|
||||
constants = backend.constantCompilerTask,
|
||||
|
@ -255,6 +255,7 @@ abstract class Compiler {
|
|||
if (compilationFailed && !options.generateCodeWithCompileTimeErrors) {
|
||||
return;
|
||||
}
|
||||
if (options.cfeOnly) return;
|
||||
_mainLibraryUri = result.rootLibraryUri;
|
||||
|
||||
frontendStrategy.registerLoadedLibraries(result);
|
||||
|
|
|
@ -263,6 +263,10 @@ Future<api.CompilationResult> compile(List<String> argv,
|
|||
compilationStrategy = CompilationStrategy.fromData;
|
||||
}
|
||||
|
||||
void setCfeOnly(String argument) {
|
||||
compilationStrategy = CompilationStrategy.toKernel;
|
||||
}
|
||||
|
||||
void setWriteData(String argument) {
|
||||
if (compilationStrategy == CompilationStrategy.fromData) {
|
||||
fail("Cannot read and write serialized simultaneously.");
|
||||
|
@ -333,6 +337,7 @@ Future<api.CompilationResult> compile(List<String> argv,
|
|||
new OptionHandler('--libraries-spec=.+', setLibrarySpecificationUri),
|
||||
new OptionHandler('${Flags.readData}|${Flags.readData}=.+', setReadData),
|
||||
new OptionHandler('${Flags.writeData}|${Flags.writeData}=.+', setWriteData),
|
||||
new OptionHandler(Flags.cfeOnly, setCfeOnly),
|
||||
new OptionHandler('--out=.+|-o.*', setOutput, multipleArguments: true),
|
||||
new OptionHandler('-O.*', setOptimizationLevel),
|
||||
new OptionHandler(Flags.allowMockCompilation, ignoreOption),
|
||||
|
@ -492,6 +497,10 @@ Future<api.CompilationResult> compile(List<String> argv,
|
|||
case CompilationStrategy.direct:
|
||||
out ??= currentDirectory.resolve('out.js');
|
||||
break;
|
||||
case CompilationStrategy.toKernel:
|
||||
out ??= currentDirectory.resolve('out.dill');
|
||||
options.add(Flags.cfeOnly);
|
||||
break;
|
||||
case CompilationStrategy.toData:
|
||||
out ??= currentDirectory.resolve('out.dill');
|
||||
writeDataUri ??= currentDirectory.resolve('$out.data');
|
||||
|
@ -544,6 +553,18 @@ Future<api.CompilationResult> compile(List<String> argv,
|
|||
}
|
||||
}
|
||||
break;
|
||||
case CompilationStrategy.toKernel:
|
||||
int dartCharactersRead = inputProvider.dartCharactersRead;
|
||||
int dataBytesWritten = outputProvider.totalDataWritten;
|
||||
print('Compiled '
|
||||
'${_formatCharacterCount(dartCharactersRead)} characters Dart to '
|
||||
'${_formatCharacterCount(dataBytesWritten)} kernel bytes in '
|
||||
'${_formatDurationAsSeconds(wallclock.elapsed)} seconds');
|
||||
String input = uriPathToNative(scriptName);
|
||||
String dillOutput =
|
||||
relativize(currentDirectory, out, Platform.isWindows);
|
||||
print('Dart file ($input) compiled to ${dillOutput}.');
|
||||
break;
|
||||
case CompilationStrategy.toData:
|
||||
int dartCharactersRead = inputProvider.dartCharactersRead;
|
||||
int dataBytesWritten = outputProvider.totalDataWritten;
|
||||
|
@ -1007,4 +1028,4 @@ void batchMain(List<String> batchArguments) {
|
|||
});
|
||||
}
|
||||
|
||||
enum CompilationStrategy { direct, toData, fromData }
|
||||
enum CompilationStrategy { direct, toKernel, toData, fromData }
|
||||
|
|
|
@ -9,6 +9,7 @@ import 'dart:async';
|
|||
import 'package:front_end/src/fasta/kernel/utils.dart';
|
||||
import 'package:kernel/ast.dart' as ir;
|
||||
import 'package:kernel/binary/ast_from_binary.dart' show BinaryBuilder;
|
||||
import 'package:kernel/binary/ast_to_binary.dart' show BinaryPrinter;
|
||||
|
||||
import 'package:front_end/src/api_unstable/dart2js.dart' as fe;
|
||||
import 'package:kernel/kernel.dart' hide LibraryDependency, Combinator;
|
||||
|
@ -18,6 +19,7 @@ import '../../compiler_new.dart' as api;
|
|||
import '../common/tasks.dart' show CompilerTask, Measurer;
|
||||
import '../common.dart';
|
||||
import '../options.dart';
|
||||
import '../util/sink_adapter.dart';
|
||||
|
||||
import 'front_end_adapter.dart';
|
||||
import 'dart2js_target.dart' show Dart2jsTarget;
|
||||
|
@ -31,6 +33,7 @@ class KernelLoaderTask extends CompilerTask {
|
|||
final DiagnosticReporter _reporter;
|
||||
|
||||
final api.CompilerInput _compilerInput;
|
||||
final api.CompilerOutput _compilerOutput;
|
||||
|
||||
final CompilerOptions _options;
|
||||
|
||||
|
@ -43,8 +46,8 @@ class KernelLoaderTask extends CompilerTask {
|
|||
/// This is used for testing.
|
||||
bool forceSerialization = false;
|
||||
|
||||
KernelLoaderTask(
|
||||
this._options, this._compilerInput, this._reporter, Measurer measurer)
|
||||
KernelLoaderTask(this._options, this._compilerInput, this._compilerOutput,
|
||||
this._reporter, Measurer measurer)
|
||||
: initializedCompilerState = _options.kernelInitializedCompilerState,
|
||||
super(measurer);
|
||||
|
||||
|
@ -78,6 +81,20 @@ class KernelLoaderTask extends CompilerTask {
|
|||
resolvedUri);
|
||||
}
|
||||
if (component == null) return null;
|
||||
|
||||
if (_options.cfeOnly) {
|
||||
measureSubtask('serialize dill', () {
|
||||
_reporter.log('Writing dill to ${_options.outputUri}');
|
||||
api.BinaryOutputSink dillOutput =
|
||||
_compilerOutput.createBinarySink(_options.outputUri);
|
||||
BinaryOutputSinkAdapter irSink =
|
||||
new BinaryOutputSinkAdapter(dillOutput);
|
||||
BinaryPrinter printer = new BinaryPrinter(irSink);
|
||||
printer.writeComponentFile(component);
|
||||
irSink.close();
|
||||
});
|
||||
}
|
||||
|
||||
if (forceSerialization) {
|
||||
// TODO(johnniwinther): Remove this when #34942 is fixed.
|
||||
List<int> data = serializeComponent(component);
|
||||
|
|
|
@ -62,6 +62,10 @@ class CompilerOptions implements DiagnosticOptions {
|
|||
/// If this is set, the compilation stops after type inference.
|
||||
Uri writeDataUri;
|
||||
|
||||
/// Whether to run only the CFE and emit the generated kernel file in
|
||||
/// [outputUri].
|
||||
bool cfeOnly = false;
|
||||
|
||||
/// Resolved constant "environment" values passed to the compiler via the `-D`
|
||||
/// flags.
|
||||
Map<String, String> environment = const <String, String>{};
|
||||
|
@ -332,7 +336,8 @@ class CompilerOptions implements DiagnosticOptions {
|
|||
..verbose = _hasOption(options, Flags.verbose)
|
||||
..showInternalProgress = _hasOption(options, Flags.progress)
|
||||
..readDataUri = _extractUriOption(options, '${Flags.readData}=')
|
||||
..writeDataUri = _extractUriOption(options, '${Flags.writeData}=');
|
||||
..writeDataUri = _extractUriOption(options, '${Flags.writeData}=')
|
||||
..cfeOnly = _hasOption(options, Flags.cfeOnly);
|
||||
}
|
||||
|
||||
void validate() {
|
||||
|
|
|
@ -10,7 +10,6 @@ import 'package:front_end/src/fasta/kernel/utils.dart';
|
|||
import 'package:kernel/ast.dart' as ir;
|
||||
import 'package:kernel/binary/ast_from_binary.dart' show BinaryBuilder;
|
||||
|
||||
import '../../compiler_new.dart' as api;
|
||||
import '../diagnostics/diagnostic_listener.dart';
|
||||
import '../environment.dart';
|
||||
import '../js_model/js_world.dart';
|
||||
|
@ -18,6 +17,7 @@ import '../options.dart';
|
|||
import '../source_file_provider.dart';
|
||||
import '../types/abstract_value_domain.dart';
|
||||
import '../types/types.dart';
|
||||
import '../util/sink_adapter.dart';
|
||||
import 'serialization.dart';
|
||||
import 'task.dart';
|
||||
|
||||
|
@ -130,19 +130,3 @@ class ObjectsInMemorySerializationStrategy
|
|||
abstractValueStrategy, component, source);
|
||||
}
|
||||
}
|
||||
|
||||
class BinaryOutputSinkAdapter implements Sink<List<int>> {
|
||||
api.BinaryOutputSink output;
|
||||
|
||||
BinaryOutputSinkAdapter(this.output);
|
||||
|
||||
@override
|
||||
void add(List<int> data) {
|
||||
output.write(data);
|
||||
}
|
||||
|
||||
@override
|
||||
void close() {
|
||||
output.close();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ import '../js_model/js_world.dart';
|
|||
import '../options.dart';
|
||||
import '../types/abstract_value_domain.dart';
|
||||
import '../types/types.dart';
|
||||
import 'strategies.dart';
|
||||
import '../util/sink_adapter.dart';
|
||||
import 'serialization.dart';
|
||||
|
||||
void serializeGlobalTypeInferenceResults(
|
||||
|
@ -53,6 +53,9 @@ class SerializationTask extends CompilerTask {
|
|||
|
||||
void serialize(GlobalTypeInferenceResults results) {
|
||||
measureSubtask('serialize dill', () {
|
||||
// TODO(sigmund): remove entirely: we will do this immediately as soon as
|
||||
// we get the component in the kernel/loader.dart task once we refactor
|
||||
// how we apply our modular kernel transformation for super mixin calls.
|
||||
compiler.reporter.log('Writing dill to ${compiler.options.outputUri}');
|
||||
api.BinaryOutputSink dillOutput =
|
||||
compiler.outputProvider.createBinarySink(compiler.options.outputUri);
|
||||
|
|
17
pkg/compiler/lib/src/util/sink_adapter.dart
Normal file
17
pkg/compiler/lib/src/util/sink_adapter.dart
Normal file
|
@ -0,0 +1,17 @@
|
|||
import '../../compiler_new.dart' as api;
|
||||
|
||||
class BinaryOutputSinkAdapter implements Sink<List<int>> {
|
||||
api.BinaryOutputSink output;
|
||||
|
||||
BinaryOutputSinkAdapter(this.output);
|
||||
|
||||
@override
|
||||
void add(List<int> data) {
|
||||
output.write(data);
|
||||
}
|
||||
|
||||
@override
|
||||
void close() {
|
||||
output.close();
|
||||
}
|
||||
}
|
|
@ -125,8 +125,30 @@ Future<CompilerResult> _compile(List<String> args,
|
|||
var summaryModules = Map.fromIterables(
|
||||
summaryPaths.map(sourcePathToUri), options.summaryModules.values);
|
||||
var useAnalyzer = summaryPaths.any((s) => !s.endsWith('.dill'));
|
||||
var sdkSummaryPath = argResults['dart-sdk-summary'] as String ??
|
||||
(useAnalyzer ? defaultAnalyzerSdkSummaryPath : defaultSdkSummaryPath);
|
||||
var sdkSummaryPath = argResults['dart-sdk-summary'] as String;
|
||||
String librarySpecPath;
|
||||
if (sdkSummaryPath == null) {
|
||||
sdkSummaryPath =
|
||||
useAnalyzer ? defaultAnalyzerSdkSummaryPath : defaultSdkSummaryPath;
|
||||
librarySpecPath = defaultLibrarySpecPath;
|
||||
} else {
|
||||
// TODO(jmesserly): the `isSupported` bit should be included in the SDK
|
||||
// summary, but front_end requires a separate file, so we have to work
|
||||
// around that, while avoiding yet another command line option.
|
||||
//
|
||||
// Right now we search two locations: one level above the SDK summary
|
||||
// (this works for the build and SDK layouts) or next to the SDK summary
|
||||
// (if the user is doing something custom).
|
||||
//
|
||||
// Another option: we could make an in-memory file with the relevant info.
|
||||
librarySpecPath =
|
||||
path.join(path.dirname(path.dirname(sdkSummaryPath)), "libraries.json");
|
||||
if (!File(librarySpecPath).existsSync()) {
|
||||
librarySpecPath =
|
||||
path.join(path.dirname(sdkSummaryPath), "libraries.json");
|
||||
}
|
||||
}
|
||||
|
||||
useAnalyzer = useAnalyzer || !sdkSummaryPath.endsWith('.dill');
|
||||
|
||||
/// The .packages file path provided by the user.
|
||||
|
@ -158,6 +180,7 @@ Future<CompilerResult> _compile(List<String> args,
|
|||
oldCompilerState,
|
||||
sourcePathToUri(sdkSummaryPath),
|
||||
sourcePathToUri(packageFile),
|
||||
sourcePathToUri(librarySpecPath),
|
||||
summaryModules.keys.toList(),
|
||||
DevCompilerTarget(),
|
||||
fileSystem: fileSystem);
|
||||
|
@ -332,6 +355,8 @@ Map<String, String> parseAndRemoveDeclaredVariables(List<String> args) {
|
|||
final defaultSdkSummaryPath =
|
||||
path.join(getSdkPath(), 'lib', '_internal', 'ddc_sdk.dill');
|
||||
|
||||
final defaultLibrarySpecPath = path.join(getSdkPath(), 'lib', 'libraries.json');
|
||||
|
||||
final defaultAnalyzerSdkSummaryPath =
|
||||
path.join(getSdkPath(), 'lib', '_internal', 'ddc_sdk.sum');
|
||||
|
||||
|
|
|
@ -573,7 +573,7 @@ const nullCheck = const _NullCheck();
|
|||
var mainUri = Uri.file('/memory/test.dart');
|
||||
_fileSystem.entityForUri(mainUri).writeAsStringSync(code);
|
||||
_compilerState = await fe.initializeCompiler(
|
||||
_compilerState, sdkUri, packagesUri, [], DevCompilerTarget(),
|
||||
_compilerState, sdkUri, packagesUri, null, [], DevCompilerTarget(),
|
||||
fileSystem: _fileSystem);
|
||||
fe.DdcResult result =
|
||||
await fe.compile(_compilerState, [mainUri], diagnosticMessageHandler);
|
||||
|
|
|
@ -1,110 +0,0 @@
|
|||
{
|
||||
"dartdevc": {
|
||||
"libraries": {
|
||||
"_runtime": {
|
||||
"uri": "../private/ddc_runtime/runtime.dart"
|
||||
},
|
||||
"_debugger": {
|
||||
"uri": "../private/debugger.dart"
|
||||
},
|
||||
"_foreign_helper": {
|
||||
"uri": "../private/foreign_helper.dart"
|
||||
},
|
||||
"_http": {
|
||||
"uri": "../../../../../sdk/lib/_http/http.dart"
|
||||
},
|
||||
"_interceptors": {
|
||||
"uri": "../private/interceptors.dart"
|
||||
},
|
||||
"_internal": {
|
||||
"uri": "../../../../../sdk/lib/internal/internal.dart",
|
||||
"patches": "../patch/internal_patch.dart"
|
||||
},
|
||||
"_isolate_helper": {
|
||||
"uri": "../private/isolate_helper.dart"
|
||||
},
|
||||
"_js_helper": {
|
||||
"uri": "../private/js_helper.dart"
|
||||
},
|
||||
"_js_mirrors": {
|
||||
"uri": "../private/js_mirrors.dart"
|
||||
},
|
||||
"_js_primitives": {
|
||||
"uri": "../private/js_primitives.dart"
|
||||
},
|
||||
"_metadata": {
|
||||
"uri": "../../../../../sdk/lib/html/html_common/metadata.dart"
|
||||
},
|
||||
"_native_typed_data": {
|
||||
"uri": "../private/native_typed_data.dart"
|
||||
},
|
||||
"async": {
|
||||
"uri": "../../../../../sdk/lib/async/async.dart",
|
||||
"patches": "../patch/async_patch.dart"
|
||||
},
|
||||
"collection": {
|
||||
"uri": "../../../../../sdk/lib/collection/collection.dart",
|
||||
"patches": "../patch/collection_patch.dart"
|
||||
},
|
||||
"convert": {
|
||||
"uri": "../../../../../sdk/lib/convert/convert.dart",
|
||||
"patches": "../patch/convert_patch.dart"
|
||||
},
|
||||
"core": {
|
||||
"uri": "../../../../../sdk/lib/core/core.dart",
|
||||
"patches": "../patch/core_patch.dart"
|
||||
},
|
||||
"developer": {
|
||||
"uri": "../../../../../sdk/lib/developer/developer.dart",
|
||||
"patches": "../patch/developer_patch.dart"
|
||||
},
|
||||
"io": {
|
||||
"uri": "../../../../../sdk/lib/io/io.dart",
|
||||
"patches": "../patch/io_patch.dart"
|
||||
},
|
||||
"isolate": {
|
||||
"uri": "../../../../../sdk/lib/isolate/isolate.dart",
|
||||
"patches": "../patch/isolate_patch.dart"
|
||||
},
|
||||
"mirrors": {
|
||||
"uri": "../../../../../sdk/lib/mirrors/mirrors.dart",
|
||||
"patches": "../patch/mirrors_patch.dart"
|
||||
},
|
||||
"math": {
|
||||
"uri": "../../../../../sdk/lib/math/math.dart",
|
||||
"patches": "../patch/math_patch.dart"
|
||||
},
|
||||
"typed_data": {
|
||||
"uri": "../../../../../sdk/lib/typed_data/typed_data.dart",
|
||||
"patches": "../patch/typed_data_patch.dart"
|
||||
},
|
||||
"html": {
|
||||
"uri": "../../../../../sdk/lib/html/dart2js/html_dart2js.dart"
|
||||
},
|
||||
"html_common": {
|
||||
"uri": "../../../../../sdk/lib/html/html_common/html_common_dart2js.dart"
|
||||
},
|
||||
"indexed_db": {
|
||||
"uri": "../../../../../sdk/lib/indexed_db/dart2js/indexed_db_dart2js.dart"
|
||||
},
|
||||
"js": {
|
||||
"uri": "js/dart2js/js_dart2js.dart"
|
||||
},
|
||||
"js_util": {
|
||||
"uri": "js_util/dart2js/js_util_dart2js.dart"
|
||||
},
|
||||
"svg": {
|
||||
"uri": "../../../../../sdk/lib/svg/dart2js/svg_dart2js.dart"
|
||||
},
|
||||
"web_audio": {
|
||||
"uri": "../../../../../sdk/lib/web_audio/dart2js/web_audio_dart2js.dart"
|
||||
},
|
||||
"web_gl": {
|
||||
"uri": "../../../../../sdk/lib/web_gl/dart2js/web_gl_dart2js.dart"
|
||||
},
|
||||
"web_sql": {
|
||||
"uri": "../../../../../sdk/lib/web_sql/dart2js/web_sql_dart2js.dart"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -36,13 +36,14 @@ Future main(List<String> args) async {
|
|||
outputPath = path.join(genDir, 'kernel', 'ddc_sdk.dill');
|
||||
}
|
||||
|
||||
var librarySpecPath = parserOptions['libraries'] as String;
|
||||
|
||||
var target = DevCompilerTarget();
|
||||
var options = CompilerOptions()
|
||||
..compileSdk = true
|
||||
// TODO(sigmund): remove this unnecessary option when possible.
|
||||
..sdkRoot = Uri.base
|
||||
..librariesSpecificationUri =
|
||||
Uri.base.resolveUri(Uri.file(parserOptions['libraries']))
|
||||
..librariesSpecificationUri = Uri.base.resolveUri(Uri.file(librarySpecPath))
|
||||
..target = target;
|
||||
|
||||
var inputs = target.extraRequiredLibraries.map(Uri.parse).toList();
|
||||
|
@ -51,6 +52,8 @@ Future main(List<String> args) async {
|
|||
var outputDir = path.dirname(outputPath);
|
||||
await Directory(outputDir).create(recursive: true);
|
||||
await writeComponentToBinary(component, outputPath);
|
||||
File(librarySpecPath).copySync(
|
||||
path.join(path.dirname(outputDir), path.basename(librarySpecPath)));
|
||||
|
||||
var jsModule = ProgramCompiler(
|
||||
component,
|
||||
|
|
|
@ -56,6 +56,7 @@ Future<InitializedCompilerState> initializeCompiler(
|
|||
InitializedCompilerState oldState,
|
||||
Uri sdkSummary,
|
||||
Uri packagesFile,
|
||||
Uri librariesSpecificationUri,
|
||||
List<Uri> inputSummaries,
|
||||
Target target,
|
||||
{FileSystem fileSystem}) async {
|
||||
|
@ -71,6 +72,7 @@ Future<InitializedCompilerState> initializeCompiler(
|
|||
if (oldState != null &&
|
||||
oldState.options.sdkSummary == sdkSummary &&
|
||||
oldState.options.packagesFileUri == packagesFile &&
|
||||
oldState.options.librariesSpecificationUri == librariesSpecificationUri &&
|
||||
listEqual(oldState.options.inputSummaries, inputSummaries)) {
|
||||
// Reuse old state.
|
||||
|
||||
|
@ -91,6 +93,7 @@ Future<InitializedCompilerState> initializeCompiler(
|
|||
..sdkSummary = sdkSummary
|
||||
..packagesFileUri = packagesFile
|
||||
..inputSummaries = inputSummaries
|
||||
..librariesSpecificationUri = librariesSpecificationUri
|
||||
..target = target
|
||||
..fileSystem = fileSystem ?? StandardFileSystem.instance;
|
||||
|
||||
|
|
|
@ -3439,6 +3439,17 @@ const MessageCode messageFastaUsageShort =
|
|||
-o <file> Generate the output into <file>.
|
||||
-h Display this message (add -v for information about all options).""");
|
||||
|
||||
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
|
||||
const Code<Null> codeFieldInitializedOutsideDeclaringClass =
|
||||
messageFieldInitializedOutsideDeclaringClass;
|
||||
|
||||
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
|
||||
const MessageCode messageFieldInitializedOutsideDeclaringClass = const MessageCode(
|
||||
"FieldInitializedOutsideDeclaringClass",
|
||||
index: 88,
|
||||
message: r"""A field can only be initialized in it's declaring class""",
|
||||
tip: r"""Try moving the field initialization into the constructor body.""");
|
||||
|
||||
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
|
||||
const Code<Null> codeFieldInitializerOutsideConstructor =
|
||||
messageFieldInitializerOutsideConstructor;
|
||||
|
|
|
@ -2538,7 +2538,14 @@ class Parser {
|
|||
token = next;
|
||||
next = token.next;
|
||||
}
|
||||
if (!optional('(', next)) {
|
||||
if (optional('=', next)) {
|
||||
if (optional('super', token)) {
|
||||
// parseExpression will report error on assignment to super
|
||||
} else {
|
||||
reportRecoverableError(
|
||||
token, fasta.messageFieldInitializedOutsideDeclaringClass);
|
||||
}
|
||||
} else if (!optional('(', next)) {
|
||||
reportRecoverableError(
|
||||
next, fasta.templateExpectedAfterButGot.withArguments('('));
|
||||
rewriter.insertParens(token, false);
|
||||
|
|
|
@ -172,6 +172,7 @@ FastaUsageLong/analyzerCode: Fail
|
|||
FastaUsageLong/example: Fail
|
||||
FastaUsageShort/analyzerCode: Fail
|
||||
FastaUsageShort/example: Fail
|
||||
FieldInitializedOutsideDeclaringClass/script1: Fail
|
||||
FieldInitializerOutsideConstructor/script1: Fail
|
||||
FinalAndCovariant/script2: Fail
|
||||
FinalFieldWithoutInitializer/example: Fail
|
||||
|
|
|
@ -931,11 +931,21 @@ InvalidVoid:
|
|||
- "void x; main() {}"
|
||||
- "foo(void x) {} main() { foo(null); }"
|
||||
|
||||
# TODO(danrubel): Review where this error is generated and consider generating
|
||||
# FieldInitializedOutsideDeclaringClass instead of this in some situations.
|
||||
InvalidInitializer:
|
||||
template: "Not a valid initializer."
|
||||
tip: "To initialize a field, use the syntax 'name = value'."
|
||||
analyzerCode: INVALID_INITIALIZER
|
||||
|
||||
FieldInitializedOutsideDeclaringClass:
|
||||
index: 88
|
||||
template: "A field can only be initialized in it's declaring class"
|
||||
tip: "Try moving the field initialization into the constructor body."
|
||||
analyzerCode: ParserErrorCode.FIELD_INITIALIZED_OUTSIDE_DECLARING_CLASS
|
||||
script:
|
||||
- "class A { int a; } class C extends A { C() : super.a = 42; }"
|
||||
|
||||
FinalFieldNotInitialized:
|
||||
template: "Final field '#name' is not initialized."
|
||||
tip: "Try to initialize the field in the declaration or in every constructor."
|
||||
|
|
28
pkg/front_end/testcases/regress/issue_35151.dart
Normal file
28
pkg/front_end/testcases/regress/issue_35151.dart
Normal file
|
@ -0,0 +1,28 @@
|
|||
// Copyright (c) 2018, 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.
|
||||
|
||||
class A {
|
||||
int a;
|
||||
}
|
||||
|
||||
class B extends A {
|
||||
B() : super.a = 42;
|
||||
}
|
||||
|
||||
class C {
|
||||
C() : super = 42;
|
||||
}
|
||||
|
||||
main() {
|
||||
try {
|
||||
var b = new B();
|
||||
} catch (_) {
|
||||
// ignore
|
||||
}
|
||||
try {
|
||||
var c = new C();
|
||||
} catch (_) {
|
||||
// ignore
|
||||
}
|
||||
}
|
|
@ -0,0 +1,60 @@
|
|||
// Formatted problems:
|
||||
//
|
||||
// pkg/front_end/testcases/regress/issue_35151.dart:10:15: Error: A field can only be initialized in it's declaring class
|
||||
// Try moving the field initialization into the constructor body.
|
||||
// B() : super.a = 42;
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/regress/issue_35151.dart:10:15: Error: Not a valid initializer.
|
||||
// To initialize a field, use the syntax 'name = value'.
|
||||
// B() : super.a = 42;
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/regress/issue_35151.dart:14:9: Error: Can't access 'super' in a field initializer.
|
||||
// C() : super = 42;
|
||||
// ^^^^^
|
||||
|
||||
// Unhandled errors:
|
||||
//
|
||||
// pkg/front_end/testcases/regress/issue_35151.dart:10:15: Error: A field can only be initialized in it's declaring class
|
||||
// Try moving the field initialization into the constructor body.
|
||||
// B() : super.a = 42;
|
||||
// ^
|
||||
|
||||
library;
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
class A extends core::Object {
|
||||
field core::int a = null;
|
||||
synthetic constructor •() → self::A
|
||||
: super core::Object::•()
|
||||
;
|
||||
}
|
||||
class B extends self::A {
|
||||
constructor •() → self::B
|
||||
: final dynamic #t1 = invalid-expression "pkg/front_end/testcases/regress/issue_35151.dart:10:15: Error: Not a valid initializer.
|
||||
To initialize a field, use the syntax 'name = value'.
|
||||
B() : super.a = 42;
|
||||
^"
|
||||
;
|
||||
}
|
||||
class C extends core::Object {
|
||||
constructor •() → self::C
|
||||
: final dynamic #t2 = invalid-expression "pkg/front_end/testcases/regress/issue_35151.dart:14:9: Error: Can't access 'super' in a field initializer.
|
||||
C() : super = 42;
|
||||
^^^^^"
|
||||
;
|
||||
}
|
||||
static method main() → dynamic {
|
||||
try {
|
||||
dynamic b = new self::B::•();
|
||||
}
|
||||
on dynamic catch(final dynamic _) {
|
||||
}
|
||||
try {
|
||||
dynamic c = new self::C::•();
|
||||
}
|
||||
on dynamic catch(final dynamic _) {
|
||||
}
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
// Unhandled errors:
|
||||
//
|
||||
// pkg/front_end/testcases/regress/issue_35151.dart:10:15: Error: A field can only be initialized in it's declaring class
|
||||
// Try moving the field initialization into the constructor body.
|
||||
// B() : super.a = 42;
|
||||
// ^
|
||||
|
||||
library;
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
class A extends core::Object {
|
||||
field core::int a = null;
|
||||
synthetic constructor •() → self::A
|
||||
: super core::Object::•()
|
||||
;
|
||||
}
|
||||
class B extends self::A {
|
||||
constructor •() → self::B
|
||||
: final dynamic #t1 = invalid-expression "pkg/front_end/testcases/regress/issue_35151.dart:10:15: Error: Not a valid initializer.
|
||||
To initialize a field, use the syntax 'name = value'.
|
||||
B() : super.a = 42;
|
||||
^"
|
||||
;
|
||||
}
|
||||
class C extends core::Object {
|
||||
constructor •() → self::C
|
||||
: final dynamic #t2 = invalid-expression "pkg/front_end/testcases/regress/issue_35151.dart:14:9: Error: Can't access 'super' in a field initializer.
|
||||
C() : super = 42;
|
||||
^^^^^"
|
||||
;
|
||||
}
|
||||
static method main() → dynamic {
|
||||
try {
|
||||
dynamic b = new self::B::•();
|
||||
}
|
||||
on dynamic catch(final dynamic _) {
|
||||
}
|
||||
try {
|
||||
dynamic c = new self::C::•();
|
||||
}
|
||||
on dynamic catch(final dynamic _) {
|
||||
}
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
// Formatted problems:
|
||||
//
|
||||
// pkg/front_end/testcases/regress/issue_35151.dart:10:15: Error: A field can only be initialized in it's declaring class
|
||||
// Try moving the field initialization into the constructor body.
|
||||
// B() : super.a = 42;
|
||||
// ^
|
||||
|
||||
library;
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
class A extends core::Object {
|
||||
field core::int a;
|
||||
synthetic constructor •() → self::A
|
||||
;
|
||||
}
|
||||
class B extends self::A {
|
||||
constructor •() → self::B
|
||||
;
|
||||
}
|
||||
class C extends core::Object {
|
||||
constructor •() → self::C
|
||||
;
|
||||
}
|
||||
static method main() → dynamic
|
||||
;
|
|
@ -0,0 +1,60 @@
|
|||
// Formatted problems:
|
||||
//
|
||||
// pkg/front_end/testcases/regress/issue_35151.dart:10:15: Error: A field can only be initialized in it's declaring class
|
||||
// Try moving the field initialization into the constructor body.
|
||||
// B() : super.a = 42;
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/regress/issue_35151.dart:10:15: Error: Not a valid initializer.
|
||||
// To initialize a field, use the syntax 'name = value'.
|
||||
// B() : super.a = 42;
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/regress/issue_35151.dart:14:9: Error: Can't access 'super' in a field initializer.
|
||||
// C() : super = 42;
|
||||
// ^^^^^
|
||||
|
||||
// Unhandled errors:
|
||||
//
|
||||
// pkg/front_end/testcases/regress/issue_35151.dart:10:15: Error: A field can only be initialized in it's declaring class
|
||||
// Try moving the field initialization into the constructor body.
|
||||
// B() : super.a = 42;
|
||||
// ^
|
||||
|
||||
library;
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
class A extends core::Object {
|
||||
field core::int a = null;
|
||||
synthetic constructor •() → self::A
|
||||
: super core::Object::•()
|
||||
;
|
||||
}
|
||||
class B extends self::A {
|
||||
constructor •() → self::B
|
||||
: final dynamic #t1 = invalid-expression "pkg/front_end/testcases/regress/issue_35151.dart:10:15: Error: Not a valid initializer.
|
||||
To initialize a field, use the syntax 'name = value'.
|
||||
B() : super.a = 42;
|
||||
^"
|
||||
;
|
||||
}
|
||||
class C extends core::Object {
|
||||
constructor •() → self::C
|
||||
: final dynamic #t2 = invalid-expression "pkg/front_end/testcases/regress/issue_35151.dart:14:9: Error: Can't access 'super' in a field initializer.
|
||||
C() : super = 42;
|
||||
^^^^^"
|
||||
;
|
||||
}
|
||||
static method main() → dynamic {
|
||||
try {
|
||||
self::B b = new self::B::•();
|
||||
}
|
||||
on dynamic catch(final dynamic _) {
|
||||
}
|
||||
try {
|
||||
self::C c = new self::C::•();
|
||||
}
|
||||
on dynamic catch(final dynamic _) {
|
||||
}
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
// Unhandled errors:
|
||||
//
|
||||
// pkg/front_end/testcases/regress/issue_35151.dart:10:15: Error: A field can only be initialized in it's declaring class
|
||||
// Try moving the field initialization into the constructor body.
|
||||
// B() : super.a = 42;
|
||||
// ^
|
||||
|
||||
library;
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
class A extends core::Object {
|
||||
field core::int a = null;
|
||||
synthetic constructor •() → self::A
|
||||
: super core::Object::•()
|
||||
;
|
||||
}
|
||||
class B extends self::A {
|
||||
constructor •() → self::B
|
||||
: final dynamic #t1 = invalid-expression "pkg/front_end/testcases/regress/issue_35151.dart:10:15: Error: Not a valid initializer.
|
||||
To initialize a field, use the syntax 'name = value'.
|
||||
B() : super.a = 42;
|
||||
^"
|
||||
;
|
||||
}
|
||||
class C extends core::Object {
|
||||
constructor •() → self::C
|
||||
: final dynamic #t2 = invalid-expression "pkg/front_end/testcases/regress/issue_35151.dart:14:9: Error: Can't access 'super' in a field initializer.
|
||||
C() : super = 42;
|
||||
^^^^^"
|
||||
;
|
||||
}
|
||||
static method main() → dynamic {
|
||||
try {
|
||||
self::B b = new self::B::•();
|
||||
}
|
||||
on dynamic catch(final dynamic _) {
|
||||
}
|
||||
try {
|
||||
self::C c = new self::C::•();
|
||||
}
|
||||
on dynamic catch(final dynamic _) {
|
||||
}
|
||||
}
|
|
@ -246,30 +246,6 @@ String _resolveScriptUri(String scriptName) {
|
|||
return scriptUri.toString();
|
||||
}
|
||||
|
||||
// Embedder Entrypoint (gen_snapshot):
|
||||
// Resolve relative paths relative to working directory.
|
||||
@pragma("vm:entry-point")
|
||||
String _resolveInWorkingDirectory(String fileName) {
|
||||
if (!_setupCompleted) {
|
||||
_setupHooks();
|
||||
}
|
||||
if (_workingDirectory == null) {
|
||||
throw 'No current working directory set.';
|
||||
}
|
||||
var name = _sanitizeWindowsPath(fileName);
|
||||
|
||||
var uri = Uri.parse(name);
|
||||
if (uri.scheme != '') {
|
||||
throw 'Schemes are not supported when resolving filenames.';
|
||||
}
|
||||
uri = _workingDirectory.resolveUri(uri);
|
||||
|
||||
if (_traceLoading) {
|
||||
_log('Resolved in working directory: $fileName -> $uri');
|
||||
}
|
||||
return uri.toString();
|
||||
}
|
||||
|
||||
// Only used by vm/cc unit tests.
|
||||
Uri _resolvePackageUri(Uri uri) {
|
||||
assert(_packageRoot != null);
|
||||
|
@ -304,22 +280,6 @@ String _filePathFromUri(String userUri) {
|
|||
}
|
||||
}
|
||||
|
||||
// Embedder Entrypoint.
|
||||
@pragma("vm:entry-point")
|
||||
_libraryFilePath(String libraryUri) {
|
||||
if (!_setupCompleted) {
|
||||
_setupHooks();
|
||||
}
|
||||
int index = libraryUri.lastIndexOf('/');
|
||||
var path;
|
||||
if (index == -1) {
|
||||
path = './';
|
||||
} else {
|
||||
path = libraryUri.substring(0, index + 1);
|
||||
}
|
||||
return _filePathFromUri(path);
|
||||
}
|
||||
|
||||
// Register callbacks and hooks with the rest of the core libraries.
|
||||
@pragma("vm:entry-point")
|
||||
_setupHooks() {
|
||||
|
|
|
@ -35,7 +35,6 @@ namespace dart {
|
|||
namespace bin {
|
||||
|
||||
const char* DartUtils::original_working_directory = NULL;
|
||||
CommandLineOptions* DartUtils::url_mapping = NULL;
|
||||
const char* const DartUtils::kDartScheme = "dart:";
|
||||
const char* const DartUtils::kDartExtensionScheme = "dart-ext:";
|
||||
const char* const DartUtils::kAsyncLibURL = "dart:async";
|
||||
|
@ -69,23 +68,6 @@ static bool IsWindowsHost() {
|
|||
#endif // defined(HOST_OS_WINDOWS)
|
||||
}
|
||||
|
||||
const char* DartUtils::MapLibraryUrl(const char* url_string) {
|
||||
ASSERT(url_mapping != NULL);
|
||||
// We need to check if the passed in url is found in the url_mapping array,
|
||||
// in that case use the mapped entry.
|
||||
intptr_t len = strlen(url_string);
|
||||
for (intptr_t idx = 0; idx < url_mapping->count(); idx++) {
|
||||
const char* url_name = url_mapping->GetArgument(idx);
|
||||
if (!strncmp(url_string, url_name, len) && (url_name[len] == ',')) {
|
||||
const char* url_mapped_name = url_name + len + 1;
|
||||
if (strlen(url_mapped_name) != 0) {
|
||||
return url_mapped_name; // Found a mapping for this URL.
|
||||
}
|
||||
}
|
||||
}
|
||||
return NULL; // Did not find a mapping for this URL.
|
||||
}
|
||||
|
||||
int64_t DartUtils::GetIntegerValue(Dart_Handle value_obj) {
|
||||
int64_t value = 0;
|
||||
Dart_Handle result = Dart_IntegerToInt64(value_obj, &value);
|
||||
|
@ -394,23 +376,6 @@ Dart_Handle DartUtils::SetWorkingDirectory() {
|
|||
directory);
|
||||
}
|
||||
|
||||
Dart_Handle DartUtils::ResolveUriInWorkingDirectory(Dart_Handle script_uri) {
|
||||
const int kNumArgs = 1;
|
||||
Dart_Handle dart_args[kNumArgs];
|
||||
dart_args[0] = script_uri;
|
||||
return Dart_Invoke(DartUtils::LookupBuiltinLib(),
|
||||
NewString("_resolveInWorkingDirectory"), kNumArgs,
|
||||
dart_args);
|
||||
}
|
||||
|
||||
Dart_Handle DartUtils::LibraryFilePath(Dart_Handle library_uri) {
|
||||
const int kNumArgs = 1;
|
||||
Dart_Handle dart_args[kNumArgs];
|
||||
dart_args[0] = library_uri;
|
||||
return Dart_Invoke(DartUtils::LookupBuiltinLib(),
|
||||
NewString("_libraryFilePath"), kNumArgs, dart_args);
|
||||
}
|
||||
|
||||
Dart_Handle DartUtils::ResolveScript(Dart_Handle url) {
|
||||
const int kNumArgs = 1;
|
||||
Dart_Handle dart_args[kNumArgs];
|
||||
|
@ -792,17 +757,6 @@ bool DartUtils::SetOriginalWorkingDirectory() {
|
|||
return original_working_directory != nullptr;
|
||||
}
|
||||
|
||||
Dart_Handle DartUtils::GetCanonicalizableWorkingDirectory() {
|
||||
const char* str = DartUtils::original_working_directory;
|
||||
intptr_t len = strlen(str);
|
||||
if ((str[len] == '/') || (IsWindowsHost() && str[len] == '\\')) {
|
||||
return Dart_NewStringFromCString(str);
|
||||
}
|
||||
char* new_str = reinterpret_cast<char*>(Dart_ScopeAllocate(len + 2));
|
||||
snprintf(new_str, (len + 2), "%s%s", str, File::PathSeparator());
|
||||
return Dart_NewStringFromCString(new_str);
|
||||
}
|
||||
|
||||
void DartUtils::SetEnvironment(dart::SimpleHashMap* environment) {
|
||||
environment_ = environment;
|
||||
}
|
||||
|
|
|
@ -214,11 +214,7 @@ class DartUtils {
|
|||
}
|
||||
|
||||
static bool SetOriginalWorkingDirectory();
|
||||
static Dart_Handle GetCanonicalizableWorkingDirectory();
|
||||
|
||||
static const char* MapLibraryUrl(const char* url_string);
|
||||
|
||||
static Dart_Handle ResolveUriInWorkingDirectory(Dart_Handle script_uri);
|
||||
static Dart_Handle ResolveScript(Dart_Handle url);
|
||||
|
||||
enum MagicNumber {
|
||||
|
@ -239,9 +235,6 @@ class DartUtils {
|
|||
// Global state that stores the original working directory..
|
||||
static const char* original_working_directory;
|
||||
|
||||
// Global state that captures the URL mappings specified on the command line.
|
||||
static CommandLineOptions* url_mapping;
|
||||
|
||||
static const char* const kDartScheme;
|
||||
static const char* const kDartExtensionScheme;
|
||||
static const char* const kAsyncLibURL;
|
||||
|
@ -258,8 +251,6 @@ class DartUtils {
|
|||
static const char* const kHttpScheme;
|
||||
static const char* const kVMServiceLibURL;
|
||||
|
||||
static Dart_Handle LibraryFilePath(Dart_Handle library_uri);
|
||||
|
||||
static void SetEnvironment(dart::SimpleHashMap* environment);
|
||||
static Dart_Handle EnvironmentCallback(Dart_Handle name);
|
||||
|
||||
|
@ -585,61 +576,6 @@ class ScopedBlockingCall {
|
|||
DISALLOW_COPY_AND_ASSIGN(ScopedBlockingCall);
|
||||
};
|
||||
|
||||
// Where the argument to the constructor is the handle for an object
|
||||
// implementing List<int>, this class creates a scope in which the memory
|
||||
// backing the list can be accessed.
|
||||
//
|
||||
// Do not make Dart_ API calls while in a ScopedMemBuffer.
|
||||
// Do not call Dart_PropagateError while in a ScopedMemBuffer.
|
||||
class ScopedMemBuffer {
|
||||
public:
|
||||
explicit ScopedMemBuffer(Dart_Handle object) {
|
||||
if (!Dart_IsTypedData(object) && !Dart_IsList(object)) {
|
||||
Dart_ThrowException(
|
||||
DartUtils::NewDartArgumentError("Argument is not a List<int>"));
|
||||
}
|
||||
|
||||
uint8_t* bytes = NULL;
|
||||
intptr_t bytes_len = 0;
|
||||
bool is_typed_data = false;
|
||||
if (Dart_IsTypedData(object)) {
|
||||
is_typed_data = true;
|
||||
Dart_TypedData_Type typ;
|
||||
ThrowIfError(Dart_TypedDataAcquireData(
|
||||
object, &typ, reinterpret_cast<void**>(&bytes), &bytes_len));
|
||||
} else {
|
||||
ASSERT(Dart_IsList(object));
|
||||
ThrowIfError(Dart_ListLength(object, &bytes_len));
|
||||
bytes = Dart_ScopeAllocate(bytes_len);
|
||||
ASSERT(bytes != NULL);
|
||||
ThrowIfError(Dart_ListGetAsBytes(object, 0, bytes, bytes_len));
|
||||
}
|
||||
|
||||
object_ = object;
|
||||
bytes_ = bytes;
|
||||
bytes_len_ = bytes_len;
|
||||
is_typed_data_ = is_typed_data;
|
||||
}
|
||||
|
||||
~ScopedMemBuffer() {
|
||||
if (is_typed_data_) {
|
||||
ThrowIfError(Dart_TypedDataReleaseData(object_));
|
||||
}
|
||||
}
|
||||
|
||||
uint8_t* get() const { return bytes_; }
|
||||
intptr_t length() const { return bytes_len_; }
|
||||
|
||||
private:
|
||||
Dart_Handle object_;
|
||||
uint8_t* bytes_;
|
||||
intptr_t bytes_len_;
|
||||
bool is_typed_data_;
|
||||
|
||||
DISALLOW_ALLOCATION();
|
||||
DISALLOW_COPY_AND_ASSIGN(ScopedMemBuffer);
|
||||
};
|
||||
|
||||
struct MagicNumberData {
|
||||
static const intptr_t kMaxLength = 8;
|
||||
|
||||
|
|
|
@ -147,14 +147,6 @@ BOOL_OPTIONS_LIST(BOOL_OPTION_DEFINITION)
|
|||
#undef BOOL_OPTION_DEFINITION
|
||||
|
||||
DEFINE_ENUM_OPTION(snapshot_kind, SnapshotKind, snapshot_kind);
|
||||
DEFINE_STRING_OPTION_CB(embedder_entry_points_manifest, {
|
||||
Log::PrintErr(
|
||||
"Option --embedder_entry_points_manifest is no longer supported."
|
||||
" Use @pragma(\'vm:entry-point\') instead.\n");
|
||||
exit(kErrorExitCode);
|
||||
});
|
||||
DEFINE_STRING_OPTION_CB(url_mapping,
|
||||
{ DartUtils::url_mapping->AddArgument(value); });
|
||||
DEFINE_CB_OPTION(ProcessEnvironmentOption);
|
||||
|
||||
static bool IsSnapshottingForPrecompilation() {
|
||||
|
@ -173,9 +165,6 @@ static void PrintUsage() {
|
|||
" Where to find packages, that is, package:... imports. \n"
|
||||
"--packages=<packages_file> \n"
|
||||
" Where to find a package spec file \n"
|
||||
"--url_mapping=<mapping> \n"
|
||||
" Uses the URL mapping(s) specified on the command line to load the \n"
|
||||
" libraries. \n"
|
||||
"--dependencies=<output-file> \n"
|
||||
" Generates a Makefile with snapshot output files as targets and all \n"
|
||||
" transitive imports as sources. \n"
|
||||
|
@ -940,10 +929,6 @@ int main(int argc, char** argv) {
|
|||
const int EXTRA_VM_ARGUMENTS = 7;
|
||||
CommandLineOptions vm_options(argc + EXTRA_VM_ARGUMENTS);
|
||||
|
||||
// Initialize the URL mapping array.
|
||||
CommandLineOptions cmdline_url_mapping(argc);
|
||||
DartUtils::url_mapping = &cmdline_url_mapping;
|
||||
|
||||
// When running from the command line we assume that we are optimizing for
|
||||
// throughput, and therefore use a larger new gen semi space size and a faster
|
||||
// new gen growth factor unless others have been specified.
|
||||
|
|
|
@ -61,7 +61,7 @@ var udpTests = <IsolateTest>[
|
|||
expect(server['port'], greaterThanOrEqualTo(1024));
|
||||
final now = DateTime.now().millisecondsSinceEpoch;
|
||||
expect(
|
||||
server['lastRead'], closeTo(now, Duration(seconds: 5).inMilliseconds));
|
||||
server['lastRead'], closeTo(now, Duration(seconds: 10).inMilliseconds));
|
||||
expect(server['totalRead'], equals(6));
|
||||
expect(server['lastWrite'], equals(0));
|
||||
expect(server['totalWritten'], equals(0));
|
||||
|
|
|
@ -54,11 +54,6 @@ def BuildOptions():
|
|||
result.add_option("--packages",
|
||||
action="store", type="string",
|
||||
help="package config file used to reasolve package: imports.")
|
||||
result.add_option("--url_mapping",
|
||||
default=[],
|
||||
action="append",
|
||||
help=("mapping from url to file name, used when generating snapshots " +
|
||||
"E.g.: --url_mapping=fileUri,/path/to/file.dart"))
|
||||
result.add_option("-v", "--verbose",
|
||||
help='Verbose output.',
|
||||
default=False, action="store_true")
|
||||
|
@ -143,11 +138,6 @@ def Main():
|
|||
script_args.append(''.join([ "--isolate_snapshot_instructions=",
|
||||
options.isolate_instructions_output_bin ]))
|
||||
|
||||
# Next setup all url mapping options specified.
|
||||
for url_arg in options.url_mapping:
|
||||
url_mapping_argument = ''.join(["--url_mapping=", url_arg ])
|
||||
script_args.append(url_mapping_argument)
|
||||
|
||||
# Finally append the script name if one is specified.
|
||||
if options.script:
|
||||
script_args.append(options.script)
|
||||
|
|
|
@ -57,6 +57,7 @@ where
|
|||
jit-[opt-][debug-]dbc = Dart JIT (simdbc)
|
||||
jit-[opt-][debug-]dbc64 = Dart JIT (simdbc64)
|
||||
aot-[debug-]x64 = Dart AOT (x64)
|
||||
aot-[debug-]arm32 = Dart AOT (simarm)
|
||||
aot-[debug-]arm64 = Dart AOT (simarm64)
|
||||
kbc-int-[debug-]x64 = Dart KBC (interpreted bytecode)
|
||||
kbc-mix-[debug-]x64 = Dart KBC (mixed-mode bytecode)
|
||||
|
|
|
@ -38,7 +38,7 @@ TestResult runCommand(List<String> cmd, Map<String, String> env) {
|
|||
if (res.exitCode == -sigkill) {
|
||||
return new TestResult(ResultCode.timeout, res.stdout);
|
||||
} else if (res.exitCode != 0) {
|
||||
return new TestResult(ResultCode.error, res.stdout);
|
||||
return new TestResult(ResultCode.error, res.stderr);
|
||||
}
|
||||
return new TestResult(ResultCode.success, res.stdout);
|
||||
}
|
||||
|
@ -336,8 +336,20 @@ class DartFuzzTest {
|
|||
numDivergences++;
|
||||
print(
|
||||
'\n${isolate}: !DIVERGENCE! $version:$seed (output=${outputDivergence})');
|
||||
if (showStats && outputDivergence) {
|
||||
print('out1:\n${result1.output}\nout2:\n${result2.output}\n');
|
||||
if (outputDivergence) {
|
||||
// Only report the actual output divergence details when requested,
|
||||
// since this output may be lengthy and should be reproducable anyway.
|
||||
if (showStats) {
|
||||
print('\nout1:\n${result1.output}\nout2:\n${result2.output}\n');
|
||||
}
|
||||
} else {
|
||||
// For any other divergence, always report what went wrong.
|
||||
if (result1.code != ResultCode.success) {
|
||||
print('\nfail1:\n${result1.output}\n');
|
||||
}
|
||||
if (result2.code != ResultCode.success) {
|
||||
print('\nfail2:\n${result2.output}\n');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -452,7 +464,7 @@ class DartFuzzTestSession {
|
|||
// Random when not set.
|
||||
if (mode == null || mode == '') {
|
||||
// Pick a mode at random (cluster), different from other.
|
||||
int cluster_modes = modes.length - 15;
|
||||
int cluster_modes = modes.indexOf('aot-debug-arm32');
|
||||
Random rand = new Random();
|
||||
do {
|
||||
mode = modes[rand.nextInt(cluster_modes)];
|
||||
|
@ -502,7 +514,9 @@ class DartFuzzTestSession {
|
|||
'kbc-cmp-x64',
|
||||
'kbc-mix-x64',
|
||||
// Times out often:
|
||||
'aot-debug-arm32',
|
||||
'aot-debug-arm64',
|
||||
'aot-arm32',
|
||||
'aot-arm64',
|
||||
// Too many divergences (due to arithmetic):
|
||||
'js',
|
||||
|
@ -519,6 +533,9 @@ class DartFuzzTestSession {
|
|||
'jit-opt-arm64',
|
||||
'jit-opt-dbc',
|
||||
'jit-opt-dbc64',
|
||||
// Not supported:
|
||||
'aot-debug-ia32',
|
||||
'aot-ia32',
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
@ -117,10 +117,6 @@ class InterpreterHelpers {
|
|||
: static_cast<intptr_t>(kSmiCid);
|
||||
}
|
||||
|
||||
DART_FORCE_INLINE static void IncrementUsageCounter(RawFunction* f) {
|
||||
f->ptr()->usage_counter_++;
|
||||
}
|
||||
|
||||
DART_FORCE_INLINE static void IncrementICUsageCount(RawObject** entries,
|
||||
intptr_t offset,
|
||||
intptr_t args_tested) {
|
||||
|
@ -2123,8 +2119,6 @@ SwitchDispatch:
|
|||
RawObject** call_top = SP + 1;
|
||||
|
||||
RawICData* icdata = RAW_CAST(ICData, LOAD_CONSTANT(kidx));
|
||||
InterpreterHelpers::IncrementUsageCounter(
|
||||
RAW_CAST(Function, icdata->ptr()->owner_));
|
||||
if (ICData::NumArgsTestedBits::decode(icdata->ptr()->state_bits_) == 1) {
|
||||
if (!InstanceCall1(thread, icdata, call_base, call_top, &pc, &FP, &SP,
|
||||
false /* optimized */)) {
|
||||
|
|
|
@ -150,7 +150,7 @@ a parameter:
|
|||
"jsonrpc": "2.0",
|
||||
"method": "streamListen",
|
||||
"params": {
|
||||
"streamId": "GC",
|
||||
"streamId": "GC"
|
||||
},
|
||||
"id": "2"
|
||||
}
|
||||
|
|
|
@ -150,7 +150,7 @@ a parameter:
|
|||
"jsonrpc": "2.0",
|
||||
"method": "streamListen",
|
||||
"params": {
|
||||
"streamId": "GC",
|
||||
"streamId": "GC"
|
||||
},
|
||||
"id": "2"
|
||||
}
|
||||
|
|
|
@ -115,10 +115,6 @@ class SimulatorHelpers {
|
|||
: static_cast<intptr_t>(kSmiCid);
|
||||
}
|
||||
|
||||
DART_FORCE_INLINE static void IncrementUsageCounter(RawFunction* f) {
|
||||
f->ptr()->usage_counter_++;
|
||||
}
|
||||
|
||||
DART_FORCE_INLINE static void IncrementICUsageCount(RawObject** entries,
|
||||
intptr_t offset,
|
||||
intptr_t args_tested) {
|
||||
|
@ -1703,8 +1699,6 @@ SwitchDispatch:
|
|||
RawObject** call_top = SP + 1;
|
||||
|
||||
RawICData* icdata = RAW_CAST(ICData, LOAD_CONSTANT(kidx));
|
||||
SimulatorHelpers::IncrementUsageCounter(
|
||||
RAW_CAST(Function, icdata->ptr()->owner_));
|
||||
InstanceCall1(thread, icdata, call_base, call_top, &pc, &FP, &SP,
|
||||
false /* optimized */);
|
||||
}
|
||||
|
@ -1728,8 +1722,6 @@ SwitchDispatch:
|
|||
RawObject** call_top = SP + 1;
|
||||
|
||||
RawICData* icdata = RAW_CAST(ICData, LOAD_CONSTANT(kidx));
|
||||
SimulatorHelpers::IncrementUsageCounter(
|
||||
RAW_CAST(Function, icdata->ptr()->owner_));
|
||||
InstanceCall2(thread, icdata, call_base, call_top, &pc, &FP, &SP,
|
||||
false /* optimized */);
|
||||
}
|
||||
|
@ -1748,7 +1740,6 @@ SwitchDispatch:
|
|||
RawObject** call_top = SP + 1;
|
||||
|
||||
RawICData* icdata = RAW_CAST(ICData, LOAD_CONSTANT(kidx));
|
||||
SimulatorHelpers::IncrementUsageCounter(FrameFunction(FP));
|
||||
InstanceCall1(thread, icdata, call_base, call_top, &pc, &FP, &SP,
|
||||
true /* optimized */);
|
||||
}
|
||||
|
@ -1767,7 +1758,6 @@ SwitchDispatch:
|
|||
RawObject** call_top = SP + 1;
|
||||
|
||||
RawICData* icdata = RAW_CAST(ICData, LOAD_CONSTANT(kidx));
|
||||
SimulatorHelpers::IncrementUsageCounter(FrameFunction(FP));
|
||||
InstanceCall2(thread, icdata, call_base, call_top, &pc, &FP, &SP,
|
||||
true /* optimized */);
|
||||
}
|
||||
|
|
|
@ -75,7 +75,9 @@ void V8SnapshotProfileWriter::AttributeReferenceTo(ObjectId object_id,
|
|||
|
||||
ASSERT(reference.offset_or_name >= 0);
|
||||
info->edges->Add({
|
||||
reference.reference_type == Reference::kElement ? kElement : kProperty,
|
||||
static_cast<intptr_t>(reference.reference_type == Reference::kElement
|
||||
? kElement
|
||||
: kProperty),
|
||||
reference.offset_or_name,
|
||||
reference.to_object_id,
|
||||
});
|
||||
|
|
|
@ -342,6 +342,7 @@
|
|||
},
|
||||
"isolate": {
|
||||
"patches": "../../pkg/dev_compiler/tool/input_sdk/patch/isolate_patch.dart",
|
||||
"supported": false,
|
||||
"uri": "isolate/isolate.dart"
|
||||
},
|
||||
"web_gl": {
|
||||
|
|
|
@ -411,6 +411,7 @@ dartdevc:
|
|||
isolate:
|
||||
uri: "isolate/isolate.dart"
|
||||
patches: "../../pkg/dev_compiler/tool/input_sdk/patch/isolate_patch.dart"
|
||||
supported: false
|
||||
|
||||
mirrors:
|
||||
uri: "mirrors/mirrors.dart"
|
||||
|
|
|
@ -1,376 +0,0 @@
|
|||
// Copyright (c) 2018, 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.
|
||||
|
||||
// Test that `await for` and `async*` interact correctly.
|
||||
|
||||
// An `await for` must pause its subscription immediately
|
||||
// if the `await for` body does anything asynchronous
|
||||
// (any `await`, `await for`, or pausing at a `yield`/`yield*`)
|
||||
// A pause happening synchronously in an event delivery
|
||||
// must pause the `sync*` method at the `yield` sending the event.
|
||||
// A break happening synchronously in an event delivery,
|
||||
// or while paused at a `yield`, must exit at that `yield`.
|
||||
|
||||
import "dart:async";
|
||||
import "package:expect/expect.dart";
|
||||
import "package:async_helper/async_helper.dart";
|
||||
|
||||
Stream<int> stream(List<String> log) async* {
|
||||
log.add("^");
|
||||
try {
|
||||
log.add("?1");
|
||||
yield 1;
|
||||
log.add("?2");
|
||||
yield 2;
|
||||
log.add("?3");
|
||||
yield 3;
|
||||
} finally {
|
||||
log.add(r"$");
|
||||
}
|
||||
}
|
||||
|
||||
Stream<int> consume(List<String> log,
|
||||
{int breakAt = -1,
|
||||
int yieldAt = -1,
|
||||
int yieldStarAt = -1,
|
||||
int pauseAt = -1}) async* {
|
||||
// Create stream.
|
||||
var s = stream(log);
|
||||
log.add("(");
|
||||
// The "consume loop".
|
||||
await for (var event in s) {
|
||||
// Should be acting synchronously wrt. the delivery of the event.
|
||||
// The source stream should be at the yield now.
|
||||
log.add("!$event");
|
||||
if (event == pauseAt) {
|
||||
log.add("p$event[");
|
||||
// Async operation causes subscription to pause.
|
||||
// Nothing should happen in the source stream
|
||||
// until the end of the loop body where the subscription is resumed.
|
||||
await Future.delayed(Duration(microseconds: 1));
|
||||
log.add("]");
|
||||
}
|
||||
if (event == yieldAt) {
|
||||
log.add("y$event[");
|
||||
// Yield may cause subscription to pause or cancel.
|
||||
// This loop should stay at the yield until the event has been delieverd.
|
||||
// If the receiver pauses or cancels, we delay or break the loop here.
|
||||
yield event;
|
||||
log.add("]");
|
||||
}
|
||||
if (event == yieldStarAt) {
|
||||
log.add("Y$event[");
|
||||
// Yield* will always cause the subscription for this loop to pause.
|
||||
// If the listener pauses, this stream is paused. If the listener cancels,
|
||||
// this stream is cancelled, and the yield* acts like return, cancelling
|
||||
// the loop subscription and waiting for the cancel future.
|
||||
yield* Stream<int>.fromIterable([event]);
|
||||
log.add("]");
|
||||
}
|
||||
if (event == breakAt) {
|
||||
log.add("b$event");
|
||||
// Breaks the loop. This cancels the loop subscription and waits for the
|
||||
// cancel future.
|
||||
break;
|
||||
}
|
||||
}
|
||||
// Done event from stream or cancel future has completed.
|
||||
log.add(")");
|
||||
}
|
||||
|
||||
main() async {
|
||||
asyncStart();
|
||||
|
||||
// Just run the loop over the stream. The consume stream emits no events.
|
||||
{
|
||||
var log = <String>[];
|
||||
await for (var _ in consume(log)) {
|
||||
throw "unreachable";
|
||||
}
|
||||
await Future.delayed(Duration(milliseconds: 1));
|
||||
var trace = log.join("");
|
||||
Expects.equals(r"(^?1!1?2!2?3!3$)", trace, "straight through");
|
||||
}
|
||||
|
||||
// Pause at 1, then resume.
|
||||
// Consume loop forces a pause when it receives the 1 event.
|
||||
// Nothing should happen until that pause is resumed.
|
||||
{
|
||||
var log = <String>[];
|
||||
await for (var _ in consume(log, pauseAt: 1)) {
|
||||
throw "unreachable";
|
||||
}
|
||||
await Future.delayed(Duration(milliseconds: 10));
|
||||
var trace = log.join("");
|
||||
String message = "pause at 1";
|
||||
if (trace.contains("p1[?2")) {
|
||||
message += " (did not pause in time)";
|
||||
}
|
||||
Expects.equals(r"(^?1!1p1[]?2!2?3!3$)", trace, message);
|
||||
}
|
||||
|
||||
// Break at 1.
|
||||
// Consume loop breaks after receiving the 1 event.
|
||||
// The consume stream emits no events.
|
||||
{
|
||||
var log = <String>[];
|
||||
await for (var _ in consume(log, breakAt: 1)) {
|
||||
throw "unreachable";
|
||||
}
|
||||
await Future.delayed(Duration(milliseconds: 10));
|
||||
var trace = log.join("");
|
||||
String message = "break at 1";
|
||||
if (trace.contains("b1?2")) {
|
||||
message += " (did not cancel in time)";
|
||||
}
|
||||
Expects.equals(r"(^?1!1b1$)", trace, message);
|
||||
}
|
||||
|
||||
// Pause then break at 1.
|
||||
// Consume loop pauses after receiving the 1 event,
|
||||
// then breaks before resuming. It should still be at the yield.
|
||||
// The consume stream emits no events.
|
||||
{
|
||||
var log = <String>[];
|
||||
await for (var _ in consume(log, pauseAt: 1, breakAt: 1)) {
|
||||
throw "unreachable";
|
||||
}
|
||||
await Future.delayed(Duration(milliseconds: 10));
|
||||
var trace = log.join("");
|
||||
String message = "pause then break at 1";
|
||||
if (trace.contains("p1[?2")) {
|
||||
message += " (did not pause in time)";
|
||||
}
|
||||
if (trace.contains("b1?2")) {
|
||||
message += " (did not cancel in time)";
|
||||
}
|
||||
Expects.equals(r"(^?1!1p1[]b1$)", trace, message);
|
||||
}
|
||||
|
||||
// Yield at 1.
|
||||
// The consume loop re-emits the 1 event.
|
||||
// The test loop should receive that event while the consume loop is still
|
||||
// at the yield statement.
|
||||
// The consume loop may or may not pause, it should make no difference.
|
||||
{
|
||||
var log = <String>[];
|
||||
await for (var s in consume(log, yieldAt: 1)) {
|
||||
log.add("e$s");
|
||||
}
|
||||
await Future.delayed(Duration(milliseconds: 10));
|
||||
var trace = log.join("");
|
||||
String message = "yield at 1";
|
||||
if (trace.contains("y1[?2")) {
|
||||
message += " (did not wait for delivery)";
|
||||
}
|
||||
Expects.equals(r"(^?1!1y1[e1]?2!2?3!3$)", trace, message);
|
||||
}
|
||||
|
||||
// Yield at 1, then pause at yield.
|
||||
// The consume loop re-emits the 1 event.
|
||||
// The test loop should receive that event while the consume loop is still
|
||||
// at the yield statement.
|
||||
// The test loop then pauses.
|
||||
// Nothing should happen in either the original yield
|
||||
// or the consume-function yield until the test loop ends.
|
||||
{
|
||||
var log = <String>[];
|
||||
await for (var s in consume(log, yieldAt: 1)) {
|
||||
log.add("e$s<");
|
||||
// Force pause at yield.
|
||||
await Future.delayed(Duration(milliseconds: 1));
|
||||
log.add(">");
|
||||
}
|
||||
await Future.delayed(Duration(milliseconds: 10));
|
||||
var trace = log.join("");
|
||||
String message = "yield at 1, pause at yield";
|
||||
if (trace.contains("y1[?2")) {
|
||||
message += " (did not wait for delivery)";
|
||||
}
|
||||
if (trace.contains("e1<?2")) {
|
||||
message += " (did not pause in time)";
|
||||
}
|
||||
Expects.equals(r"(^?1!1y1[e1<>]?2!2?3!3$)", trace, message);
|
||||
}
|
||||
|
||||
// Yield at 1, then break at yield.
|
||||
// The consume loop re-emits the 1 event.
|
||||
// The test loop should receive that event while the consume loop is still
|
||||
// at the yield statement.
|
||||
// The test loop then breaks. That makes the consume loop yield return,
|
||||
// breaking the consume loop, which makes the source yield return.
|
||||
{
|
||||
var log = <String>[];
|
||||
await for (var s in consume(log, yieldAt: 1)) {
|
||||
log.add("e${s}B$s");
|
||||
break; // Force break at yield*.
|
||||
}
|
||||
await Future.delayed(Duration(milliseconds: 10));
|
||||
var trace = log.join("");
|
||||
String message = "yield at 1, break at yield";
|
||||
if (trace.contains("y1[?2")) {
|
||||
message += " (did not wait for delivery)";
|
||||
}
|
||||
if (trace.contains("B1?2")) {
|
||||
message += " (did not break in time)";
|
||||
}
|
||||
Expects.equals(r"(^?1!1y1[e1B1$)", trace, message);
|
||||
}
|
||||
|
||||
// Yield* at 1.
|
||||
// The consume loop re-emits a stream containing the 1 event.
|
||||
// The test loop should receive that event before the consume loop
|
||||
// continues from the `yield*`, which again happens before the source
|
||||
// stream continues from its `yield`.
|
||||
{
|
||||
var log = <String>[];
|
||||
await for (var s in consume(log, yieldStarAt: 1)) {
|
||||
log.add("e$s");
|
||||
}
|
||||
await Future.delayed(Duration(milliseconds: 10));
|
||||
var trace = log.join("");
|
||||
String message = "yield* at 1";
|
||||
if (trace.contains("Y1[?2")) {
|
||||
message += " (did not wait for delivery)";
|
||||
}
|
||||
Expects.equals(r"(^?1!1Y1[e1]?2!2?3!3$)", trace, message);
|
||||
}
|
||||
|
||||
// Yield* at 1, pause at yield.
|
||||
// The consume loop re-emits a stream containing the 1 event.
|
||||
// The test loop should receive that event before the consume loop
|
||||
// continues from the `yield*`. The test loop then force a pause.
|
||||
// Nothing further should happen during that pause.
|
||||
{
|
||||
var log = <String>[];
|
||||
await for (var s in consume(log, yieldStarAt: 1)) {
|
||||
log.add("e$s<");
|
||||
await Future.delayed(Duration(milliseconds: 1)); // force pause.
|
||||
log.add(">");
|
||||
}
|
||||
await Future.delayed(Duration(milliseconds: 10));
|
||||
var trace = log.join("");
|
||||
String message = "yield* then pause at 1";
|
||||
if (trace.contains("Y1[?2")) {
|
||||
message += " (did not wait for delivery)";
|
||||
}
|
||||
if (trace.contains("e1<?2")) {
|
||||
message += " (did not pause in time)";
|
||||
}
|
||||
Expects.equals(r"(^?1!1Y1[e1<>]?2!2?3!3$)", trace, message);
|
||||
}
|
||||
|
||||
// Yield* at 1, then break at 1.
|
||||
// The consume loop re-emits a stream containing the 1 event.
|
||||
// The test loop should receive that event before the consume loop
|
||||
// continues from the `yield*`.
|
||||
// When the consume loop continues, it breaks,
|
||||
// forcing the waiting source yield to return.
|
||||
{
|
||||
var log = <String>[];
|
||||
await for (var s in consume(log, yieldStarAt: 1, breakAt: 1)) {
|
||||
log.add("e$s");
|
||||
}
|
||||
await Future.delayed(Duration(milliseconds: 10));
|
||||
var trace = log.join("");
|
||||
String message = "yield* then pause at 1";
|
||||
if (trace.contains("Y1[?2")) {
|
||||
message += " (did not wait for delivery)";
|
||||
}
|
||||
Expects.equals(r"(^?1!1Y1[e1]b1$)", trace, message);
|
||||
}
|
||||
|
||||
// Yield* at 1, pause at yield, then break at 1.
|
||||
// The consume loop re-emits a stream containing the 1 event.
|
||||
// The test loop should receive that event before the consume loop
|
||||
// continues from the `yield*`. After the `yield*`, the consume loop breaks.
|
||||
// This forces the waiting source yield to return.
|
||||
{
|
||||
var log = <String>[];
|
||||
await for (var s in consume(log, yieldStarAt: 1, breakAt: 1)) {
|
||||
log.add("e$s<");
|
||||
await Future.delayed(Duration(milliseconds: 1)); // force pause.
|
||||
log.add(">");
|
||||
}
|
||||
await Future.delayed(Duration(milliseconds: 10));
|
||||
var trace = log.join("");
|
||||
String message = "yield* then pause at 1";
|
||||
Expects.equals(r"(^?1!1Y1[e1<>]b1$)", trace, message);
|
||||
}
|
||||
|
||||
// Yield* at 1, break at yield.
|
||||
// The consume loop re-emits a stream containing the 1 event.
|
||||
// The test loop should receive that event before the consume loop
|
||||
// continues from the `yield*`. The test loop then breaks,
|
||||
// forcing the two waiting yields to return.
|
||||
{
|
||||
var log = <String>[];
|
||||
await for (var s in consume(log, yieldStarAt: 1)) {
|
||||
log.add("e${s}B$s");
|
||||
break;
|
||||
}
|
||||
await Future.delayed(Duration(milliseconds: 10));
|
||||
var trace = log.join("");
|
||||
String message = "yield* then break at 1";
|
||||
if (trace.contains("Y1[?2")) {
|
||||
message += " (did not deliver event in time)";
|
||||
}
|
||||
if (trace.contains("e1?2")) {
|
||||
message += " (did not cancel in time)";
|
||||
}
|
||||
Expects.equals(r"(^?1!1Y1[e1B1$)", trace, message);
|
||||
}
|
||||
|
||||
// Yield* at 1, pause at yield, then break at yield.
|
||||
// The consume loop re-emits a stream containing the 1 event.
|
||||
// The test loop should receive that event before the consume loop
|
||||
// continues from the `yield*`. The test loop then forces a pause,
|
||||
// and then breaks before that pause is resumed.
|
||||
// This forces the two waiting yields to return.
|
||||
{
|
||||
var log = <String>[];
|
||||
await for (var s in consume(log, yieldStarAt: 1)) {
|
||||
log.add("e$s<");
|
||||
await Future.delayed(Duration(milliseconds: 1)); // force pause.
|
||||
log.add(">B$s");
|
||||
break; // And break.
|
||||
}
|
||||
await Future.delayed(Duration(milliseconds: 10));
|
||||
var trace = log.join("");
|
||||
String message = "yield* then pause then break at 1";
|
||||
Expects.equals(r"(^?1!1Y1[e1<>B1$)", trace, message);
|
||||
}
|
||||
|
||||
Expects.summarize();
|
||||
asyncEnd();
|
||||
}
|
||||
|
||||
class Expects {
|
||||
static var _errors = [];
|
||||
static int _tests = 0;
|
||||
static void summarize() {
|
||||
if (_errors.isNotEmpty) {
|
||||
var buffer = StringBuffer();
|
||||
for (var es in _errors) {
|
||||
buffer.writeln("FAILURE:");
|
||||
buffer.writeln(es[0]); // error
|
||||
buffer.writeln(es[1]); // stack trace
|
||||
}
|
||||
;
|
||||
buffer.writeln("Expectations failed: ${_errors.length}"
|
||||
", succeeded: ${_tests - _errors.length}");
|
||||
throw ExpectException(buffer.toString());
|
||||
}
|
||||
}
|
||||
|
||||
static void equals(o1, o2, String message) {
|
||||
_tests++;
|
||||
try {
|
||||
Expect.equals(o1, o2, message);
|
||||
} on ExpectException catch (e) {
|
||||
var stack = StackTrace.current;
|
||||
_errors.add([e, stack]);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,46 +0,0 @@
|
|||
// Copyright (c) 2018, 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.
|
||||
|
||||
// Test that stream cancellation is checked immediately after delivering the
|
||||
// event, and before continuing after the yield.
|
||||
|
||||
import "dart:async";
|
||||
import "package:expect/expect.dart";
|
||||
import "package:async_helper/async_helper.dart";
|
||||
|
||||
main() async {
|
||||
asyncStart();
|
||||
var log = [];
|
||||
Stream<int> f() async* {
|
||||
try {
|
||||
log.add("-1");
|
||||
yield 1;
|
||||
log.add("-2");
|
||||
yield 2;
|
||||
} finally {
|
||||
log.add("x");
|
||||
}
|
||||
}
|
||||
|
||||
var completer = Completer();
|
||||
var s;
|
||||
s = f().listen((e) {
|
||||
log.add("+$e");
|
||||
// The `cancel` operation makes all `yield` operations act as returns.
|
||||
// It should make the `finally` block in `f` log an "x",
|
||||
// and nothing else.
|
||||
completer.complete(s.cancel());
|
||||
}, onError: (e) {
|
||||
// Should never be reached, but if it does, we'll make the await
|
||||
// below terminate.
|
||||
completer.complete(new Future.sync(() {
|
||||
Expect.fail("$e");
|
||||
}));
|
||||
}, onDone: () {
|
||||
completer.complete(null);
|
||||
});
|
||||
await completer.future;
|
||||
Expect.listEquals(["-1", "+1", "x"], log, "cancel");
|
||||
asyncEnd();
|
||||
}
|
|
@ -1,35 +0,0 @@
|
|||
// Copyright (c) 2018, 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.
|
||||
|
||||
// Test that various invalid uses of `yield` are disallowed.
|
||||
|
||||
import "dart:async";
|
||||
import "package:expect/expect.dart";
|
||||
import "package:async_helper/async_helper.dart";
|
||||
|
||||
var yield = 42;
|
||||
|
||||
main() async {
|
||||
asyncStart();
|
||||
Stream<String> f() async* {
|
||||
// Invalid syntax.
|
||||
yield ("a", "b"); //# 01: compile-time error
|
||||
yield yield "twice"; //# 02: compile-time error
|
||||
|
||||
// Valid but curious syntax.
|
||||
yield throw "throw"; //# 03: runtime error
|
||||
|
||||
// Type error.
|
||||
yield* "one"; //# 04: compile-time error
|
||||
|
||||
label: yield "ok";
|
||||
}
|
||||
var completer = Completer();
|
||||
f().listen(completer.complete, onError: completer.completeError,
|
||||
onDone: () {
|
||||
if (!completer.isCompleted) completer.completeError("not ok?");
|
||||
});
|
||||
Expect.equals("ok", await completer.future);
|
||||
asyncEnd();
|
||||
}
|
|
@ -1,195 +0,0 @@
|
|||
// Copyright (c) 2018, 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.
|
||||
|
||||
import "dart:async";
|
||||
import "package:expect/expect.dart";
|
||||
import "package:async_helper/async_helper.dart";
|
||||
|
||||
main() async {
|
||||
asyncStart();
|
||||
// Normal operations.
|
||||
{
|
||||
Stream<int> f() async* {
|
||||
yield 1;
|
||||
yield 2;
|
||||
yield 3;
|
||||
}
|
||||
|
||||
Expect.listEquals([1, 2, 3], await f().toList(), "basic1");
|
||||
}
|
||||
|
||||
{
|
||||
Stream<int> f() async* {
|
||||
yield 1;
|
||||
yield 2;
|
||||
yield 3;
|
||||
}
|
||||
|
||||
var log = [];
|
||||
var completer = Completer();
|
||||
f().listen(log.add,
|
||||
onError: (e) {
|
||||
// Shouldn't be reached.
|
||||
completer.complete(new Future.sync(() {
|
||||
Expect.fail("$e");
|
||||
}));
|
||||
},
|
||||
onDone: () => completer.complete(null));
|
||||
await completer.future;
|
||||
Expect.listEquals([1, 2, 3], log, "basic2");
|
||||
}
|
||||
|
||||
{
|
||||
var log = [];
|
||||
Stream<int> f() async* {
|
||||
log.add("-1");
|
||||
yield 1;
|
||||
log.add("-2");
|
||||
yield 2;
|
||||
}
|
||||
|
||||
await f().forEach((e) {
|
||||
log.add("+$e");
|
||||
});
|
||||
Expect.listEquals(["-1", "+1", "-2", "+2"], log, "basic3");
|
||||
}
|
||||
|
||||
{
|
||||
var log = [];
|
||||
Stream<int> f() async* {
|
||||
log.add("-1");
|
||||
yield 1;
|
||||
log.add("-2");
|
||||
yield 2;
|
||||
}
|
||||
|
||||
await for (var e in f()) {
|
||||
log.add("+$e");
|
||||
}
|
||||
Expect.listEquals(["-1", "+1", "-2", "+2"], log, "basic4");
|
||||
}
|
||||
|
||||
// async
|
||||
{
|
||||
Stream<int> f() async* {
|
||||
yield 1;
|
||||
await Future(() {});
|
||||
yield 2;
|
||||
await Future(() {});
|
||||
yield 3;
|
||||
}
|
||||
|
||||
Expect.listEquals([1, 2, 3], await f().toList(), "async");
|
||||
}
|
||||
|
||||
// Yield*
|
||||
{
|
||||
Stream<int> f(n) async* {
|
||||
yield n;
|
||||
if (n == 0) return;
|
||||
yield* f(n - 1);
|
||||
yield n;
|
||||
}
|
||||
|
||||
Expect.listEquals([3, 2, 1, 0, 1, 2, 3], await f(3).toList(), "yield*");
|
||||
}
|
||||
|
||||
// Errors
|
||||
{
|
||||
var log = [];
|
||||
Stream<int> f() async* {
|
||||
yield 1;
|
||||
throw "error";
|
||||
}
|
||||
|
||||
await f().handleError((e) {
|
||||
log.add(e);
|
||||
}).forEach(log.add);
|
||||
Expect.listEquals([1, "error"], log, "error");
|
||||
}
|
||||
|
||||
{
|
||||
var log = [];
|
||||
Stream<int> f() async* {
|
||||
yield 1;
|
||||
yield* Future<int>.error("error").asStream(); // Emits error as error.
|
||||
yield 3;
|
||||
}
|
||||
|
||||
await f().handleError((e) {
|
||||
log.add(e);
|
||||
}).forEach(log.add);
|
||||
Expect.listEquals([1, "error", 3], log, "error2");
|
||||
}
|
||||
|
||||
// Pause is checked after delivering event.
|
||||
{
|
||||
var log = [];
|
||||
Stream<int> f() async* {
|
||||
log.add("-1");
|
||||
yield 1;
|
||||
log.add("-2");
|
||||
yield 2;
|
||||
}
|
||||
|
||||
var completer = Completer();
|
||||
var s;
|
||||
s = f().listen((e) {
|
||||
log.add("+$e");
|
||||
s.pause(Future(() {}));
|
||||
log.add("++$e");
|
||||
}, onError: (e) {
|
||||
completer.complete(new Future.sync(() {
|
||||
Expect.fail("$e");
|
||||
}));
|
||||
}, onDone: () => completer.complete(null));
|
||||
await completer.future;
|
||||
Expect.listEquals(["-1", "+1", "++1", "-2", "+2", "++2"], log, "pause");
|
||||
}
|
||||
|
||||
// Await for-loop pauses between events.
|
||||
{
|
||||
var log = [];
|
||||
Stream<int> f() async* {
|
||||
log.add("-1");
|
||||
yield 1;
|
||||
log.add("-2");
|
||||
yield 2;
|
||||
}
|
||||
|
||||
await for (var e in f()) {
|
||||
log.add("+$e");
|
||||
await Future(() {}); // One timer tick.
|
||||
log.add("++$e");
|
||||
}
|
||||
Expect.listEquals(["-1", "+1", "++1", "-2", "+2", "++2"], log, "looppause");
|
||||
}
|
||||
|
||||
// Await for-loop break works immediately.
|
||||
{
|
||||
var log = [];
|
||||
Stream<int> f() async* {
|
||||
try {
|
||||
log.add("-1");
|
||||
yield 1;
|
||||
log.add("-2");
|
||||
yield 2;
|
||||
log.add("-3");
|
||||
yield 3;
|
||||
} finally {
|
||||
log.add("x");
|
||||
}
|
||||
}
|
||||
|
||||
await for (var e in f()) {
|
||||
log.add("+$e");
|
||||
await Future(() {}); // One timer tick, pauses function at yield.
|
||||
log.add("++$e");
|
||||
if (e == 2) break;
|
||||
}
|
||||
Expect.listEquals(
|
||||
["-1", "+1", "++1", "-2", "+2", "++2", "x"], log, "loop-pause-break");
|
||||
}
|
||||
asyncEnd();
|
||||
}
|
|
@ -5,8 +5,6 @@
|
|||
|
||||
[ $compiler == dart2js ]
|
||||
arithmetic_int64_test: CompileTimeError, OK # Error if web int literal cannot be represented exactly, see http://dartbug.com/33351
|
||||
async_star/async_star_await_for_test: RuntimeError
|
||||
async_star/async_star_cancel_test: RuntimeError
|
||||
async_star_cancel_while_paused_test: RuntimeError # Issue 22853
|
||||
bit_operations_test: RuntimeError, OK # non JS number semantics
|
||||
bit_operations_test/03: CompileTimeError, OK # Error if web int literal cannot be represented exactly, see http://dartbug.com/33351
|
||||
|
|
|
@ -11,9 +11,6 @@ accessor_conflict_import_prefixed2_test: CompileTimeError # Issue 25626
|
|||
accessor_conflict_import_prefixed_test: CompileTimeError # Issue 25626
|
||||
accessor_conflict_import_test: CompileTimeError # Issue 25626
|
||||
assertion_test: RuntimeError # Issue 30326; Expect.equals(expected: <1>, actual: <0>) fails.
|
||||
async_star/async_star_await_for_test: RuntimeError
|
||||
async_star/async_star_cancel_test: RuntimeError
|
||||
async_star/async_star_test: RuntimeError
|
||||
async_star_test/01: RuntimeError
|
||||
async_star_test/03: RuntimeError
|
||||
async_star_test/04: RuntimeError
|
||||
|
@ -155,8 +152,6 @@ void/return_future_or_void_sync_error4_test/none: CompileTimeError # issue #3431
|
|||
void/void_type_usage_test/final_local_for_in2: MissingCompileTimeError
|
||||
|
||||
[ $compiler == dartdevk ]
|
||||
async_star/async_star_cancel_test: RuntimeError
|
||||
async_star/async_star_test: RuntimeError
|
||||
built_in_identifier_type_annotation_test/dynamic-funarg: RuntimeError # Issue 30450, test name contains hyphen
|
||||
built_in_identifier_type_annotation_test/dynamic-funret: RuntimeError # Issue 30450, test name contains hyphen
|
||||
built_in_identifier_type_annotation_test/dynamic-list: RuntimeError # Issue 30450, test name contains hyphen
|
||||
|
@ -177,8 +172,6 @@ compile_time_constant_static5_test/11: CompileTimeError # Issue 31537
|
|||
compile_time_constant_static5_test/16: CompileTimeError # Issue 31537
|
||||
compile_time_constant_static5_test/21: CompileTimeError # Issue 31537
|
||||
compile_time_constant_static5_test/23: CompileTimeError # Issue 31537
|
||||
conditional_import_string_test: CompileTimeError # Test is broken
|
||||
conditional_import_test: CompileTimeError # Test is broken
|
||||
config_import_test: RuntimeError
|
||||
const_cast1_test/02: MissingCompileTimeError
|
||||
const_constructor3_test/04: MissingCompileTimeError
|
||||
|
@ -316,7 +309,6 @@ assertion_initializer_const_error2_test/*: SkipByDesign # DDC does not support n
|
|||
[ $compiler == dartdevc || $compiler == dartdevk ]
|
||||
arithmetic_int64_test: CompileTimeError, OK # Error if web int literal cannot be represented exactly, see http://dartbug.com/33351
|
||||
async_covariant_type_test: RuntimeError # Check too late
|
||||
async_star/async_star_await_for_test: RuntimeError
|
||||
async_star_cancel_while_paused_test: RuntimeError # Issue 29920; Uncaught Expect.listEquals(list length, expected: <4>, actual: <3>) fails: Next element <*3>
|
||||
async_star_pause_test: RuntimeError # Uncaught Expect.listEquals(at index 2, expected: <0+>, actual: <0!>) fails
|
||||
async_star_test/02: RuntimeError
|
||||
|
|
|
@ -359,10 +359,6 @@ type_promotion_functions_test/10: Pass
|
|||
vm/precompiled_static_initializer_test: Pass, Slow
|
||||
|
||||
[ $compiler == dartkp && $mode == product && $runtime == dart_precompiled && $strong ]
|
||||
async_star/async_star_await_for_test: RuntimeError
|
||||
async_star/async_star_cancel_test: RuntimeError
|
||||
async_star/async_star_invalid_test/none: RuntimeError
|
||||
async_star/async_star_test: RuntimeError
|
||||
vm/type_vm_test/28: MissingRuntimeError
|
||||
vm/type_vm_test/29: MissingRuntimeError
|
||||
vm/type_vm_test/30: MissingRuntimeError
|
||||
|
@ -410,13 +406,6 @@ assertion_initializer_const_error2_test/cc10: Crash
|
|||
assertion_initializer_const_error2_test/cc11: Crash
|
||||
async_await_test: RuntimeError
|
||||
async_return_types_test/nestedFuture: Fail
|
||||
async_star/async_star_cancel_test: DartkCrash
|
||||
async_star/async_star_invalid_test/01: DartkCrash
|
||||
async_star/async_star_invalid_test/02: DartkCrash
|
||||
async_star/async_star_invalid_test/03: DartkCrash
|
||||
async_star/async_star_invalid_test/04: DartkCrash
|
||||
async_star/async_star_invalid_test/none: DartkCrash
|
||||
async_star/async_star_test: DartkCrash
|
||||
compile_time_constant_checked_test/02: MissingCompileTimeError
|
||||
covariance_type_parameter_test/01: RuntimeError
|
||||
covariance_type_parameter_test/02: RuntimeError
|
||||
|
|
|
@ -36,13 +36,4 @@ stacktrace_rethrow_nonerror_test: Skip
|
|||
vm/no_such_args_error_message_vm_test: Skip
|
||||
vm/no_such_method_error_message_callable_vm_test: Skip
|
||||
vm/no_such_method_error_message_vm_test: Skip
|
||||
vm/regress_28325_test: Skip
|
||||
|
||||
[ $runtime == dart_precompiled && ($compiler == dartkp || $compiler == precompiler) ]
|
||||
async_star/async_star_await_for_test: RuntimeError
|
||||
async_star/async_star_cancel_test: RuntimeError
|
||||
async_star/async_star_invalid_test/01: MissingCompileTimeError
|
||||
async_star/async_star_invalid_test/02: MissingCompileTimeError
|
||||
async_star/async_star_invalid_test/04: MissingCompileTimeError
|
||||
async_star/async_star_invalid_test/none: RuntimeError
|
||||
async_star/async_star_test: RuntimeError
|
||||
vm/regress_28325_test: Skip
|
|
@ -18,9 +18,6 @@ assertion_initializer_const_error2_test/cc11: MissingCompileTimeError # Not repo
|
|||
set_literals/*: Skip
|
||||
|
||||
[ $runtime == vm ]
|
||||
async_star/async_star_await_for_test: RuntimeError
|
||||
async_star/async_star_cancel_test: RuntimeError
|
||||
async_star/async_star_test: RuntimeError
|
||||
set_literals/*: Skip
|
||||
|
||||
[ $arch == arm64 && $runtime == vm ]
|
||||
|
|
|
@ -215,7 +215,7 @@ io/addlatexhash_test: Skip # Timeout
|
|||
io/http_advanced_test: Skip # Timeout
|
||||
io/http_auth_digest_test: Crash
|
||||
io/http_auth_test: Skip # Timeout
|
||||
io/http_basic_test: Pass, Crash # Sporadic crash, issue 33824
|
||||
io/http_basic_test: Pass, Timeout # Issue 28046
|
||||
io/http_proxy_advanced_test: Skip # Timeout
|
||||
io/http_read_test: Skip # Timeout
|
||||
io/non_utf8_directory_test: Pass, Timeout
|
||||
|
|
|
@ -98,6 +98,7 @@
|
|||
"third_party/observatory_pub_packages/packages/",
|
||||
"tools/sdks/dart-sdk/",
|
||||
"pkg/async_helper/",
|
||||
"pkg/build_integration/",
|
||||
"pkg/dart_internal/",
|
||||
"pkg/expect/",
|
||||
"pkg/front_end/",
|
||||
|
|
|
@ -9,6 +9,7 @@ import("../create_timestamp.gni")
|
|||
patched_sdk_dir = "$target_gen_dir/patched_sdk"
|
||||
sdk_summary = "$target_gen_dir/ddc_sdk.sum"
|
||||
sdk_dill = "$target_gen_dir/kernel/ddc_sdk.dill"
|
||||
sdk_libraries_json = "$target_gen_dir/libraries.json"
|
||||
|
||||
application_snapshot("dartdevc") {
|
||||
main_dart = "../../pkg/dev_compiler/bin/dartdevc.dart"
|
||||
|
@ -48,7 +49,7 @@ application_snapshot("dartdevk") {
|
|||
":dartdevk_sdk",
|
||||
]
|
||||
|
||||
inputs = [ sdk_dill ]
|
||||
inputs = [ sdk_dill, sdk_libraries_json ]
|
||||
}
|
||||
|
||||
sdk_lib_files = exec_script("../../tools/list_dart_files.py",
|
||||
|
@ -269,6 +270,7 @@ prebuilt_dart_action("dartdevc_test_pkg") {
|
|||
|
||||
inputs = [
|
||||
sdk_dill,
|
||||
sdk_libraries_json,
|
||||
sdk_summary,
|
||||
"$target_gen_dir/dartdevc_files.stamp",
|
||||
"$root_gen_dir/pkg_files.stamp",
|
||||
|
@ -348,6 +350,7 @@ prebuilt_dart_action("dartdevk_sdk") {
|
|||
|
||||
outputs = [
|
||||
sdk_dill,
|
||||
sdk_libraries_json,
|
||||
"$target_gen_dir/kernel/amd/dart_sdk.js",
|
||||
"$target_gen_dir/kernel/amd/dart_sdk.js.map",
|
||||
"$target_gen_dir/kernel/common/dart_sdk.js",
|
||||
|
|
Loading…
Reference in a new issue