|
@@ -2819,40 +2819,6 @@ $globals.TabWidget.a$cls);
|
|
|
|
|
|
|
|
|
|
$core.addClass("Browser", $globals.TabWidget, ["selectedPackage", "selectedClass", "selectedProtocol", "selectedMethod", "packagesList", "classesList", "protocolsList", "methodsList", "sourceArea", "tabsList", "selectedTab", "saveButton", "classButtons", "methodButtons", "unsavedChanges"], "IDE");
|
|
$core.addClass("Browser", $globals.TabWidget, ["selectedPackage", "selectedClass", "selectedProtocol", "selectedMethod", "packagesList", "classesList", "protocolsList", "methodsList", "sourceArea", "tabsList", "selectedTab", "saveButton", "classButtons", "methodButtons", "unsavedChanges"], "IDE");
|
|
-$core.addMethod(
|
|
|
|
-$core.method({
|
|
|
|
-selector: "addInstanceVariableNamed:toClass:",
|
|
|
|
-protocol: "actions",
|
|
|
|
-fn: function (aString,aClass){
|
|
|
|
-var self=this,$self=this;
|
|
|
|
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
|
-return $core.withContext(function($ctx1) {
|
|
|
|
-//>>excludeEnd("ctx");
|
|
|
|
-var $1,$2,$3,$5,$4;
|
|
|
|
-$1=$recv($globals.ClassBuilder)._new();
|
|
|
|
-$2=$recv(aClass)._superclass();
|
|
|
|
-$3=$recv(aClass)._name();
|
|
|
|
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
|
-$ctx1.sendIdx["name"]=1;
|
|
|
|
-//>>excludeEnd("ctx");
|
|
|
|
-$5=$recv($recv(aClass)._instanceVariableNames())._copy();
|
|
|
|
-$recv($5)._add_(aString);
|
|
|
|
-$4=$recv($5)._yourself();
|
|
|
|
-$recv($1)._addSubclassOf_named_instanceVariableNames_package_($2,$3,$4,$recv($recv(aClass)._package())._name());
|
|
|
|
-return self;
|
|
|
|
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
|
-}, function($ctx1) {$ctx1.fill(self,"addInstanceVariableNamed:toClass:",{aString:aString,aClass:aClass},$globals.Browser)});
|
|
|
|
-//>>excludeEnd("ctx");
|
|
|
|
-},
|
|
|
|
-//>>excludeStart("ide", pragmas.excludeIdeData);
|
|
|
|
-args: ["aString", "aClass"],
|
|
|
|
-source: "addInstanceVariableNamed: aString toClass: aClass\x0a\x09ClassBuilder new\x0a\x09\x09addSubclassOf: aClass superclass\x0a\x09\x09named: aClass name\x0a\x09\x09instanceVariableNames: (aClass instanceVariableNames copy add: aString; yourself)\x0a\x09\x09package: aClass package name",
|
|
|
|
-referencedClasses: ["ClassBuilder"],
|
|
|
|
-//>>excludeEnd("ide");
|
|
|
|
-messageSends: ["addSubclassOf:named:instanceVariableNames:package:", "new", "superclass", "name", "add:", "copy", "instanceVariableNames", "yourself", "package"]
|
|
|
|
-}),
|
|
|
|
-$globals.Browser);
|
|
|
|
-
|
|
|
|
$core.addMethod(
|
|
$core.addMethod(
|
|
$core.method({
|
|
$core.method({
|
|
selector: "addNewClass",
|
|
selector: "addNewClass",
|
|
@@ -3252,7 +3218,7 @@ var compiler,package_,method,compiledSource,source,node;
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
return $core.withContext(function($ctx1) {
|
|
return $core.withContext(function($ctx1) {
|
|
//>>excludeEnd("ctx");
|
|
//>>excludeEnd("ctx");
|
|
-var $1,$2,$4,$3,$8,$7,$6,$5,$receiver;
|
|
|
|
|
|
+var $1,$2,$4,$3,$8,$7,$6,$5,$9,$receiver;
|
|
var $early={};
|
|
var $early={};
|
|
try {
|
|
try {
|
|
source=$recv($self["@sourceArea"])._val();
|
|
source=$recv($self["@sourceArea"])._val();
|
|
@@ -3324,7 +3290,11 @@ $ctx2.sendIdx[","]=2;
|
|
//>>excludeEnd("ctx");
|
|
//>>excludeEnd("ctx");
|
|
$5=$recv($globals.Terminal)._confirm_($6);
|
|
$5=$recv($globals.Terminal)._confirm_($6);
|
|
if($core.assert($5)){
|
|
if($core.assert($5)){
|
|
-$self._addInstanceVariableNamed_toClass_($recv(e)._variableName(),aClass);
|
|
|
|
|
|
+$9=$recv($globals.Environment)._new();
|
|
|
|
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
|
+$ctx2.sendIdx["new"]=2;
|
|
|
|
+//>>excludeEnd("ctx");
|
|
|
|
+$recv($9)._addInstVarNamed_to_($recv(e)._variableName(),aClass);
|
|
throw $early=[$self._compileMethodDefinitionFor_(aClass)];
|
|
throw $early=[$self._compileMethodDefinitionFor_(aClass)];
|
|
} else {
|
|
} else {
|
|
throw $early=[nil];
|
|
throw $early=[nil];
|
|
@@ -3347,10 +3317,10 @@ catch(e) {if(e===$early)return e[0]; throw e}
|
|
},
|
|
},
|
|
//>>excludeStart("ide", pragmas.excludeIdeData);
|
|
//>>excludeStart("ide", pragmas.excludeIdeData);
|
|
args: ["aClass"],
|
|
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\x09[ node := compiler parse: source ]\x0a\x09on: ParseError do: [ :e |\x0a\x09^ Terminal alert: 'PARSE ERROR: ', e messageText ].\x0a\x09package := aClass packageOfProtocol: selectedProtocol.\x0a\x09[ compiledSource := compiler compileNode: node forClass: aClass package: package ]\x0a\x09on: UnknownVariableError do: [ :e |\x0a\x09\x09\x22Do not try to redeclare javascript's objects\x22\x0a\x09\x09(Platform includesGlobal: e variableName) ifFalse: [\x0a\x09\x09(Terminal confirm: 'Declare ''', e variableName, ''' as instance variable?') ifFalse: [ ^ nil ] ifTrue: [\x0a\x09\x09\x09self addInstanceVariableNamed: e variableName toClass: aClass.\x0a\x09\x09\x09^ self compileMethodDefinitionFor: aClass ]] ].\x0a\x09method := compiler eval: compiledSource forPackage: package.\x0a\x09ClassBuilder new installMethod: method forClass: aClass protocol: selectedProtocol.\x0a\x09self updateMethodsList.\x0a\x09self selectMethod: method",
|
|
|
|
-referencedClasses: ["Compiler", "ParseError", "Terminal", "UnknownVariableError", "Platform", "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\x09[ node := compiler parse: source ]\x0a\x09on: ParseError do: [ :e |\x0a\x09^ Terminal alert: 'PARSE ERROR: ', e messageText ].\x0a\x09package := aClass packageOfProtocol: selectedProtocol.\x0a\x09[ compiledSource := compiler compileNode: node forClass: aClass package: package ]\x0a\x09on: UnknownVariableError do: [ :e |\x0a\x09\x09\x22Do not try to redeclare javascript's objects\x22\x0a\x09\x09(Platform includesGlobal: e variableName) ifFalse: [\x0a\x09\x09(Terminal confirm: 'Declare ''', e variableName, ''' as instance variable?') ifFalse: [ ^ nil ] ifTrue: [\x0a\x09\x09\x09Environment new addInstVarNamed: e variableName to: aClass.\x0a\x09\x09\x09^ self compileMethodDefinitionFor: aClass ]] ].\x0a\x09method := compiler eval: compiledSource forPackage: package.\x0a\x09ClassBuilder new installMethod: method forClass: aClass protocol: selectedProtocol.\x0a\x09self updateMethodsList.\x0a\x09self selectMethod: method",
|
|
|
|
+referencedClasses: ["Compiler", "ParseError", "Terminal", "UnknownVariableError", "Platform", "Environment", "ClassBuilder"],
|
|
//>>excludeEnd("ide");
|
|
//>>excludeEnd("ide");
|
|
-messageSends: ["val", "ifNil:", "protocol", "new", "source:", "on:do:", "parse:", "alert:", ",", "messageText", "packageOfProtocol:", "compileNode:forClass:package:", "ifFalse:", "includesGlobal:", "variableName", "ifFalse:ifTrue:", "confirm:", "addInstanceVariableNamed:toClass:", "compileMethodDefinitionFor:", "eval:forPackage:", "installMethod:forClass:protocol:", "updateMethodsList", "selectMethod:"]
|
|
|
|
|
|
+messageSends: ["val", "ifNil:", "protocol", "new", "source:", "on:do:", "parse:", "alert:", ",", "messageText", "packageOfProtocol:", "compileNode:forClass:package:", "ifFalse:", "includesGlobal:", "variableName", "ifFalse:ifTrue:", "confirm:", "addInstVarNamed:to:", "compileMethodDefinitionFor:", "eval:forPackage:", "installMethod:forClass:protocol:", "updateMethodsList", "selectMethod:"]
|
|
}),
|
|
}),
|
|
$globals.Browser);
|
|
$globals.Browser);
|
|
|
|
|