#FEATURE by exept
class: JavaScriptFunctionNode
class definition
added:
#isAsync
#isAsync:
changed: #printOn:indent:
--- 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:'('.