Skip to content

Commit

Permalink
Version 3.8.0-21.0.dev
Browse files Browse the repository at this point in the history
Merge 5ec1002 into dev
  • Loading branch information
Dart CI committed Jan 22, 2025
2 parents eb3f266 + 5ec1002 commit 5e95423
Show file tree
Hide file tree
Showing 18 changed files with 332 additions and 7 deletions.
11 changes: 5 additions & 6 deletions pkg/dartdev/lib/src/commands/compile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -93,20 +93,19 @@ class CompileJSCommand extends CompileSubcommandCommand {
}
final args = argResults!;
var snapshot = sdk.dart2jsAotSnapshot;
var runtime = sdk.dartAotRuntime;
var script = sdk.dartAotRuntime;
var useExecProcess = true;
if (!Sdk.checkArtifactExists(snapshot, logError: false)) {
// AOT snapshots cannot be generated on IA32, so we need this fallback
// branch until support for IA32 is dropped (https://dartbug.com/49969).
snapshot = sdk.dart2jsSnapshot;
if (!Sdk.checkArtifactExists(snapshot)) {
script = sdk.dart2jsSnapshot;
if (!Sdk.checkArtifactExists(script)) {
return genericErrorExitCode;
}
runtime = sdk.dart;
useExecProcess = false;
}
final dart2jsCommand = [
snapshot,
if (useExecProcess) snapshot,
'--libraries-spec=${sdk.librariesJson}',
'--cfe-invocation-modes=compile',
'--invoker=dart_cli',
Expand All @@ -115,7 +114,7 @@ class CompileJSCommand extends CompileSubcommandCommand {
];
try {
VmInteropHandler.run(
runtime,
script,
dart2jsCommand,
packageConfigOverride: null,
useExecProcess: useExecProcess,
Expand Down
5 changes: 5 additions & 0 deletions tests/hot_reload/library_hide/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"expectedErrors": {
"1": "Error: Method not found: 'importedFunc'."
}
}
5 changes: 5 additions & 0 deletions tests/hot_reload/library_hide/lib1.0.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Copyright (c) 2025, 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.

importedFunc() => 'a';
9 changes: 9 additions & 0 deletions tests/hot_reload/library_hide/lib1.1.reject.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Copyright (c) 2025, 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.

importedFunc() => 'a';

/** DIFF **/
/*
*/
9 changes: 9 additions & 0 deletions tests/hot_reload/library_hide/lib1.2.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Copyright (c) 2025, 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.

importedFunc() => 'a';

/** DIFF **/
/*
*/
19 changes: 19 additions & 0 deletions tests/hot_reload/library_hide/main.0.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Copyright (c) 2025, 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 'package:expect/expect.dart';
import 'package:reload_test/reload_test_utils.dart';

// Adapted from:
// https://github.com/dart-lang/sdk/blob/9f465e5b6eab0dc3af96140189d4f0190e0ff925/runtime/vm/isolate_reload_test.cc#L1123

void helper() {}

Future<void> main() async {
helper();
await hotReload(expectRejection: true);
helper();
await hotReload();
helper();
}
43 changes: 43 additions & 0 deletions tests/hot_reload/library_hide/main.1.reject.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// Copyright (c) 2025, 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 'package:expect/expect.dart';
import 'package:reload_test/reload_test_utils.dart';

import 'lib1.dart' hide importedFunc;

// Adapted from:
// https://github.com/dart-lang/sdk/blob/9f465e5b6eab0dc3af96140189d4f0190e0ff925/runtime/vm/isolate_reload_test.cc#L1123

void helper() {
Expect.equals('a', importedFunc());
}

Future<void> main() async {
helper();
await hotReload(expectRejection: true);
helper();
await hotReload();
helper();
}

/** DIFF **/
/*
@@ -5,10 +5,14 @@
import 'package:expect/expect.dart';
import 'package:reload_test/reload_test_utils.dart';
+import 'lib1.dart' hide importedFunc;
+
// Adapted from:
// https://github.com/dart-lang/sdk/blob/9f465e5b6eab0dc3af96140189d4f0190e0ff925/runtime/vm/isolate_reload_test.cc#L1123
-void helper() {}
+void helper() {
+ Expect.equals('a', importedFunc());
+}
Future<void> main() async {
helper();
*/
36 changes: 36 additions & 0 deletions tests/hot_reload/library_hide/main.2.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// Copyright (c) 2025, 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 'package:expect/expect.dart';
import 'package:reload_test/reload_test_utils.dart';

import 'lib1.dart';

// Adapted from:
// https://github.com/dart-lang/sdk/blob/9f465e5b6eab0dc3af96140189d4f0190e0ff925/runtime/vm/isolate_reload_test.cc#L1123

void helper() {
Expect.equals('a', importedFunc());
}

Future<void> main() async {
helper();
await hotReload(expectRejection: true);
helper();
await hotReload();
helper();
}

/** DIFF **/
/*
@@ -5,7 +5,7 @@
import 'package:expect/expect.dart';
import 'package:reload_test/reload_test_utils.dart';
-import 'lib1.dart' hide importedFunc;
+import 'lib1.dart';
// Adapted from:
// https://github.com/dart-lang/sdk/blob/9f465e5b6eab0dc3af96140189d4f0190e0ff925/runtime/vm/isolate_reload_test.cc#L1123
*/
6 changes: 6 additions & 0 deletions tests/hot_reload/library_show/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"expectedErrors": {
"1": "Error: Method not found: 'importedFunc'.",
"2": "Error: Method not found: 'importedIntFunc'."
}
}
9 changes: 9 additions & 0 deletions tests/hot_reload/library_show/lib1.0.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Copyright (c) 2025, 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.

// Adapted from:
// https://github.com/dart-lang/sdk/blob/9f465e5b6eab0dc3af96140189d4f0190e0ff925/runtime/vm/isolate_reload_test.cc#L1153

importedFunc() => 'a';
importedIntFunc() => 4;
13 changes: 13 additions & 0 deletions tests/hot_reload/library_show/lib1.1.reject.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Copyright (c) 2025, 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.

// Adapted from:
// https://github.com/dart-lang/sdk/blob/9f465e5b6eab0dc3af96140189d4f0190e0ff925/runtime/vm/isolate_reload_test.cc#L1153

importedFunc() => 'a';
importedIntFunc() => 4;

/** DIFF **/
/*
*/
13 changes: 13 additions & 0 deletions tests/hot_reload/library_show/lib1.2.reject.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Copyright (c) 2025, 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.

// Adapted from:
// https://github.com/dart-lang/sdk/blob/9f465e5b6eab0dc3af96140189d4f0190e0ff925/runtime/vm/isolate_reload_test.cc#L1153

importedFunc() => 'a';
importedIntFunc() => 4;

/** DIFF **/
/*
*/
13 changes: 13 additions & 0 deletions tests/hot_reload/library_show/lib1.3.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Copyright (c) 2025, 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.

// Adapted from:
// https://github.com/dart-lang/sdk/blob/9f465e5b6eab0dc3af96140189d4f0190e0ff925/runtime/vm/isolate_reload_test.cc#L1153

importedFunc() => 'a';
importedIntFunc() => 4;

/** DIFF **/
/*
*/
25 changes: 25 additions & 0 deletions tests/hot_reload/library_show/main.0.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Copyright (c) 2025, 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 'package:expect/expect.dart';
import 'package:reload_test/reload_test_utils.dart';

import 'lib1.dart' show importedIntFunc;

// Adapted from:
// https://github.com/dart-lang/sdk/blob/9f465e5b6eab0dc3af96140189d4f0190e0ff925/runtime/vm/isolate_reload_test.cc#L1153

void helper() {
Expect.equals(4, importedIntFunc());
}

Future<void> main() async {
helper();
await hotReload(expectRejection: true);
helper();
await hotReload(expectRejection: true);
helper();
await hotReload();
helper();
}
38 changes: 38 additions & 0 deletions tests/hot_reload/library_show/main.1.reject.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// Copyright (c) 2025, 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 'package:expect/expect.dart';
import 'package:reload_test/reload_test_utils.dart';

import 'lib1.dart' show importedIntFunc;

// Adapted from:
// https://github.com/dart-lang/sdk/blob/9f465e5b6eab0dc3af96140189d4f0190e0ff925/runtime/vm/isolate_reload_test.cc#L1153

void helper() {
Expect.equals(4, importedFunc());
}

Future<void> main() async {
helper();
await hotReload(expectRejection: true);
helper();
await hotReload(expectRejection: true);
helper();
await hotReload();
helper();
}

/** DIFF **/
/*
@@ -11,7 +11,7 @@
// https://github.com/dart-lang/sdk/blob/9f465e5b6eab0dc3af96140189d4f0190e0ff925/runtime/vm/isolate_reload_test.cc#L1153
void helper() {
- Expect.equals(4, importedIntFunc());
+ Expect.equals(4, importedFunc());
}
Future<void> main() async {
*/
45 changes: 45 additions & 0 deletions tests/hot_reload/library_show/main.2.reject.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// Copyright (c) 2025, 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 'package:expect/expect.dart';
import 'package:reload_test/reload_test_utils.dart';

import 'lib1.dart' show importedFunc;

// Adapted from:
// https://github.com/dart-lang/sdk/blob/9f465e5b6eab0dc3af96140189d4f0190e0ff925/runtime/vm/isolate_reload_test.cc#L1153

void helper() {
Expect.equals(4, importedIntFunc());
}

Future<void> main() async {
helper();
await hotReload(expectRejection: true);
helper();
await hotReload(expectRejection: true);
helper();
await hotReload();
helper();
}

/** DIFF **/
/*
@@ -5,13 +5,13 @@
import 'package:expect/expect.dart';
import 'package:reload_test/reload_test_utils.dart';
-import 'lib1.dart' show importedIntFunc;
+import 'lib1.dart' show importedFunc;
// Adapted from:
// https://github.com/dart-lang/sdk/blob/9f465e5b6eab0dc3af96140189d4f0190e0ff925/runtime/vm/isolate_reload_test.cc#L1153
void helper() {
- Expect.equals(4, importedFunc());
+ Expect.equals(4, importedIntFunc());
}
Future<void> main() async {
*/
38 changes: 38 additions & 0 deletions tests/hot_reload/library_show/main.3.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// Copyright (c) 2025, 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 'package:expect/expect.dart';
import 'package:reload_test/reload_test_utils.dart';

import 'lib1.dart' show importedFunc;

// Adapted from:
// https://github.com/dart-lang/sdk/blob/9f465e5b6eab0dc3af96140189d4f0190e0ff925/runtime/vm/isolate_reload_test.cc#L1153

void helper() {
Expect.equals('a', importedFunc());
}

Future<void> main() async {
helper();
await hotReload(expectRejection: true);
helper();
await hotReload(expectRejection: true);
helper();
await hotReload();
helper();
}

/** DIFF **/
/*
@@ -11,7 +11,7 @@
// https://github.com/dart-lang/sdk/blob/9f465e5b6eab0dc3af96140189d4f0190e0ff925/runtime/vm/isolate_reload_test.cc#L1153
void helper() {
- Expect.equals(4, importedIntFunc());
+ Expect.equals('a', importedFunc());
}
Future<void> main() async {
*/
2 changes: 1 addition & 1 deletion tools/VERSION
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ CHANNEL dev
MAJOR 3
MINOR 8
PATCH 0
PRERELEASE 20
PRERELEASE 21
PRERELEASE_PATCH 0

0 comments on commit 5e95423

Please sign in to comment.