|
@@ -533,14 +533,14 @@ compileMethodDefinitionFor: aClass
|
|
compiler source: source.
|
|
compiler source: source.
|
|
node := compiler parse: source.
|
|
node := compiler parse: source.
|
|
node isParseFailure ifTrue: [
|
|
node isParseFailure ifTrue: [
|
|
- ^self alert: 'PARSE ERROR: ', node reason, ', position: ', node position asString].
|
|
|
|
|
|
+ ^window alert: 'PARSE ERROR: ', node reason, ', position: ', node position asString].
|
|
compiler currentClass: aClass.
|
|
compiler currentClass: aClass.
|
|
method := compiler eval: (compiler compileNode: node).
|
|
method := compiler eval: (compiler compileNode: node).
|
|
method category: selectedProtocol.
|
|
method category: selectedProtocol.
|
|
compiler unknownVariables do: [:each |
|
|
compiler unknownVariables do: [:each |
|
|
"Do not try to redeclare javascript's objects"
|
|
"Do not try to redeclare javascript's objects"
|
|
(window at: each) ifNil: [
|
|
(window at: each) ifNil: [
|
|
- (self confirm: 'Declare ''', each, ''' as instance variable?') ifTrue: [
|
|
|
|
|
|
+ (window confirm: 'Declare ''', each, ''' as instance variable?') ifTrue: [
|
|
self addInstanceVariableNamed: each toClass: aClass.
|
|
self addInstanceVariableNamed: each toClass: aClass.
|
|
^self compileMethodDefinitionFor: aClass]]].
|
|
^self compileMethodDefinitionFor: aClass]]].
|
|
aClass addCompiledMethod: method.
|
|
aClass addCompiledMethod: method.
|
|
@@ -561,12 +561,12 @@ compileDefinition
|
|
|
|
|
|
cancelChanges
|
|
cancelChanges
|
|
^unsavedChanges
|
|
^unsavedChanges
|
|
- ifTrue: [self confirm: 'Cancel changes?']
|
|
|
|
|
|
+ ifTrue: [window confirm: 'Cancel changes?']
|
|
ifFalse: [true]
|
|
ifFalse: [true]
|
|
!
|
|
!
|
|
|
|
|
|
removeClass
|
|
removeClass
|
|
- (self confirm: 'Do you really want to remove ', selectedClass name, '?')
|
|
|
|
|
|
+ (window confirm: 'Do you really want to remove ', selectedClass name, '?')
|
|
ifTrue: [
|
|
ifTrue: [
|
|
Smalltalk current removeClass: selectedClass.
|
|
Smalltalk current removeClass: selectedClass.
|
|
self resetClassesList.
|
|
self resetClassesList.
|
|
@@ -575,7 +575,7 @@ removeClass
|
|
|
|
|
|
removeMethod
|
|
removeMethod
|
|
self cancelChanges ifTrue: [
|
|
self cancelChanges ifTrue: [
|
|
- (self confirm: 'Do you really want to remove #', selectedMethod selector, '?')
|
|
|
|
|
|
+ (window confirm: 'Do you really want to remove #', selectedMethod selector, '?')
|
|
ifTrue: [
|
|
ifTrue: [
|
|
selectedTab = #instance
|
|
selectedTab = #instance
|
|
ifTrue: [selectedClass removeCompiledMethod: selectedMethod]
|
|
ifTrue: [selectedClass removeCompiledMethod: selectedMethod]
|
|
@@ -599,7 +599,7 @@ setMethodProtocol: aString
|
|
|
|
|
|
addNewProtocol
|
|
addNewProtocol
|
|
| newProtocol |
|
|
| newProtocol |
|
|
- newProtocol := self prompt: 'New method protocol'.
|
|
|
|
|
|
+ newProtocol := window prompt: 'New method protocol'.
|
|
(newProtocol notNil and: [newProtocol notEmpty]) ifTrue: [
|
|
(newProtocol notNil and: [newProtocol notEmpty]) ifTrue: [
|
|
selectedMethod category: newProtocol.
|
|
selectedMethod category: newProtocol.
|
|
self setMethodProtocol: newProtocol]
|
|
self setMethodProtocol: newProtocol]
|
|
@@ -657,7 +657,7 @@ selectTab: aString
|
|
|
|
|
|
renameClass
|
|
renameClass
|
|
| newName |
|
|
| newName |
|
|
- newName := self prompt: 'Rename class ', selectedClass name.
|
|
|
|
|
|
+ newName := window prompt: 'Rename class ', selectedClass name.
|
|
(newName notNil and: [newName notEmpty]) ifTrue: [
|
|
(newName notNil and: [newName notEmpty]) ifTrue: [
|
|
selectedClass rename: newName.
|
|
selectedClass rename: newName.
|
|
self
|
|
self
|
|
@@ -707,28 +707,28 @@ commitPackage
|
|
options: #{
|
|
options: #{
|
|
'type' -> 'PUT'.
|
|
'type' -> 'PUT'.
|
|
'data' -> (Exporter new exportPackage: selectedPackage).
|
|
'data' -> (Exporter new exportPackage: selectedPackage).
|
|
- 'error' -> [self alert: 'Commit failed!!']
|
|
|
|
|
|
+ 'error' -> [window alert: 'Commit failed!!']
|
|
}.
|
|
}.
|
|
jQuery
|
|
jQuery
|
|
ajax: self class commitPathJs, '/', selectedPackage, '.deploy.js'
|
|
ajax: self class commitPathJs, '/', selectedPackage, '.deploy.js'
|
|
options: #{
|
|
options: #{
|
|
'type' -> 'PUT'.
|
|
'type' -> 'PUT'.
|
|
'data' -> (StrippedExporter new exportPackage: selectedPackage).
|
|
'data' -> (StrippedExporter new exportPackage: selectedPackage).
|
|
- 'error' -> [self alert: 'Commit failed!!']
|
|
|
|
|
|
+ 'error' -> [window alert: 'Commit failed!!']
|
|
}.
|
|
}.
|
|
jQuery
|
|
jQuery
|
|
ajax: self class commitPathSt, '/', selectedPackage, '.st'
|
|
ajax: self class commitPathSt, '/', selectedPackage, '.st'
|
|
options: #{
|
|
options: #{
|
|
'type' -> 'PUT'.
|
|
'type' -> 'PUT'.
|
|
'data' -> (ChunkExporter new exportPackage: selectedPackage).
|
|
'data' -> (ChunkExporter new exportPackage: selectedPackage).
|
|
- 'error' -> [self alert: 'Commit failed!!']
|
|
|
|
|
|
+ 'error' -> [window alert: 'Commit failed!!']
|
|
}]
|
|
}]
|
|
!
|
|
!
|
|
|
|
|
|
renamePackage
|
|
renamePackage
|
|
|
|
|
|
| newName |
|
|
| newName |
|
|
- newName := self prompt: 'Rename package ', selectedPackage.
|
|
|
|
|
|
+ newName := window prompt: 'Rename package ', selectedPackage.
|
|
newName ifNotNil: [
|
|
newName ifNotNil: [
|
|
newName notEmpty ifTrue: [
|
|
newName notEmpty ifTrue: [
|
|
Smalltalk current renamePackage: selectedPackage to: newName.
|
|
Smalltalk current renamePackage: selectedPackage to: newName.
|
|
@@ -737,7 +737,7 @@ renamePackage
|
|
|
|
|
|
removePackage
|
|
removePackage
|
|
|
|
|
|
- (self confirm: 'Do you really want to remove the whole package ', selectedPackage, ' with all its classes?')
|
|
|
|
|
|
+ (window confirm: 'Do you really want to remove the whole package ', selectedPackage, ' with all its classes?')
|
|
ifTrue: [
|
|
ifTrue: [
|
|
Smalltalk current removePackage: selectedPackage.
|
|
Smalltalk current removePackage: selectedPackage.
|
|
self updateCategoriesList]
|
|
self updateCategoriesList]
|
|
@@ -753,7 +753,7 @@ commitPackageToLocalStorage
|
|
|
|
|
|
addNewClass
|
|
addNewClass
|
|
| className |
|
|
| className |
|
|
- className := self prompt: 'New class'.
|
|
|
|
|
|
+ className := window prompt: 'New class'.
|
|
(className notNil and: [className notEmpty]) ifTrue: [
|
|
(className notNil and: [className notEmpty]) ifTrue: [
|
|
Object subclass: className instanceVariableNames: '' package: self selectedPackage.
|
|
Object subclass: className instanceVariableNames: '' package: self selectedPackage.
|
|
self
|
|
self
|
|
@@ -1453,7 +1453,7 @@ eval: aString
|
|
| compiler |
|
|
| compiler |
|
|
compiler := Compiler new.
|
|
compiler := Compiler new.
|
|
[compiler parseExpression: aString] on: Error do: [:ex |
|
|
[compiler parseExpression: aString] on: Error do: [:ex |
|
|
- ^self alert: ex messageText].
|
|
|
|
|
|
+ ^window alert: ex messageText].
|
|
^(compiler load: 'doIt ^[', aString, '] value' forClass: DoIt) fn applyTo: self receiver arguments: #()
|
|
^(compiler load: 'doIt ^[', aString, '] value' forClass: DoIt) fn applyTo: self receiver arguments: #()
|
|
!
|
|
!
|
|
|
|
|