浏览代码

Fixed issue #29

Nicolas Petton 13 年之前
父节点
当前提交
2fed727571
共有 3 个文件被更改,包括 7 次插入6 次删除
  1. 0 1
      js/Compiler.deploy.js
  2. 0 1
      js/Compiler.js
  3. 7 4
      st/Compiler.st

文件差异内容过多而无法显示
+ 0 - 1
js/Compiler.deploy.js


文件差异内容过多而无法显示
+ 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
 ! !
 

部分文件因为文件数量过多而无法显示