| Index: lib/compiler/implementation/scanner/listener.dart
|
| diff --git a/lib/compiler/implementation/scanner/listener.dart b/lib/compiler/implementation/scanner/listener.dart
|
| index 9ffe69c5350655b9eda0725c427dfeb58f0e60e2..a6c8d782fc6b25030a5ae2f1e07fd673c6f15c77 100644
|
| --- a/lib/compiler/implementation/scanner/listener.dart
|
| +++ b/lib/compiler/implementation/scanner/listener.dart
|
| @@ -556,10 +556,14 @@ class ElementListener extends Listener {
|
| }
|
| StringNode firstArgument = popLiteralString();
|
| Identifier tag = popNode();
|
| - compilationUnitElement.addTag(new ScriptTag(tag, firstArgument,
|
| - argumentName, prefix,
|
| - beginToken, endToken),
|
| - listener);
|
| + LibraryElement library = compilationUnitElement.getLibrary();
|
| + if (library.entryCompilationUnit != compilationUnitElement) {
|
| + // Only allow script tags in the entry compilation unit.
|
| + listener.cancel("script tags not allowed here", node: tag);
|
| + }
|
| + ScriptTag scriptTag = new ScriptTag(tag, firstArgument, argumentName,
|
| + prefix, beginToken, endToken);
|
| + library.addTag(scriptTag, listener);
|
| }
|
|
|
| void endClassDeclaration(int interfacesCount, Token beginToken,
|
|
|