Browse Source

pas2js: docs: reference to

git-svn-id: trunk@38094 -
Mattias Gaertner 7 years ago
parent
commit
1955a5bd1a
1 changed files with 6 additions and 2 deletions
  1. 6 2
      utils/pas2js/docs/translation.html

+ 6 - 2
utils/pas2js/docs/translation.html

@@ -1763,8 +1763,9 @@ function(){
     <div class="section">
     <h2 id="functiontype">Translating function types</h2>
     JavaScript functions work like Delphi's "reference to function", which
-    means like closures. Normal functions and nested functions can simply be
-    assigned to variables.
+    means like closures, capturing outer variables.
+    Assigning a normal function or nested function to a procedural variable is
+    translated to a simple assignment.
     A Pascal method needs <b>this</b> to be the class or class instance.<br>
     Note that <i>bind</i> cannot be used, because it does not support the <i>equal</i> operator.
     Instead a wrapper is created:
@@ -1842,6 +1843,9 @@ rtl = {
     <ul>
     <li>You can assign a nested procedure to procedure variable.
     You don't need and you must not add the FPC "<i>is nested</i>" modifier.</li>
+    <li>A procedural typed declared as 'reference to' accepts in pas2js procedures,
+    local procedures and methods. Delphi only supports capturing procedures and methods.
+    FPC 3.0.4 does not support reference-to.</li>
     </ul>
     </div>