|
@@ -412,7 +412,7 @@ visitJSStatementNode: aNode
|
|
! !
|
|
! !
|
|
|
|
|
|
NodeVisitor subclass: #Compiler
|
|
NodeVisitor subclass: #Compiler
|
|
- instanceVariableNames: 'stream nestedBlocks earlyReturn currentClass currentSelector unknownVariables tempVariables messageSends referencedClasses'
|
|
|
|
|
|
+ instanceVariableNames: 'stream nestedBlocks earlyReturn currentClass currentSelector unknownVariables tempVariables messageSends referencedClasses classReferenced'
|
|
category: 'Compiler'!
|
|
category: 'Compiler'!
|
|
|
|
|
|
!Compiler methodsFor: 'accessing'!
|
|
!Compiler methodsFor: 'accessing'!
|
|
@@ -524,7 +524,7 @@ setupClass: aClass
|
|
|
|
|
|
initialize
|
|
initialize
|
|
super initialize.
|
|
super initialize.
|
|
- stream := '' writeStream.
|
|
|
|
|
|
+ stream := '' writeStream.
|
|
unknownVariables := #().
|
|
unknownVariables := #().
|
|
tempVariables := #().
|
|
tempVariables := #().
|
|
messageSends := #().
|
|
messageSends := #().
|
|
@@ -969,7 +969,7 @@ visitVariableNode: aNode
|
|
ifFalse: [
|
|
ifFalse: [
|
|
unknownVariables add: aNode value.
|
|
unknownVariables add: aNode value.
|
|
aNode assigned
|
|
aNode assigned
|
|
- ifTrue: [stream nextPutAll: '(', aNode value, ' || nil)']
|
|
|
|
|
|
+ ifTrue: [stream nextPutAll: aNode value]
|
|
ifFalse: [stream nextPutAll: '(typeof ', aNode value, ' == ''undefined'' ? nil : ', aNode value, ')']]
|
|
ifFalse: [stream nextPutAll: '(typeof ', aNode value, ' == ''undefined'' ? nil : ', aNode value, ')']]
|
|
ifTrue: [
|
|
ifTrue: [
|
|
stream nextPutAll:aNode value]]
|
|
stream nextPutAll:aNode value]]
|