Skip to content

Commit d25c369

Browse files
munificentcommit-bot@chromium.org
authored andcommitted
Migrate language_2/script to NNBD.
Change-Id: I1263ec9b1accbd7d092b27a15495bf1a4590a1af Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150843 Auto-Submit: Bob Nystrom <[email protected]> Reviewed-by: Nicholas Shahan <[email protected]> Commit-Queue: Bob Nystrom <[email protected]>
1 parent a13a2d7 commit d25c369

File tree

7 files changed

+68
-0
lines changed

7 files changed

+68
-0
lines changed

tests/language/script/lib.dart

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2+
// for details. All rights reserved. Use of this source code is governed by a
3+
// BSD-style license that can be found in the LICENSE file.
4+
5+
// A perfectly legal dart library for use with script and library tests.
6+
7+
library ScriptLib;
8+
9+
const int scriptLib = 1;
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
2+
// for details. All rights reserved. Use of this source code is governed by a
3+
// BSD-style license that can be found in the LICENSE file.
4+
5+
int ok = 1;
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
2+
// for details. All rights reserved. Use of this source code is governed by a
3+
// BSD-style license that can be found in the LICENSE file.
4+
5+
part of "script1_test.dart";
6+
7+
const int scriptPart = 1;
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
2+
// for details. All rights reserved. Use of this source code is governed by a
3+
// BSD-style license that can be found in the LICENSE file.
4+
5+
/// Wrong order of import and part directives.
6+
7+
part "script1_part.dart";
8+
import "script1_lib.dart";
9+
// [error line 8, column 1, length 6]
10+
// [analyzer] SYNTACTIC_ERROR.IMPORT_DIRECTIVE_AFTER_PART_DIRECTIVE
11+
// [cfe] Import directives must precede part directives.
12+
13+
main() {
14+
print("Should not reach here.");
15+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
2+
// for details. All rights reserved. Use of this source code is governed by a
3+
// BSD-style license that can be found in the LICENSE file.
4+
5+
library Script2Part;
6+
import "lib.dart";
7+
8+
part of "script2_test.dart";
9+
10+
const int scriptPart = 1;
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
2+
// for details. All rights reserved. Use of this source code is governed by a
3+
// BSD-style license that can be found in the LICENSE file.
4+
5+
/// Part file has library and import directives.
6+
7+
/*@compile-error=unspecified*/
8+
// TODO(rnystrom): Using the above tag instead of making this a static error
9+
// test because the error is reported in the part file and not in this file.
10+
// Static error tests only support errors reported in the main test file itself.
11+
part "script2_part.dart";
12+
13+
main() {
14+
print("Should not reach here.");
15+
}

tests/language/script/source.dart

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2+
// for details. All rights reserved. Use of this source code is governed by a
3+
// BSD-style license that can be found in the LICENSE file.
4+
5+
// A perfectly legal dart source file for use with script and library tests.
6+
7+
const int script_source = 1;

0 commit comments

Comments
 (0)