Explorar o código

Do not reference `window' in SemanticAnalyzer

Nicolas Petton %!s(int64=12) %!d(string=hai) anos
pai
achega
c5ec3b2969
Modificáronse 3 ficheiros con 625 adicións e 633 borrados
  1. 309 315
      js/Compiler-Semantic.deploy.js
  2. 309 315
      js/Compiler-Semantic.js
  3. 7 3
      st/Compiler-Semantic.st

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 309 - 315
js/Compiler-Semantic.deploy.js


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 309 - 315
js/Compiler-Semantic.js


+ 7 - 3
st/Compiler-Semantic.st

@@ -408,12 +408,16 @@ errorShadowingVariable: aString
 errorUnknownVariable: aNode
 errorUnknownVariable: aNode
 	"Throw an error if the variable is undeclared in the global JS scope (i.e. window)"
 	"Throw an error if the variable is undeclared in the global JS scope (i.e. window)"
 
 
-	(window at: aNode value) 
-		ifNil: [ 
+	| notDefined |
+
+	notDefined := <eval('typeof ' + aNode._value() + ' == "undefined"')>.
+
+	notDefined
+		ifTrue: [ 
 			UnknownVariableError new
 			UnknownVariableError new
 				variableName: aNode value;
 				variableName: aNode value;
 				signal ]
 				signal ]
-		ifNotNil: [
+		ifFalse: [
 			currentScope methodScope unknownVariables add: aNode value. ]
 			currentScope methodScope unknownVariables add: aNode value. ]
 ! !
 ! !
 
 

Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio