Bladeren bron

PlatformInterface existsGlobal: -> Smalltalk existsJsGlobal:

Herbert Vojčík 9 jaren geleden
bovenliggende
commit
e10b804033
2 gewijzigde bestanden met toevoegingen van 6 en 6 verwijderingen
  1. 5 5
      src/IDE.js
  2. 1 1
      src/IDE.st

+ 5 - 5
src/IDE.js

@@ -3454,7 +3454,7 @@ fn: function (aClass){
 var self=this;
 var compiler,package_,method,compiledSource,source,node;
 function $Compiler(){return $globals.Compiler||(typeof Compiler=="undefined"?nil:Compiler)}
-function $PlatformInterface(){return $globals.PlatformInterface||(typeof PlatformInterface=="undefined"?nil:PlatformInterface)}
+function $Smalltalk(){return $globals.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
 function $ClassBuilder(){return $globals.ClassBuilder||(typeof ClassBuilder=="undefined"?nil:ClassBuilder)}
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
@@ -3500,7 +3500,7 @@ $recv($recv(compiler)._unknownVariables())._do_((function(each){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
-$7=$recv($PlatformInterface())._existsGlobal_(each);
+$7=$recv($Smalltalk())._existsJsGlobal_(each);
 if(!$core.assert($7)){
 $9=$recv("Declare '".__comma(each)).__comma("' as instance variable?");
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -3529,10 +3529,10 @@ catch(e) {if(e===$early)return e[0]; throw e}
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: ["aClass"],
-source: "compileMethodDefinitionFor: aClass\x0a\x09| compiler package method compiledSource source node |\x0a\x09source := sourceArea val.\x0a\x09selectedProtocol ifNil: [ selectedProtocol := selectedMethod protocol ].\x0a\x09compiler := Compiler new.\x0a\x09compiler source: source.\x0a\x09node := compiler parse: source.\x0a\x09node isParseFailure ifTrue: [\x0a\x09^ self alert: 'PARSE ERROR: ', node reason, ', position: ', node position asString ].\x0a\x09package := aClass packageOfProtocol: selectedProtocol.\x0a\x09compiledSource := compiler compileNode: node forClass: aClass package: package.\x0a\x09method := compiler eval: compiledSource forPackage: package.\x0a\x09compiler unknownVariables do: [ :each |\x0a\x09\x09\x22Do not try to redeclare javascript's objects\x22\x0a\x09\x09(PlatformInterface existsGlobal: each) ifFalse: [\x0a\x09\x09(self confirm: 'Declare ''', each, ''' as instance variable?') ifTrue: [\x0a\x09\x09\x09self addInstanceVariableNamed: each toClass: aClass.\x0a\x09\x09\x09^ self compileMethodDefinitionFor: aClass ]] ].\x0a\x09ClassBuilder new installMethod: method forClass: aClass protocol: selectedProtocol.\x0a\x09self updateMethodsList.\x0a\x09self selectMethod: method",
-referencedClasses: ["Compiler", "PlatformInterface", "ClassBuilder"],
+source: "compileMethodDefinitionFor: aClass\x0a\x09| compiler package method compiledSource source node |\x0a\x09source := sourceArea val.\x0a\x09selectedProtocol ifNil: [ selectedProtocol := selectedMethod protocol ].\x0a\x09compiler := Compiler new.\x0a\x09compiler source: source.\x0a\x09node := compiler parse: source.\x0a\x09node isParseFailure ifTrue: [\x0a\x09^ self alert: 'PARSE ERROR: ', node reason, ', position: ', node position asString ].\x0a\x09package := aClass packageOfProtocol: selectedProtocol.\x0a\x09compiledSource := compiler compileNode: node forClass: aClass package: package.\x0a\x09method := compiler eval: compiledSource forPackage: package.\x0a\x09compiler unknownVariables do: [ :each |\x0a\x09\x09\x22Do not try to redeclare javascript's objects\x22\x0a\x09\x09(Smalltalk existsJsGlobal: each) ifFalse: [\x0a\x09\x09(self confirm: 'Declare ''', each, ''' as instance variable?') ifTrue: [\x0a\x09\x09\x09self addInstanceVariableNamed: each toClass: aClass.\x0a\x09\x09\x09^ self compileMethodDefinitionFor: aClass ]] ].\x0a\x09ClassBuilder new installMethod: method forClass: aClass protocol: selectedProtocol.\x0a\x09self updateMethodsList.\x0a\x09self selectMethod: method",
+referencedClasses: ["Compiler", "Smalltalk", "ClassBuilder"],
 //>>excludeEnd("ide");
-messageSends: ["val", "ifNil:", "protocol", "new", "source:", "parse:", "ifTrue:", "isParseFailure", "alert:", ",", "reason", "asString", "position", "packageOfProtocol:", "compileNode:forClass:package:", "eval:forPackage:", "do:", "unknownVariables", "ifFalse:", "existsGlobal:", "confirm:", "addInstanceVariableNamed:toClass:", "compileMethodDefinitionFor:", "installMethod:forClass:protocol:", "updateMethodsList", "selectMethod:"]
+messageSends: ["val", "ifNil:", "protocol", "new", "source:", "parse:", "ifTrue:", "isParseFailure", "alert:", ",", "reason", "asString", "position", "packageOfProtocol:", "compileNode:forClass:package:", "eval:forPackage:", "do:", "unknownVariables", "ifFalse:", "existsJsGlobal:", "confirm:", "addInstanceVariableNamed:toClass:", "compileMethodDefinitionFor:", "installMethod:forClass:protocol:", "updateMethodsList", "selectMethod:"]
 }),
 $globals.Browser);
 

+ 1 - 1
src/IDE.st

@@ -870,7 +870,7 @@ compileMethodDefinitionFor: aClass
 	method := compiler eval: compiledSource forPackage: package.
 	compiler unknownVariables do: [ :each |
 		"Do not try to redeclare javascript's objects"
-		(PlatformInterface existsGlobal: each) ifFalse: [
+		(Smalltalk existsJsGlobal: each) ifFalse: [
 		(self confirm: 'Declare ''', each, ''' as instance variable?') ifTrue: [
 			self addInstanceVariableNamed: each toClass: aClass.
 			^ self compileMethodDefinitionFor: aClass ]] ].