ソースを参照

pas2js: doc

git-svn-id: trunk@37993 -
Mattias Gaertner 7 年 前
コミット
700b2fdb03
1 ファイル変更9 行追加0 行削除
  1. 9 0
      utils/pas2js/docs/translation.html

+ 9 - 0
utils/pas2js/docs/translation.html

@@ -61,6 +61,7 @@
     <a href="#enumerators">Translating enumerators</a><br>
     <a href="#functiontype">Translating function types</a><br>
     <a href="#absolute">Translating var modifier absolute</a><br>
+    <a href="#assert">Translating assert()</a><br>
     <a href="#calljavascript">Calling JavaScript from Pascal</a><br>
     <a href="#asm">The asm block</a><br>
     <a href="#assembler">The procedure modifier assembler</a><br>
@@ -167,6 +168,7 @@ Put + after a boolean switch option to enable it, - to disable it
     -Pecmascript5  : default
     -Pecmascript6
   -S&lt;x&gt;   : Syntax options. &lt;x&gt; is a combination of the following letters:
+    a     : Turn on assertions
     c     : Support operators like C (*=,+=,/= and -=)
     d     : Same as -Mdelphi
     2     : Same as -Mobjfpc (default)
@@ -1845,6 +1847,13 @@ rtl = {
     The modifier is currently only supported for local variables.
     </div>
 
+    <div class="section">
+    <h2 id="assert">Translating assert()</h2>
+    The Assert(boolean[,string]) function is translated to <i>if(bool) throw x</i>.
+    If unit sysutils is used, it creates an EAssertFailed exception.<br>
+    Otherwise it throws a string.
+    </div>
+
     <div class="section">
     <h2 id="calljavascript">Calling JavaScript from Pascal</h2>
     Pas2js allows to write low level functions and/or access a JavaScript library