Explorar o código

* Check for nil

git-svn-id: trunk@27475 -
michael %!s(int64=11) %!d(string=hai) anos
pai
achega
e05b77e759
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  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+' */');