-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[cfe] Disallow script tag in part file
In response to #52575 Change-Id: I452575517c378dda3000b8fcbf4f66274b1583a6 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/315420 Reviewed-by: Chloe Stefantsova <cstefantsova@google.com> Commit-Queue: Johnni Winther <johnniwinther@google.com>
- Loading branch information
1 parent
463e251
commit 46086e9
Showing
15 changed files
with
149 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/usr/bin/env dart | ||
// Copyright (c) 2023, 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. | ||
|
||
part of 'script_tag_in_part_file_lib.dart'; | ||
void run() => print("Running!"); |
17 changes: 17 additions & 0 deletions
17
pkg/front_end/testcases/general/script_tag_in_part_file.dart.strong.expect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
library; | ||
// | ||
// Problems in library: | ||
// | ||
// pkg/front_end/testcases/general/script_tag_in_part_file.dart:1:1: Error: A part file cannot have script tag. | ||
// Try removing the script tag or the 'part of' directive. | ||
// #!/usr/bin/env dart | ||
// ^ | ||
// | ||
import self as self; | ||
import "dart:core" as core; | ||
|
||
part script_tag_in_part_file.dart; | ||
static method /* from org-dartlang-testcase:///script_tag_in_part_file.dart */ run() → void | ||
return core::print("Running!"); | ||
static method main() → void | ||
return self::run(); |
17 changes: 17 additions & 0 deletions
17
pkg/front_end/testcases/general/script_tag_in_part_file.dart.strong.transformed.expect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
library; | ||
// | ||
// Problems in library: | ||
// | ||
// pkg/front_end/testcases/general/script_tag_in_part_file.dart:1:1: Error: A part file cannot have script tag. | ||
// Try removing the script tag or the 'part of' directive. | ||
// #!/usr/bin/env dart | ||
// ^ | ||
// | ||
import self as self; | ||
import "dart:core" as core; | ||
|
||
part script_tag_in_part_file.dart; | ||
static method /* from org-dartlang-testcase:///script_tag_in_part_file.dart */ run() → void | ||
return core::print("Running!"); | ||
static method main() → void | ||
return self::run(); |
3 changes: 3 additions & 0 deletions
3
pkg/front_end/testcases/general/script_tag_in_part_file.dart.textual_outline.expect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/usr/bin/env dart | ||
part of 'script_tag_in_part_file_lib.dart'; | ||
void run() => print("Running!"); |
17 changes: 17 additions & 0 deletions
17
pkg/front_end/testcases/general/script_tag_in_part_file.dart.weak.expect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
library; | ||
// | ||
// Problems in library: | ||
// | ||
// pkg/front_end/testcases/general/script_tag_in_part_file.dart:1:1: Error: A part file cannot have script tag. | ||
// Try removing the script tag or the 'part of' directive. | ||
// #!/usr/bin/env dart | ||
// ^ | ||
// | ||
import self as self; | ||
import "dart:core" as core; | ||
|
||
part script_tag_in_part_file.dart; | ||
static method /* from org-dartlang-testcase:///script_tag_in_part_file.dart */ run() → void | ||
return core::print("Running!"); | ||
static method main() → void | ||
return self::run(); |
17 changes: 17 additions & 0 deletions
17
pkg/front_end/testcases/general/script_tag_in_part_file.dart.weak.modular.expect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
library; | ||
// | ||
// Problems in library: | ||
// | ||
// pkg/front_end/testcases/general/script_tag_in_part_file.dart:1:1: Error: A part file cannot have script tag. | ||
// Try removing the script tag or the 'part of' directive. | ||
// #!/usr/bin/env dart | ||
// ^ | ||
// | ||
import self as self; | ||
import "dart:core" as core; | ||
|
||
part script_tag_in_part_file.dart; | ||
static method /* from org-dartlang-testcase:///script_tag_in_part_file.dart */ run() → void | ||
return core::print("Running!"); | ||
static method main() → void | ||
return self::run(); |
16 changes: 16 additions & 0 deletions
16
pkg/front_end/testcases/general/script_tag_in_part_file.dart.weak.outline.expect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
library; | ||
// | ||
// Problems in library: | ||
// | ||
// pkg/front_end/testcases/general/script_tag_in_part_file.dart:1:1: Error: A part file cannot have script tag. | ||
// Try removing the script tag or the 'part of' directive. | ||
// #!/usr/bin/env dart | ||
// ^ | ||
// | ||
import self as self; | ||
|
||
part script_tag_in_part_file.dart; | ||
static method /* from org-dartlang-testcase:///script_tag_in_part_file.dart */ run() → void | ||
; | ||
static method main() → void | ||
; |
17 changes: 17 additions & 0 deletions
17
pkg/front_end/testcases/general/script_tag_in_part_file.dart.weak.transformed.expect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
library; | ||
// | ||
// Problems in library: | ||
// | ||
// pkg/front_end/testcases/general/script_tag_in_part_file.dart:1:1: Error: A part file cannot have script tag. | ||
// Try removing the script tag or the 'part of' directive. | ||
// #!/usr/bin/env dart | ||
// ^ | ||
// | ||
import self as self; | ||
import "dart:core" as core; | ||
|
||
part script_tag_in_part_file.dart; | ||
static method /* from org-dartlang-testcase:///script_tag_in_part_file.dart */ run() → void | ||
return core::print("Running!"); | ||
static method main() → void | ||
return self::run(); |
8 changes: 8 additions & 0 deletions
8
pkg/front_end/testcases/general/script_tag_in_part_file_lib.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env dart | ||
// Copyright (c) 2023, 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. | ||
|
||
part 'script_tag_in_part_file.dart'; | ||
|
||
void main() => run(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters