Parcourir la source

Fixed issue #29

Nicolas Petton il y a 13 ans
Parent
commit
2fed727571
3 fichiers modifiés avec 7 ajouts et 6 suppressions
  1. 0 1
      js/Compiler.deploy.js
  2. 0 1
      js/Compiler.js
  3. 7 4
      st/Compiler.st

Fichier diff supprimé car celui-ci est trop grand
+ 0 - 1
js/Compiler.deploy.js


Fichier diff supprimé car celui-ci est trop grand
+ 0 - 1
js/Compiler.js


+ 7 - 4
st/Compiler.st

@@ -960,9 +960,12 @@ visitVariableNode: aNode
 	(self currentClass allInstanceVariableNames includes: aNode value) 
 		ifTrue: [stream nextPutAll: 'self[''@', aNode value, ''']']
 		ifFalse: [
-			(self knownVariables includes: aNode value) ifFalse: [
-				unknownVariables add: aNode value].
-			stream nextPutAll: aNode value]
+			(self knownVariables includes: aNode value) 
+                  		ifFalse: [
+					unknownVariables add: aNode value.
+					stream nextPutAll: '(typeof ', aNode value, ' == ''undefined'' ? nil : ', aNode value, ')']
+                		ifTrue: [
+                                	stream nextPutAll: aNode value]]
 !
 
 visitJSStatementNode: aNode
@@ -1023,6 +1026,6 @@ Object subclass: #DoIt
 
 !DoIt methodsFor: ''!
 
-doIt ^[[Object new] compiledSource] value
+doIt ^[Compiler new recompile: Browser] value
 ! !
 

Certains fichiers n'ont pas été affichés car il y a eu trop de fichiers modifiés dans ce diff