#FEATURE by exept
authorClaus Gittinger <cg@exept.de>
Fri, 06 Sep 2019 03:01:59 +0200
changeset 1182 f5c38b72eb4d
parent 1181 a7cdfecd0bc2
child 1183 f2e3768ce592
#FEATURE by exept class: JavaScriptFunctionNode class definition added: #isAsync #isAsync: changed: #printOn:indent:
JavaScriptFunctionNode.st
--- a/JavaScriptFunctionNode.st	Thu Sep 05 22:42:51 2019 +0000
+++ b/JavaScriptFunctionNode.st	Fri Sep 06 03:01:59 2019 +0200
@@ -17,7 +17,7 @@
 
 ParseNode subclass:#JavaScriptFunctionNode
 	instanceVariableNames:'functionName arguments locals statements environment
-		isReturnedFrom lineNr'
+		isReturnedFrom lineNr isAsync'
 	classVariableNames:''
 	poolDictionaries:''
 	category:'Languages-JavaScript-Compiling & Parsing'
@@ -155,6 +155,14 @@
     "Created: / 14.5.1998 / 21:26:18 / cg"
 !
 
+isAsync
+    ^ isAsync
+!
+
+isAsync:aBoolean
+    isAsync := aBoolean.
+!
+
 isReturnedFrom
     ^ isReturnedFrom
 !
@@ -426,6 +434,9 @@
 printOn:aStream indent:i
     |first|
 
+    (isAsync ? false) ifTrue:[
+        aStream nextPutAll:'async '.
+    ].
     aStream nextPutAll:'function '.
     functionName notNil ifTrue:[ aStream nextPutAll:functionName ].
     aStream nextPutAll:'('.