Selaa lähdekoodia

* Check for nil

git-svn-id: trunk@27475 -
michael 11 vuotta sitten
vanhempi
commit
e05b77e759
1 muutettua tiedostoa jossa 3 lisäystä ja 0 poistoa
  1. 3 0
      packages/fcl-js/src/jswriter.pp

+ 3 - 0
packages/fcl-js/src/jswriter.pp

@@ -154,6 +154,7 @@ implementation
 
 Resourcestring
   SErrUnknownJSClass = 'Unknown javascript element class : %s';
+  SErrNilNode = 'Nil node in Javascript';
 
 { TBufferWriter }
 
@@ -1140,6 +1141,8 @@ begin
     WriteFunctionDeclarationStatement(TJSFunctionDeclarationStatement(el))
   else if (el is TJSSourceElements) then
     WriteSourceElements(TJSSourceElements(el))
+  else if EL=Nil then
+    Error(SErrNilNode)
   else
     Error(SErrUnknownJSClass,[El.ClassName]);
 //  Write('/* '+EL.ClassName+' */');