Browse Source

pastojs: library: forbid unit exports

mattias 3 years ago
parent
commit
7997f884b7
1 changed files with 6 additions and 0 deletions
  1. 6 0
      packages/pastojs/src/fppas2js.pp

+ 6 - 0
packages/pastojs/src/fppas2js.pp

@@ -4935,6 +4935,12 @@ begin
   if not (DeclEl.Parent is TPasSection) then
     RaiseMsg(20210106224436,nSymbolCannotBeExportedFromALibrary,
       sSymbolCannotBeExportedFromALibrary,[],El);
+
+  if not (DeclEl.Parent is TLibrarySection) then
+    // disable exports in units
+    RaiseMsg(20211022224239,nSymbolCannotBeExportedFromALibrary,
+      sSymbolCannotBeExportedFromALibrary,[],El);
+
   if DeclEl is TPasProcedure then
     begin
     Proc:=TPasProcedure(DeclEl);