Explorar o código

pastojs: library: forbid unit exports

mattias %!s(int64=4) %!d(string=hai) anos
pai
achega
7997f884b7
Modificáronse 1 ficheiros con 6 adicións e 0 borrados
  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);