JavaScriptFunctionNode.st
author Claus Gittinger <cg@exept.de>
Fri, 10 Jan 2020 12:43:49 +0100
changeset 1226 175d39242154
parent 1201 045c36ec4fa4
permissions -rw-r--r--
#BUGFIX by cg class: JavaScriptFunctionNode changed: #allVisibleVariables
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
30
27d36560aa7b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 19
diff changeset
     1
"
27d36560aa7b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 19
diff changeset
     2
 COPYRIGHT (c) 1998 by eXept Software AG
40
382a209e9150 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 38
diff changeset
     3
	      All Rights Reserved
30
27d36560aa7b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 19
diff changeset
     4
27d36560aa7b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 19
diff changeset
     5
 This software is furnished under a license and may be used
27d36560aa7b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 19
diff changeset
     6
 only in accordance with the terms of that license and with the
27d36560aa7b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 19
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
27d36560aa7b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 19
diff changeset
     8
 be provided or otherwise made available to, or used by, any
27d36560aa7b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 19
diff changeset
     9
 other person.  No title to or ownership of the software is
27d36560aa7b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 19
diff changeset
    10
 hereby transferred.
27d36560aa7b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 19
diff changeset
    11
"
38
d055d9ff4b71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 30
diff changeset
    12
"{ Package: 'stx:libjavascript' }"
30
27d36560aa7b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 19
diff changeset
    13
845
31abcd94bdff class: JavaScriptFunctionNode
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
    14
"{ NameSpace: Smalltalk }"
31abcd94bdff class: JavaScriptFunctionNode
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
    15
0
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    16
ParseNode subclass:#JavaScriptFunctionNode
240
59aca8ff3fc2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 238
diff changeset
    17
	instanceVariableNames:'functionName arguments locals statements environment
1182
f5c38b72eb4d #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 1114
diff changeset
    18
		isReturnedFrom lineNr isAsync'
0
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
	classVariableNames:''
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
	poolDictionaries:''
47
684f35c49db2 category change
Claus Gittinger <cg@exept.de>
parents: 40
diff changeset
    21
	category:'Languages-JavaScript-Compiling & Parsing'
0
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
!
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
!JavaScriptFunctionNode class methodsFor:'documentation'!
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
30
27d36560aa7b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 19
diff changeset
    26
copyright
27d36560aa7b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 19
diff changeset
    27
"
27d36560aa7b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 19
diff changeset
    28
 COPYRIGHT (c) 1998 by eXept Software AG
40
382a209e9150 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 38
diff changeset
    29
	      All Rights Reserved
0
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    30
30
27d36560aa7b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 19
diff changeset
    31
 This software is furnished under a license and may be used
27d36560aa7b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 19
diff changeset
    32
 only in accordance with the terms of that license and with the
27d36560aa7b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 19
diff changeset
    33
 inclusion of the above copyright notice.   This software may not
27d36560aa7b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 19
diff changeset
    34
 be provided or otherwise made available to, or used by, any
27d36560aa7b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 19
diff changeset
    35
 other person.  No title to or ownership of the software is
27d36560aa7b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 19
diff changeset
    36
 hereby transferred.
27d36560aa7b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 19
diff changeset
    37
"
67
058fd3dad518 js-plain vs. js-in-html handling
Claus Gittinger <cg@exept.de>
parents: 65
diff changeset
    38
!
058fd3dad518 js-plain vs. js-in-html handling
Claus Gittinger <cg@exept.de>
parents: 65
diff changeset
    39
058fd3dad518 js-plain vs. js-in-html handling
Claus Gittinger <cg@exept.de>
parents: 65
diff changeset
    40
documentation
058fd3dad518 js-plain vs. js-in-html handling
Claus Gittinger <cg@exept.de>
parents: 65
diff changeset
    41
"
058fd3dad518 js-plain vs. js-in-html handling
Claus Gittinger <cg@exept.de>
parents: 65
diff changeset
    42
    ATTENTION: for protocol compatibility with JavaScriptEnvironment.
058fd3dad518 js-plain vs. js-in-html handling
Claus Gittinger <cg@exept.de>
parents: 65
diff changeset
    43
    many messages are implemented with an initial underscore.
058fd3dad518 js-plain vs. js-in-html handling
Claus Gittinger <cg@exept.de>
parents: 65
diff changeset
    44
    These are required as JavaScriptEnvironment catches doesNotUnderstand and
058fd3dad518 js-plain vs. js-in-html handling
Claus Gittinger <cg@exept.de>
parents: 65
diff changeset
    45
    does some kludgy fiddling there.
058fd3dad518 js-plain vs. js-in-html handling
Claus Gittinger <cg@exept.de>
parents: 65
diff changeset
    46
"
0
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
! !
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
!JavaScriptFunctionNode methodsFor:'accessing'!
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
38
d055d9ff4b71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 30
diff changeset
    51
_argVariables
d055d9ff4b71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 30
diff changeset
    52
    ^ arguments
d055d9ff4b71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 30
diff changeset
    53
!
d055d9ff4b71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 30
diff changeset
    54
d055d9ff4b71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 30
diff changeset
    55
_argVariables:aDictionary
d055d9ff4b71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 30
diff changeset
    56
    arguments := aDictionary
d055d9ff4b71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 30
diff changeset
    57
!
d055d9ff4b71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 30
diff changeset
    58
d055d9ff4b71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 30
diff changeset
    59
_localVariables
d055d9ff4b71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 30
diff changeset
    60
    ^ locals
d055d9ff4b71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 30
diff changeset
    61
!
d055d9ff4b71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 30
diff changeset
    62
d055d9ff4b71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 30
diff changeset
    63
_localVariables:aDictionary
d055d9ff4b71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 30
diff changeset
    64
    locals := aDictionary
d055d9ff4b71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 30
diff changeset
    65
!
d055d9ff4b71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 30
diff changeset
    66
19
0cd657e48809 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6
diff changeset
    67
_outerEnvironment
0cd657e48809 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6
diff changeset
    68
    ^ environment
0cd657e48809 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6
diff changeset
    69
0cd657e48809 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6
diff changeset
    70
    "Created: / 17.5.1998 / 00:41:00 / cg"
0cd657e48809 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6
diff changeset
    71
!
0cd657e48809 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6
diff changeset
    72
0cd657e48809 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6
diff changeset
    73
_outerEnvironment:anEnvironment
0cd657e48809 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6
diff changeset
    74
    environment := anEnvironment
0cd657e48809 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6
diff changeset
    75
0cd657e48809 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6
diff changeset
    76
    "Created: / 17.5.1998 / 00:41:11 / cg"
0cd657e48809 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6
diff changeset
    77
!
0cd657e48809 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6
diff changeset
    78
62
ed478b08cbd3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
    79
_topEnvironment
ed478b08cbd3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
    80
    ^ environment isNil ifTrue:self ifFalse:[environment _topEnvironment]
ed478b08cbd3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
    81
!
ed478b08cbd3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
    82
0
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    83
addLocalVariable:aVariable
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    84
    locals isNil ifTrue:[
40
382a209e9150 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 38
diff changeset
    85
	locals := OrderedCollection new.
0
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    86
    ].
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    87
    locals add:aVariable
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    88
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    89
    "Created: / 14.5.1998 / 21:56:19 / cg"
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    90
!
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    91
1061
47890d5fed94 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
    92
allVisibleVariables
47890d5fed94 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
    93
    "return the variable-nodes for visible arguments and locals;
47890d5fed94 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
    94
     this includes outer-scope variables"
47890d5fed94 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
    95
     
47890d5fed94 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
    96
    |outerVariables locals visibleArguments variablesInThisScope visibleOuterVariables|
47890d5fed94 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
    97
47890d5fed94 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
    98
    environment notNil ifTrue:[
47890d5fed94 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
    99
        outerVariables := environment allVisibleVariables
47890d5fed94 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
   100
    ] ifFalse:[
47890d5fed94 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
   101
        outerVariables := #()
47890d5fed94 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
   102
    ].    
47890d5fed94 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
   103
    
1226
175d39242154 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 1201
diff changeset
   104
    locals := self localVariables ? #().
175d39242154 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 1201
diff changeset
   105
    visibleArguments := (self arguments ? #()) reject:[:arg | locals contains:[:l | l name = arg name]].
1061
47890d5fed94 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
   106
    variablesInThisScope := locals , visibleArguments.
1226
175d39242154 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 1201
diff changeset
   107
    visibleOuterVariables := outerVariables reject:[:arg | variablesInThisScope contains:[:l | l name = arg name]].
1061
47890d5fed94 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
   108
    ^ variablesInThisScope,visibleOuterVariables
47890d5fed94 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
   109
47890d5fed94 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
   110
    "Created: / 14-02-2019 / 11:12:18 / Claus Gittinger"
47890d5fed94 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
   111
!
47890d5fed94 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
   112
858
aed17103f87c class: JavaScriptFunctionNode
Stefan Vogel <sv@exept.de>
parents: 849
diff changeset
   113
argumentCount
1073
feeea3ccc592 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 1061
diff changeset
   114
    ^ arguments size "/ argumentCount
858
aed17103f87c class: JavaScriptFunctionNode
Stefan Vogel <sv@exept.de>
parents: 849
diff changeset
   115
1073
feeea3ccc592 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 1061
diff changeset
   116
    "Created: / 17-05-1998 / 00:36:04 / cg"
feeea3ccc592 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 1061
diff changeset
   117
    "Modified: / 08-03-2019 / 12:49:06 / Claus Gittinger"
858
aed17103f87c class: JavaScriptFunctionNode
Stefan Vogel <sv@exept.de>
parents: 849
diff changeset
   118
!
aed17103f87c class: JavaScriptFunctionNode
Stefan Vogel <sv@exept.de>
parents: 849
diff changeset
   119
0
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   120
arguments
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   121
    "return the value of the instance variable 'arguments' (automatically generated)"
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   122
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   123
    ^ arguments
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   124
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   125
    "Created: / 14.5.1998 / 21:26:20 / cg"
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   126
!
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   127
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   128
arguments:something
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   129
    "set the value of the instance variable 'arguments' (automatically generated)"
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   130
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   131
    arguments := something.
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   132
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   133
    "Created: / 14.5.1998 / 21:26:20 / cg"
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   134
!
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   135
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   136
functionName
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   137
    "return the value of the instance variable 'functionName' (automatically generated)"
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   138
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   139
    ^ functionName
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   140
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   141
    "Created: / 14.5.1998 / 21:26:18 / cg"
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   142
!
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   143
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   144
functionName:something
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   145
    "set the value of the instance variable 'functionName' (automatically generated)"
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   146
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   147
    functionName := something.
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   148
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   149
    "Created: / 14.5.1998 / 21:26:18 / cg"
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   150
!
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   151
1182
f5c38b72eb4d #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 1114
diff changeset
   152
isAsync
f5c38b72eb4d #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 1114
diff changeset
   153
    ^ isAsync
f5c38b72eb4d #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 1114
diff changeset
   154
!
f5c38b72eb4d #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 1114
diff changeset
   155
f5c38b72eb4d #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 1114
diff changeset
   156
isAsync:aBoolean
f5c38b72eb4d #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 1114
diff changeset
   157
    isAsync := aBoolean.
f5c38b72eb4d #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 1114
diff changeset
   158
!
f5c38b72eb4d #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 1114
diff changeset
   159
238
d19d9e555fbf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   160
isReturnedFrom
d19d9e555fbf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   161
    ^ isReturnedFrom
d19d9e555fbf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   162
!
d19d9e555fbf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   163
d19d9e555fbf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   164
isReturnedFrom:something
d19d9e555fbf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   165
    isReturnedFrom := something.
d19d9e555fbf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   166
!
d19d9e555fbf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   167
1053
2274ce3ad70c #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 1000
diff changeset
   168
lineNumber
2274ce3ad70c #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 1000
diff changeset
   169
    ^ lineNr
2274ce3ad70c #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 1000
diff changeset
   170
2274ce3ad70c #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 1000
diff changeset
   171
    "Created: / 08-02-2019 / 11:18:45 / Claus Gittinger"
2274ce3ad70c #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 1000
diff changeset
   172
!
2274ce3ad70c #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 1000
diff changeset
   173
2274ce3ad70c #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 1000
diff changeset
   174
lineNumber:anInteger
2274ce3ad70c #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 1000
diff changeset
   175
    lineNr := anInteger.
2274ce3ad70c #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 1000
diff changeset
   176
2274ce3ad70c #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 1000
diff changeset
   177
    "Created: / 08-02-2019 / 11:18:48 / Claus Gittinger"
2274ce3ad70c #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 1000
diff changeset
   178
!
2274ce3ad70c #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 1000
diff changeset
   179
94
712e02f77a4c *** empty log message ***
ca
parents: 67
diff changeset
   180
localVariableNames
105
912cb7666113 *** empty log message ***
ca
parents: 94
diff changeset
   181
    locals isNil ifTrue:[^ #() ].
1061
47890d5fed94 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
   182
    ^ (locals asSortedCollection:[:a :b | a index < b index]) 
47890d5fed94 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
   183
        collect:[:v | v name].
47890d5fed94 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
   184
47890d5fed94 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
   185
    "Modified (format): / 14-02-2019 / 11:12:33 / Claus Gittinger"
94
712e02f77a4c *** empty log message ***
ca
parents: 67
diff changeset
   186
!
712e02f77a4c *** empty log message ***
ca
parents: 67
diff changeset
   187
712e02f77a4c *** empty log message ***
ca
parents: 67
diff changeset
   188
localVariables
152
1be0e188b17a return from outer method
Claus Gittinger <cg@exept.de>
parents: 124
diff changeset
   189
    ^ locals ? #()
94
712e02f77a4c *** empty log message ***
ca
parents: 67
diff changeset
   190
!
712e02f77a4c *** empty log message ***
ca
parents: 67
diff changeset
   191
19
0cd657e48809 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6
diff changeset
   192
numArgs
0cd657e48809 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6
diff changeset
   193
    ^ arguments size
0cd657e48809 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6
diff changeset
   194
0cd657e48809 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6
diff changeset
   195
    "Created: / 17.5.1998 / 00:36:04 / cg"
0cd657e48809 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6
diff changeset
   196
!
0cd657e48809 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6
diff changeset
   197
594
43ffe08fd1bc class: JavaScriptFunctionNode
Claus Gittinger <cg@exept.de>
parents: 477
diff changeset
   198
numVars
913
547bf81ad16d #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 858
diff changeset
   199
    "return the number of local variables."
547bf81ad16d #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 858
diff changeset
   200
594
43ffe08fd1bc class: JavaScriptFunctionNode
Claus Gittinger <cg@exept.de>
parents: 477
diff changeset
   201
    ^ locals size
43ffe08fd1bc class: JavaScriptFunctionNode
Claus Gittinger <cg@exept.de>
parents: 477
diff changeset
   202
!
43ffe08fd1bc class: JavaScriptFunctionNode
Claus Gittinger <cg@exept.de>
parents: 477
diff changeset
   203
0
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   204
statements
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   205
    "return the value of the instance variable 'statements' (automatically generated)"
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   206
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   207
    ^ statements
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   208
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   209
    "Created: / 14.5.1998 / 21:26:22 / cg"
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   210
!
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   211
675
cfeedffda1dd Support for source positions & parent node reference for JavaScript AST (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 653
diff changeset
   212
statements:aStatementNode
0
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   213
    "set the value of the instance variable 'statements' (automatically generated)"
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   214
675
cfeedffda1dd Support for source positions & parent node reference for JavaScript AST (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 653
diff changeset
   215
    statements := aStatementNode.
cfeedffda1dd Support for source positions & parent node reference for JavaScript AST (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 653
diff changeset
   216
    statements notNil ifTrue:[
cfeedffda1dd Support for source positions & parent node reference for JavaScript AST (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 653
diff changeset
   217
        statements parent: self.
cfeedffda1dd Support for source positions & parent node reference for JavaScript AST (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 653
diff changeset
   218
    ]
0
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   219
675
cfeedffda1dd Support for source positions & parent node reference for JavaScript AST (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 653
diff changeset
   220
    "Created: / 14-05-1998 / 21:26:22 / cg"
cfeedffda1dd Support for source positions & parent node reference for JavaScript AST (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 653
diff changeset
   221
    "Modified: / 20-09-2013 / 17:17:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
38
d055d9ff4b71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 30
diff changeset
   222
!
d055d9ff4b71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 30
diff changeset
   223
736
f8fa644b528d class: JavaScriptFunctionNode
Claus Gittinger <cg@exept.de>
parents: 732
diff changeset
   224
variableValue
f8fa644b528d class: JavaScriptFunctionNode
Claus Gittinger <cg@exept.de>
parents: 732
diff changeset
   225
    "that is a bad kludge to fix the interpreter, which gets functionNodes as value"
f8fa644b528d class: JavaScriptFunctionNode
Claus Gittinger <cg@exept.de>
parents: 732
diff changeset
   226
f8fa644b528d class: JavaScriptFunctionNode
Claus Gittinger <cg@exept.de>
parents: 732
diff changeset
   227
    ^  self
f8fa644b528d class: JavaScriptFunctionNode
Claus Gittinger <cg@exept.de>
parents: 732
diff changeset
   228
!
f8fa644b528d class: JavaScriptFunctionNode
Claus Gittinger <cg@exept.de>
parents: 732
diff changeset
   229
38
d055d9ff4b71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 30
diff changeset
   230
xxxx_variables
d055d9ff4b71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 30
diff changeset
   231
    |list|
d055d9ff4b71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 30
diff changeset
   232
d055d9ff4b71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 30
diff changeset
   233
    list := IdentityDictionary new.
d055d9ff4b71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 30
diff changeset
   234
    arguments notNil ifTrue:[
40
382a209e9150 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 38
diff changeset
   235
	arguments do:[:arg |
382a209e9150 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 38
diff changeset
   236
	    list at:arg name put:arg
382a209e9150 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 38
diff changeset
   237
	].
38
d055d9ff4b71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 30
diff changeset
   238
    ].
d055d9ff4b71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 30
diff changeset
   239
    locals notNil ifTrue:[
40
382a209e9150 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 38
diff changeset
   240
	locals do:[:var |
382a209e9150 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 38
diff changeset
   241
	    list at:var name put:var
382a209e9150 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 38
diff changeset
   242
	].
38
d055d9ff4b71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 30
diff changeset
   243
    ].
d055d9ff4b71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 30
diff changeset
   244
    ^ list
d055d9ff4b71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 30
diff changeset
   245
d055d9ff4b71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 30
diff changeset
   246
    "Created: / 17.5.1998 / 00:38:15 / cg"
d055d9ff4b71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 30
diff changeset
   247
    "Modified: / 17.5.1998 / 00:40:18 / cg"
0
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   248
! !
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   249
61
a2c7cd9b17b3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 47
diff changeset
   250
!JavaScriptFunctionNode methodsFor:'code generation'!
a2c7cd9b17b3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 47
diff changeset
   251
a2c7cd9b17b3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 47
diff changeset
   252
codeVariableSetupOn:codeStream for:aCompiler
a2c7cd9b17b3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 47
diff changeset
   253
    locals isNil ifTrue:[^ self].
a2c7cd9b17b3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 47
diff changeset
   254
a2c7cd9b17b3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 47
diff changeset
   255
    locals do:[:eachVar |
a2c7cd9b17b3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 47
diff changeset
   256
        "/ generate code to set it up.
a2c7cd9b17b3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 47
diff changeset
   257
a2c7cd9b17b3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 47
diff changeset
   258
        |varNode initExpression setupExpr|
a2c7cd9b17b3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 47
diff changeset
   259
a2c7cd9b17b3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 47
diff changeset
   260
        initExpression := eachVar expressionForSetup.
a2c7cd9b17b3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 47
diff changeset
   261
        initExpression notNil ifTrue:[
595
3632dc27721c JavaScript
Claus Gittinger <cg@exept.de>
parents: 594
diff changeset
   262
            self isInnerFunction ifTrue:[
3632dc27721c JavaScript
Claus Gittinger <cg@exept.de>
parents: 594
diff changeset
   263
                varNode := JavaScriptVariableNode
3632dc27721c JavaScript
Claus Gittinger <cg@exept.de>
parents: 594
diff changeset
   264
                                type:#BlockVariable
3632dc27721c JavaScript
Claus Gittinger <cg@exept.de>
parents: 594
diff changeset
   265
                                name:eachVar name
3632dc27721c JavaScript
Claus Gittinger <cg@exept.de>
parents: 594
diff changeset
   266
                                token:eachVar
3632dc27721c JavaScript
Claus Gittinger <cg@exept.de>
parents: 594
diff changeset
   267
                                index:eachVar index
3632dc27721c JavaScript
Claus Gittinger <cg@exept.de>
parents: 594
diff changeset
   268
                                block:self 
3632dc27721c JavaScript
Claus Gittinger <cg@exept.de>
parents: 594
diff changeset
   269
                                from:self    
3632dc27721c JavaScript
Claus Gittinger <cg@exept.de>
parents: 594
diff changeset
   270
            ] ifFalse:[
3632dc27721c JavaScript
Claus Gittinger <cg@exept.de>
parents: 594
diff changeset
   271
                varNode := JavaScriptVariableNode 
3632dc27721c JavaScript
Claus Gittinger <cg@exept.de>
parents: 594
diff changeset
   272
                                type:#MethodVariable
3632dc27721c JavaScript
Claus Gittinger <cg@exept.de>
parents: 594
diff changeset
   273
                                name:eachVar name
3632dc27721c JavaScript
Claus Gittinger <cg@exept.de>
parents: 594
diff changeset
   274
                                token:eachVar
3632dc27721c JavaScript
Claus Gittinger <cg@exept.de>
parents: 594
diff changeset
   275
                                index:eachVar index.
3632dc27721c JavaScript
Claus Gittinger <cg@exept.de>
parents: 594
diff changeset
   276
            ].
61
a2c7cd9b17b3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 47
diff changeset
   277
            setupExpr := AssignmentNode variable:varNode expression:initExpression.
595
3632dc27721c JavaScript
Claus Gittinger <cg@exept.de>
parents: 594
diff changeset
   278
            setupExpr codeForSideEffectOn:codeStream inBlock:(self isInnerFunction ifTrue:[self] ifFalse:[nil]) for:aCompiler.
61
a2c7cd9b17b3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 47
diff changeset
   279
        ]
a2c7cd9b17b3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 47
diff changeset
   280
    ]
202
7feb17dae376 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 195
diff changeset
   281
7feb17dae376 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 195
diff changeset
   282
    "Modified: / 12-07-2006 / 15:07:00 / cg"
61
a2c7cd9b17b3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 47
diff changeset
   283
! !
a2c7cd9b17b3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 47
diff changeset
   284
477
8a0be6a3d1ce #messagesDo:
Claus Gittinger <cg@exept.de>
parents: 240
diff changeset
   285
!JavaScriptFunctionNode methodsFor:'enumeration'!
8a0be6a3d1ce #messagesDo:
Claus Gittinger <cg@exept.de>
parents: 240
diff changeset
   286
972
17d76cf3dd40 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 965
diff changeset
   287
allSubNodesDo:aBlock
17d76cf3dd40 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 965
diff changeset
   288
    "evaluate aBlock for each subnode"
720
e190055c2035 class: JavaScriptFunctionNode
Stefan Vogel <sv@exept.de>
parents: 675
diff changeset
   289
1099
d0c3d8757b0b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 1073
diff changeset
   290
    statements notNil ifTrue:[
d0c3d8757b0b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 1073
diff changeset
   291
        statements allNodesDo:aBlock
d0c3d8757b0b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 1073
diff changeset
   292
    ].
d0c3d8757b0b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 1073
diff changeset
   293
d0c3d8757b0b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 1073
diff changeset
   294
    "Modified: / 10-07-2019 / 02:32:21 / Claus Gittinger"
720
e190055c2035 class: JavaScriptFunctionNode
Stefan Vogel <sv@exept.de>
parents: 675
diff changeset
   295
!
e190055c2035 class: JavaScriptFunctionNode
Stefan Vogel <sv@exept.de>
parents: 675
diff changeset
   296
1114
4629726c308a #OTHER by exept
Claus Gittinger <cg@exept.de>
parents: 1109
diff changeset
   297
childrenDo:aBlock
4629726c308a #OTHER by exept
Claus Gittinger <cg@exept.de>
parents: 1109
diff changeset
   298
    "evaluate aBlock for each subnode"
4629726c308a #OTHER by exept
Claus Gittinger <cg@exept.de>
parents: 1109
diff changeset
   299
4629726c308a #OTHER by exept
Claus Gittinger <cg@exept.de>
parents: 1109
diff changeset
   300
    self statements:statements do:aBlock
4629726c308a #OTHER by exept
Claus Gittinger <cg@exept.de>
parents: 1109
diff changeset
   301
!
4629726c308a #OTHER by exept
Claus Gittinger <cg@exept.de>
parents: 1109
diff changeset
   302
642
540746b98a34 class: JavaScriptFunctionNode
Claus Gittinger <cg@exept.de>
parents: 595
diff changeset
   303
messageSelectorsDo:aBlock
540746b98a34 class: JavaScriptFunctionNode
Claus Gittinger <cg@exept.de>
parents: 595
diff changeset
   304
    "evaluate aBlock for each message-selector sent by this node and subnodes"
540746b98a34 class: JavaScriptFunctionNode
Claus Gittinger <cg@exept.de>
parents: 595
diff changeset
   305
1201
045c36ec4fa4 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 1182
diff changeset
   306
    statements notNil ifTrue:[
045c36ec4fa4 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 1182
diff changeset
   307
        statements allMessageSelectorsDo:aBlock
045c36ec4fa4 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 1182
diff changeset
   308
    ].
642
540746b98a34 class: JavaScriptFunctionNode
Claus Gittinger <cg@exept.de>
parents: 595
diff changeset
   309
540746b98a34 class: JavaScriptFunctionNode
Claus Gittinger <cg@exept.de>
parents: 595
diff changeset
   310
    "Created: / 24-07-2010 / 21:42:25 / cg"
540746b98a34 class: JavaScriptFunctionNode
Claus Gittinger <cg@exept.de>
parents: 595
diff changeset
   311
!
540746b98a34 class: JavaScriptFunctionNode
Claus Gittinger <cg@exept.de>
parents: 595
diff changeset
   312
477
8a0be6a3d1ce #messagesDo:
Claus Gittinger <cg@exept.de>
parents: 240
diff changeset
   313
messagesDo:aBlock
642
540746b98a34 class: JavaScriptFunctionNode
Claus Gittinger <cg@exept.de>
parents: 595
diff changeset
   314
    "evaluate aBlock for each message-node sent by this node and subnodes"
540746b98a34 class: JavaScriptFunctionNode
Claus Gittinger <cg@exept.de>
parents: 595
diff changeset
   315
964
e6f9b943d4b9 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 913
diff changeset
   316
    statements notNil ifTrue:[
1201
045c36ec4fa4 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 1182
diff changeset
   317
        statements allMessagesDo:aBlock
964
e6f9b943d4b9 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 913
diff changeset
   318
    ].
477
8a0be6a3d1ce #messagesDo:
Claus Gittinger <cg@exept.de>
parents: 240
diff changeset
   319
8a0be6a3d1ce #messagesDo:
Claus Gittinger <cg@exept.de>
parents: 240
diff changeset
   320
    "Created: / 24-07-2010 / 21:42:25 / cg"
646
5f8020cedfc2 class: JavaScriptFunctionNode
Claus Gittinger <cg@exept.de>
parents: 642
diff changeset
   321
!
5f8020cedfc2 class: JavaScriptFunctionNode
Claus Gittinger <cg@exept.de>
parents: 642
diff changeset
   322
1114
4629726c308a #OTHER by exept
Claus Gittinger <cg@exept.de>
parents: 1109
diff changeset
   323
statementsDo:aBlock
4629726c308a #OTHER by exept
Claus Gittinger <cg@exept.de>
parents: 1109
diff changeset
   324
    self statements:statements do:aBlock
4629726c308a #OTHER by exept
Claus Gittinger <cg@exept.de>
parents: 1109
diff changeset
   325
!
4629726c308a #OTHER by exept
Claus Gittinger <cg@exept.de>
parents: 1109
diff changeset
   326
646
5f8020cedfc2 class: JavaScriptFunctionNode
Claus Gittinger <cg@exept.de>
parents: 642
diff changeset
   327
variableNodesDo:aBlock
1061
47890d5fed94 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
   328
    "evaluate aBlock for each variable-node in this node and subnodes;
47890d5fed94 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
   329
     that is: all references to any variable inside the code"
646
5f8020cedfc2 class: JavaScriptFunctionNode
Claus Gittinger <cg@exept.de>
parents: 642
diff changeset
   330
5f8020cedfc2 class: JavaScriptFunctionNode
Claus Gittinger <cg@exept.de>
parents: 642
diff changeset
   331
    statements variableNodesDo:aBlock
5f8020cedfc2 class: JavaScriptFunctionNode
Claus Gittinger <cg@exept.de>
parents: 642
diff changeset
   332
5f8020cedfc2 class: JavaScriptFunctionNode
Claus Gittinger <cg@exept.de>
parents: 642
diff changeset
   333
    "Created: / 24-07-2010 / 21:42:25 / cg"
1061
47890d5fed94 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
   334
    "Modified (comment): / 14-02-2019 / 11:09:34 / Claus Gittinger"
477
8a0be6a3d1ce #messagesDo:
Claus Gittinger <cg@exept.de>
parents: 240
diff changeset
   335
! !
8a0be6a3d1ce #messagesDo:
Claus Gittinger <cg@exept.de>
parents: 240
diff changeset
   336
19
0cd657e48809 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6
diff changeset
   337
!JavaScriptFunctionNode methodsFor:'evaluation'!
0cd657e48809 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6
diff changeset
   338
732
644dfb2cfdce class: JavaScriptFunctionNode
Claus Gittinger <cg@exept.de>
parents: 720
diff changeset
   339
value
644dfb2cfdce class: JavaScriptFunctionNode
Claus Gittinger <cg@exept.de>
parents: 720
diff changeset
   340
    ^ self valueWithReceiver:nil arguments:#()
644dfb2cfdce class: JavaScriptFunctionNode
Claus Gittinger <cg@exept.de>
parents: 720
diff changeset
   341
!
644dfb2cfdce class: JavaScriptFunctionNode
Claus Gittinger <cg@exept.de>
parents: 720
diff changeset
   342
644dfb2cfdce class: JavaScriptFunctionNode
Claus Gittinger <cg@exept.de>
parents: 720
diff changeset
   343
value:arg
849
e6046ed9ce57 class: JavaScriptFunctionNode
Claus Gittinger <cg@exept.de>
parents: 845
diff changeset
   344
    <context: #return>
e6046ed9ce57 class: JavaScriptFunctionNode
Claus Gittinger <cg@exept.de>
parents: 845
diff changeset
   345
732
644dfb2cfdce class: JavaScriptFunctionNode
Claus Gittinger <cg@exept.de>
parents: 720
diff changeset
   346
    ^ self valueWithReceiver:nil arguments:{ arg }
644dfb2cfdce class: JavaScriptFunctionNode
Claus Gittinger <cg@exept.de>
parents: 720
diff changeset
   347
!
644dfb2cfdce class: JavaScriptFunctionNode
Claus Gittinger <cg@exept.de>
parents: 720
diff changeset
   348
644dfb2cfdce class: JavaScriptFunctionNode
Claus Gittinger <cg@exept.de>
parents: 720
diff changeset
   349
value:arg1 value:arg2
736
f8fa644b528d class: JavaScriptFunctionNode
Claus Gittinger <cg@exept.de>
parents: 732
diff changeset
   350
    ^ self valueWithReceiver:environment "nil" arguments:{ arg1 . arg2 }
732
644dfb2cfdce class: JavaScriptFunctionNode
Claus Gittinger <cg@exept.de>
parents: 720
diff changeset
   351
!
644dfb2cfdce class: JavaScriptFunctionNode
Claus Gittinger <cg@exept.de>
parents: 720
diff changeset
   352
644dfb2cfdce class: JavaScriptFunctionNode
Claus Gittinger <cg@exept.de>
parents: 720
diff changeset
   353
value:arg1 value:arg2 value:arg3  
644dfb2cfdce class: JavaScriptFunctionNode
Claus Gittinger <cg@exept.de>
parents: 720
diff changeset
   354
    ^ self valueWithReceiver:nil arguments:{ arg1 . arg2 . arg3 }
644dfb2cfdce class: JavaScriptFunctionNode
Claus Gittinger <cg@exept.de>
parents: 720
diff changeset
   355
!
644dfb2cfdce class: JavaScriptFunctionNode
Claus Gittinger <cg@exept.de>
parents: 720
diff changeset
   356
644dfb2cfdce class: JavaScriptFunctionNode
Claus Gittinger <cg@exept.de>
parents: 720
diff changeset
   357
value:arg1 value:arg2 value:arg3 value:arg4    
644dfb2cfdce class: JavaScriptFunctionNode
Claus Gittinger <cg@exept.de>
parents: 720
diff changeset
   358
    ^ self valueWithReceiver:nil arguments:{ arg1 . arg2 . arg3 . arg4 }
644dfb2cfdce class: JavaScriptFunctionNode
Claus Gittinger <cg@exept.de>
parents: 720
diff changeset
   359
!
644dfb2cfdce class: JavaScriptFunctionNode
Claus Gittinger <cg@exept.de>
parents: 720
diff changeset
   360
644dfb2cfdce class: JavaScriptFunctionNode
Claus Gittinger <cg@exept.de>
parents: 720
diff changeset
   361
value:arg1 value:arg2 value:arg3 value:arg4 value:arg5     
644dfb2cfdce class: JavaScriptFunctionNode
Claus Gittinger <cg@exept.de>
parents: 720
diff changeset
   362
    ^ self valueWithReceiver:nil arguments:{ arg1 . arg2 . arg3 . arg4 . arg5 }
644dfb2cfdce class: JavaScriptFunctionNode
Claus Gittinger <cg@exept.de>
parents: 720
diff changeset
   363
!
644dfb2cfdce class: JavaScriptFunctionNode
Claus Gittinger <cg@exept.de>
parents: 720
diff changeset
   364
644dfb2cfdce class: JavaScriptFunctionNode
Claus Gittinger <cg@exept.de>
parents: 720
diff changeset
   365
value:arg1 value:arg2 value:arg3 value:arg4 value:arg5 value:arg6      
644dfb2cfdce class: JavaScriptFunctionNode
Claus Gittinger <cg@exept.de>
parents: 720
diff changeset
   366
    ^ self valueWithReceiver:nil arguments:{ arg1 . arg2 . arg3 . arg4 . arg5 . arg6 }
644dfb2cfdce class: JavaScriptFunctionNode
Claus Gittinger <cg@exept.de>
parents: 720
diff changeset
   367
!
644dfb2cfdce class: JavaScriptFunctionNode
Claus Gittinger <cg@exept.de>
parents: 720
diff changeset
   368
644dfb2cfdce class: JavaScriptFunctionNode
Claus Gittinger <cg@exept.de>
parents: 720
diff changeset
   369
value:arg1 value:arg2 value:arg3 value:arg4 value:arg5 value:arg6 value:arg7      
644dfb2cfdce class: JavaScriptFunctionNode
Claus Gittinger <cg@exept.de>
parents: 720
diff changeset
   370
    ^ self valueWithReceiver:nil arguments:{ arg1 . arg2 . arg3 . arg4 . arg5 . arg6 . arg7 }
644dfb2cfdce class: JavaScriptFunctionNode
Claus Gittinger <cg@exept.de>
parents: 720
diff changeset
   371
!
644dfb2cfdce class: JavaScriptFunctionNode
Claus Gittinger <cg@exept.de>
parents: 720
diff changeset
   372
644dfb2cfdce class: JavaScriptFunctionNode
Claus Gittinger <cg@exept.de>
parents: 720
diff changeset
   373
value:arg1 value:arg2 value:arg3 value:arg4 value:arg5 value:arg6 value:arg7 value:arg8     
644dfb2cfdce class: JavaScriptFunctionNode
Claus Gittinger <cg@exept.de>
parents: 720
diff changeset
   374
    ^ self valueWithReceiver:nil arguments:{ arg1 . arg2 . arg3 . arg4 . arg5 . arg6 . arg7 . arg8 }
644dfb2cfdce class: JavaScriptFunctionNode
Claus Gittinger <cg@exept.de>
parents: 720
diff changeset
   375
!
644dfb2cfdce class: JavaScriptFunctionNode
Claus Gittinger <cg@exept.de>
parents: 720
diff changeset
   376
644dfb2cfdce class: JavaScriptFunctionNode
Claus Gittinger <cg@exept.de>
parents: 720
diff changeset
   377
valueWithArguments:args    
644dfb2cfdce class: JavaScriptFunctionNode
Claus Gittinger <cg@exept.de>
parents: 720
diff changeset
   378
    ^ self valueWithReceiver:nil arguments:args
644dfb2cfdce class: JavaScriptFunctionNode
Claus Gittinger <cg@exept.de>
parents: 720
diff changeset
   379
!
644dfb2cfdce class: JavaScriptFunctionNode
Claus Gittinger <cg@exept.de>
parents: 720
diff changeset
   380
19
0cd657e48809 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6
diff changeset
   381
valueWithReceiver:rec arguments:args
736
f8fa644b528d class: JavaScriptFunctionNode
Claus Gittinger <cg@exept.de>
parents: 732
diff changeset
   382
    |oldValues val this|
19
0cd657e48809 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6
diff changeset
   383
0cd657e48809 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6
diff changeset
   384
    (args size ~~ arguments size) ifTrue:[
67
058fd3dad518 js-plain vs. js-in-html handling
Claus Gittinger <cg@exept.de>
parents: 65
diff changeset
   385
        ^ self wrongNumberOfArguments:args size
19
0cd657e48809 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6
diff changeset
   386
    ].
0cd657e48809 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6
diff changeset
   387
    statements isNil ifTrue:[^ nil].
0cd657e48809 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6
diff changeset
   388
0cd657e48809 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6
diff changeset
   389
    oldValues := Array new:(arguments size).
0cd657e48809 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6
diff changeset
   390
    1 to:arguments size do:[:i |
67
058fd3dad518 js-plain vs. js-in-html handling
Claus Gittinger <cg@exept.de>
parents: 65
diff changeset
   391
        oldValues at:i put:(arguments at:i) value.
058fd3dad518 js-plain vs. js-in-html handling
Claus Gittinger <cg@exept.de>
parents: 65
diff changeset
   392
        (arguments at:i) value:(args at:i).
19
0cd657e48809 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6
diff changeset
   393
    ].
0cd657e48809 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6
diff changeset
   394
"/    exitBlock := [:v | 
0cd657e48809 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6
diff changeset
   395
"/        1 to:argArray size do:[:i |
0cd657e48809 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6
diff changeset
   396
"/           ( blockArgs at:i) value:(oldValues at:i)
0cd657e48809 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6
diff changeset
   397
"/        ].
0cd657e48809 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6
diff changeset
   398
"/        ^ v
0cd657e48809 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6
diff changeset
   399
"/    ].
0cd657e48809 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6
diff changeset
   400
1000
e3ce07e6bc1f #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 977
diff changeset
   401
    (rec isNil and:[environment notNil]) ifTrue:[ 
736
f8fa644b528d class: JavaScriptFunctionNode
Claus Gittinger <cg@exept.de>
parents: 732
diff changeset
   402
        "/ another hack
845
31abcd94bdff class: JavaScriptFunctionNode
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
   403
        this := environment _theReceiver.  
736
f8fa644b528d class: JavaScriptFunctionNode
Claus Gittinger <cg@exept.de>
parents: 732
diff changeset
   404
    ] ifFalse:[ 
f8fa644b528d class: JavaScriptFunctionNode
Claus Gittinger <cg@exept.de>
parents: 732
diff changeset
   405
        this := rec.
f8fa644b528d class: JavaScriptFunctionNode
Claus Gittinger <cg@exept.de>
parents: 732
diff changeset
   406
    ].
f8fa644b528d class: JavaScriptFunctionNode
Claus Gittinger <cg@exept.de>
parents: 732
diff changeset
   407
    val := statements evaluateAllIn:(Context new receiver:this).
19
0cd657e48809 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6
diff changeset
   408
0cd657e48809 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6
diff changeset
   409
    1 to:arguments size do:[:i |
67
058fd3dad518 js-plain vs. js-in-html handling
Claus Gittinger <cg@exept.de>
parents: 65
diff changeset
   410
        (arguments at:i) value:(oldValues at:i)
19
0cd657e48809 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6
diff changeset
   411
    ].
0cd657e48809 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6
diff changeset
   412
    ^ val
0cd657e48809 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6
diff changeset
   413
1000
e3ce07e6bc1f #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 977
diff changeset
   414
    "Modified: / 17-05-1998 / 00:53:45 / cg"
e3ce07e6bc1f #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 977
diff changeset
   415
    "Modified: / 14-07-2018 / 09:34:41 / Claus Gittinger"
736
f8fa644b528d class: JavaScriptFunctionNode
Claus Gittinger <cg@exept.de>
parents: 732
diff changeset
   416
!
f8fa644b528d class: JavaScriptFunctionNode
Claus Gittinger <cg@exept.de>
parents: 732
diff changeset
   417
f8fa644b528d class: JavaScriptFunctionNode
Claus Gittinger <cg@exept.de>
parents: 732
diff changeset
   418
wrongNumberOfArguments:numArgsGiven
f8fa644b528d class: JavaScriptFunctionNode
Claus Gittinger <cg@exept.de>
parents: 732
diff changeset
   419
    "report that the number of arguments given does not match the number expected"
f8fa644b528d class: JavaScriptFunctionNode
Claus Gittinger <cg@exept.de>
parents: 732
diff changeset
   420
f8fa644b528d class: JavaScriptFunctionNode
Claus Gittinger <cg@exept.de>
parents: 732
diff changeset
   421
    WrongNumberOfArgumentsError
f8fa644b528d class: JavaScriptFunctionNode
Claus Gittinger <cg@exept.de>
parents: 732
diff changeset
   422
        raiseRequestWith:self
f8fa644b528d class: JavaScriptFunctionNode
Claus Gittinger <cg@exept.de>
parents: 732
diff changeset
   423
        errorString:('function got %1 arg(s) where %2 expected' 
f8fa644b528d class: JavaScriptFunctionNode
Claus Gittinger <cg@exept.de>
parents: 732
diff changeset
   424
                        bindWith:numArgsGiven
f8fa644b528d class: JavaScriptFunctionNode
Claus Gittinger <cg@exept.de>
parents: 732
diff changeset
   425
                        with:arguments size)
19
0cd657e48809 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6
diff changeset
   426
! !
0cd657e48809 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6
diff changeset
   427
0
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   428
!JavaScriptFunctionNode methodsFor:'printing'!
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   429
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   430
printOn:aStream indent:i
1109
0945acea9ddf #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 1099
diff changeset
   431
    |first|
0
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   432
1182
f5c38b72eb4d #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 1114
diff changeset
   433
    (isAsync ? false) ifTrue:[
f5c38b72eb4d #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 1114
diff changeset
   434
        aStream nextPutAll:'async '.
f5c38b72eb4d #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 1114
diff changeset
   435
    ].
0
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   436
    aStream nextPutAll:'function '.
120
28795ec5ba9f preps for anon functions (blocks)
Claus Gittinger <cg@exept.de>
parents: 105
diff changeset
   437
    functionName notNil ifTrue:[ aStream nextPutAll:functionName ].
0
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   438
    aStream nextPutAll:'('.
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   439
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   440
    first := true.
195
897c21f5af81 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 152
diff changeset
   441
    arguments notNil ifTrue:[
897c21f5af81 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 152
diff changeset
   442
        arguments do:[:anArgVar |
897c21f5af81 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 152
diff changeset
   443
            first ifFalse:[aStream nextPutAll:', ' ].
897c21f5af81 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 152
diff changeset
   444
            first := false.
0
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   445
195
897c21f5af81 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 152
diff changeset
   446
            aStream nextPutAll:anArgVar name.
897c21f5af81 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 152
diff changeset
   447
        ].
0
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   448
    ].
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   449
    aStream nextPutAll:')'.
965
30e33820ef0d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 964
diff changeset
   450
    "/ aStream cr.
30e33820ef0d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 964
diff changeset
   451
    aStream space.
0
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   452
    aStream nextPutAll:'{'.
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   453
    locals size > 0 ifTrue:[
120
28795ec5ba9f preps for anon functions (blocks)
Claus Gittinger <cg@exept.de>
parents: 105
diff changeset
   454
        locals do:[:v |
28795ec5ba9f preps for anon functions (blocks)
Claus Gittinger <cg@exept.de>
parents: 105
diff changeset
   455
            aStream cr; spaces:i+4.
28795ec5ba9f preps for anon functions (blocks)
Claus Gittinger <cg@exept.de>
parents: 105
diff changeset
   456
            aStream nextPutAll:'var '; nextPutAll:v name; nextPutAll:';'" ; cr"
28795ec5ba9f preps for anon functions (blocks)
Claus Gittinger <cg@exept.de>
parents: 105
diff changeset
   457
        ].
28795ec5ba9f preps for anon functions (blocks)
Claus Gittinger <cg@exept.de>
parents: 105
diff changeset
   458
        aStream cr.
0
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   459
    ].
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   460
    aStream cr; spaces:i+4.
1109
0945acea9ddf #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 1099
diff changeset
   461
    statements notNil ifTrue:[
0945acea9ddf #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 1099
diff changeset
   462
        statements printStatementListOn:aStream indent:i+4.
0
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   463
    ].
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   464
    aStream cr; spaces:i; nextPutAll:'}'.
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   465
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   466
    "Created: / 14.5.1998 / 21:29:02 / cg"
2
fe9cb4962574 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   467
    "Modified: / 15.5.1998 / 15:06:40 / cg"
0
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   468
! !
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   469
38
d055d9ff4b71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 30
diff changeset
   470
!JavaScriptFunctionNode methodsFor:'queries'!
d055d9ff4b71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 30
diff changeset
   471
67
058fd3dad518 js-plain vs. js-in-html handling
Claus Gittinger <cg@exept.de>
parents: 65
diff changeset
   472
_isFunctionEnvironment
058fd3dad518 js-plain vs. js-in-html handling
Claus Gittinger <cg@exept.de>
parents: 65
diff changeset
   473
    ^ true
058fd3dad518 js-plain vs. js-in-html handling
Claus Gittinger <cg@exept.de>
parents: 65
diff changeset
   474
!
058fd3dad518 js-plain vs. js-in-html handling
Claus Gittinger <cg@exept.de>
parents: 65
diff changeset
   475
65
d69784e5e9b3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 62
diff changeset
   476
_isHTMLEnvironment
d69784e5e9b3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 62
diff changeset
   477
    ^ false
124
e09d8d40d799 inner functions
Claus Gittinger <cg@exept.de>
parents: 120
diff changeset
   478
!
e09d8d40d799 inner functions
Claus Gittinger <cg@exept.de>
parents: 120
diff changeset
   479
595
3632dc27721c JavaScript
Claus Gittinger <cg@exept.de>
parents: 594
diff changeset
   480
home
3632dc27721c JavaScript
Claus Gittinger <cg@exept.de>
parents: 594
diff changeset
   481
    ^ nil
1053
2274ce3ad70c #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 1000
diff changeset
   482
!
2274ce3ad70c #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 1000
diff changeset
   483
2274ce3ad70c #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 1000
diff changeset
   484
isFunctionNode
2274ce3ad70c #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 1000
diff changeset
   485
    ^ true
2274ce3ad70c #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 1000
diff changeset
   486
2274ce3ad70c #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 1000
diff changeset
   487
    "Created: / 08-02-2019 / 10:53:49 / Claus Gittinger"
977
4c5580b6e31e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 972
diff changeset
   488
! !
4c5580b6e31e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 972
diff changeset
   489
4c5580b6e31e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 972
diff changeset
   490
!JavaScriptFunctionNode methodsFor:'testing'!
595
3632dc27721c JavaScript
Claus Gittinger <cg@exept.de>
parents: 594
diff changeset
   491
3632dc27721c JavaScript
Claus Gittinger <cg@exept.de>
parents: 594
diff changeset
   492
isInlineBlock
3632dc27721c JavaScript
Claus Gittinger <cg@exept.de>
parents: 594
diff changeset
   493
    ^ false
38
d055d9ff4b71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 30
diff changeset
   494
! !
d055d9ff4b71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 30
diff changeset
   495
653
c548a53fc974 Added JavaScriptParseNodeVisitor
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 646
diff changeset
   496
!JavaScriptFunctionNode methodsFor:'visiting'!
c548a53fc974 Added JavaScriptParseNodeVisitor
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 646
diff changeset
   497
c548a53fc974 Added JavaScriptParseNodeVisitor
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 646
diff changeset
   498
acceptVisitor:visitor 
c548a53fc974 Added JavaScriptParseNodeVisitor
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 646
diff changeset
   499
    "Double dispatch back to the visitor, passing my type encoded in
c548a53fc974 Added JavaScriptParseNodeVisitor
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 646
diff changeset
   500
     the selector (visitor pattern)"
c548a53fc974 Added JavaScriptParseNodeVisitor
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 646
diff changeset
   501
c548a53fc974 Added JavaScriptParseNodeVisitor
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 646
diff changeset
   502
    "stub code automatically generated - please change if required"
c548a53fc974 Added JavaScriptParseNodeVisitor
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 646
diff changeset
   503
c548a53fc974 Added JavaScriptParseNodeVisitor
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 646
diff changeset
   504
    ^ visitor visitJavaScriptFunctionNode:self 
c548a53fc974 Added JavaScriptParseNodeVisitor
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 646
diff changeset
   505
! !
c548a53fc974 Added JavaScriptParseNodeVisitor
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 646
diff changeset
   506
0
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   507
!JavaScriptFunctionNode class methodsFor:'documentation'!
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   508
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   509
version
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   510
    ^ '$Header$'
477
8a0be6a3d1ce #messagesDo:
Claus Gittinger <cg@exept.de>
parents: 240
diff changeset
   511
!
8a0be6a3d1ce #messagesDo:
Claus Gittinger <cg@exept.de>
parents: 240
diff changeset
   512
8a0be6a3d1ce #messagesDo:
Claus Gittinger <cg@exept.de>
parents: 240
diff changeset
   513
version_CVS
8a0be6a3d1ce #messagesDo:
Claus Gittinger <cg@exept.de>
parents: 240
diff changeset
   514
    ^ '$Header$'
0
97b4fe7a0b2d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   515
! !
594
43ffe08fd1bc class: JavaScriptFunctionNode
Claus Gittinger <cg@exept.de>
parents: 477
diff changeset
   516