resin 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/amber/bin/amberc +4 -3
- data/amber/js/IDE.deploy.js +147 -45
- data/amber/js/IDE.js +155 -53
- data/amber/js/Kernel-Classes.deploy.js +20 -14
- data/amber/js/Kernel-Classes.js +29 -18
- data/amber/js/Kernel-Collections.deploy.js +82 -0
- data/amber/js/Kernel-Collections.js +102 -0
- data/amber/js/Kernel-Methods.deploy.js +374 -261
- data/amber/js/Kernel-Methods.js +417 -269
- data/amber/js/Kernel-Objects.deploy.js +90 -28
- data/amber/js/Kernel-Objects.js +121 -34
- data/amber/js/Kernel-Tests.deploy.js +35 -0
- data/amber/js/Kernel-Tests.js +45 -0
- data/amber/js/SUnit.deploy.js +175 -17
- data/amber/js/SUnit.js +237 -24
- data/amber/js/amber.js +2 -1
- data/amber/js/boot.js +74 -18
- data/amber/js/lib/es5-shim-2.0.2/CHANGES +93 -0
- data/amber/js/lib/es5-shim-2.0.2/CONTRIBUTORS.md +25 -0
- data/amber/js/lib/es5-shim-2.0.2/LICENSE +19 -0
- data/amber/js/lib/es5-shim-2.0.2/README.md +161 -0
- data/amber/js/lib/es5-shim-2.0.2/es5-sham.js +348 -0
- data/amber/js/lib/es5-shim-2.0.2/es5-sham.min.js +6 -0
- data/amber/js/lib/es5-shim-2.0.2/es5-shim.js +963 -0
- data/amber/js/lib/es5-shim-2.0.2/es5-shim.min.js +16 -0
- data/amber/js/lib/es5-shim-2.0.2/minify +2 -0
- data/amber/js/lib/es5-shim-2.0.2/package.json +31 -0
- data/amber/js/lib/es5-shim-2.0.2/tests/helpers/h-kill.js +59 -0
- data/amber/js/lib/es5-shim-2.0.2/tests/helpers/h-matchers.js +34 -0
- data/amber/js/lib/es5-shim-2.0.2/tests/helpers/h.js +3 -0
- data/amber/js/lib/es5-shim-2.0.2/tests/index.html +62 -0
- data/amber/js/lib/es5-shim-2.0.2/tests/lib/jasmine-html.js +190 -0
- data/amber/js/lib/es5-shim-2.0.2/tests/lib/jasmine.css +166 -0
- data/amber/js/lib/es5-shim-2.0.2/tests/lib/jasmine.js +2477 -0
- data/amber/js/lib/es5-shim-2.0.2/tests/lib/jasmine_favicon.png +0 -0
- data/amber/js/lib/es5-shim-2.0.2/tests/lib/json2.js +478 -0
- data/amber/js/lib/es5-shim-2.0.2/tests/spec/s-array.js +1138 -0
- data/amber/js/lib/es5-shim-2.0.2/tests/spec/s-date.js +117 -0
- data/amber/js/lib/es5-shim-2.0.2/tests/spec/s-function.js +147 -0
- data/amber/js/lib/es5-shim-2.0.2/tests/spec/s-object.js +84 -0
- data/amber/js/lib/es5-shim-2.0.2/tests/spec/s-string.js +24 -0
- data/amber/st/IDE.st +15 -16
- data/amber/st/Kernel-Classes.st +9 -9
- data/amber/st/Kernel-Collections.st +37 -0
- data/amber/st/Kernel-Methods.st +63 -8
- data/amber/st/Kernel-Objects.st +34 -7
- data/amber/st/Kernel-Tests.st +10 -0
- data/amber/st/SUnit.st +86 -9
- metadata +44 -21
- data/amber/js/compat.js +0 -22
@@ -2171,6 +2171,46 @@ fn: function () {
|
|
2171
2171
|
smalltalk.Number.klass);
|
2172
2172
|
|
2173
2173
|
|
2174
|
+
smalltalk.addClass('Organizer', smalltalk.Object, [], 'Kernel-Objects');
|
2175
|
+
smalltalk.addMethod(
|
2176
|
+
"_addElement_",
|
2177
|
+
smalltalk.method({
|
2178
|
+
selector: "addElement:",
|
2179
|
+
fn: function (anObject) {
|
2180
|
+
var self = this;
|
2181
|
+
self.addElement(anObject);
|
2182
|
+
return self;
|
2183
|
+
}
|
2184
|
+
}),
|
2185
|
+
smalltalk.Organizer);
|
2186
|
+
|
2187
|
+
smalltalk.addMethod(
|
2188
|
+
"_elements",
|
2189
|
+
smalltalk.method({
|
2190
|
+
selector: "elements",
|
2191
|
+
fn: function () {
|
2192
|
+
var self = this;
|
2193
|
+
var $1;
|
2194
|
+
$1 = smalltalk.send(smalltalk.send(self, "_basicAt_", ["elements"]), "_copy", []);
|
2195
|
+
return $1;
|
2196
|
+
}
|
2197
|
+
}),
|
2198
|
+
smalltalk.Organizer);
|
2199
|
+
|
2200
|
+
smalltalk.addMethod(
|
2201
|
+
"_removeElement_",
|
2202
|
+
smalltalk.method({
|
2203
|
+
selector: "removeElement:",
|
2204
|
+
fn: function (anObject) {
|
2205
|
+
var self = this;
|
2206
|
+
self.removeElement(anObject);
|
2207
|
+
return self;
|
2208
|
+
}
|
2209
|
+
}),
|
2210
|
+
smalltalk.Organizer);
|
2211
|
+
|
2212
|
+
|
2213
|
+
|
2174
2214
|
smalltalk.addClass('Package', smalltalk.Object, ['commitPathJs', 'commitPathSt'], 'Kernel-Objects');
|
2175
2215
|
smalltalk.addMethod(
|
2176
2216
|
"_classes",
|
@@ -2179,7 +2219,7 @@ selector: "classes",
|
|
2179
2219
|
fn: function () {
|
2180
2220
|
var self = this;
|
2181
2221
|
var $1;
|
2182
|
-
$1 = smalltalk.send(smalltalk.send(
|
2222
|
+
$1 = smalltalk.send(smalltalk.send(self, "_organization", []), "_elements", []);
|
2183
2223
|
return $1;
|
2184
2224
|
}
|
2185
2225
|
}),
|
@@ -2319,6 +2359,19 @@ fn: function (aString) {
|
|
2319
2359
|
}),
|
2320
2360
|
smalltalk.Package);
|
2321
2361
|
|
2362
|
+
smalltalk.addMethod(
|
2363
|
+
"_organization",
|
2364
|
+
smalltalk.method({
|
2365
|
+
selector: "organization",
|
2366
|
+
fn: function () {
|
2367
|
+
var self = this;
|
2368
|
+
var $1;
|
2369
|
+
$1 = smalltalk.send(self, "_basicAt_", ["organization"]);
|
2370
|
+
return $1;
|
2371
|
+
}
|
2372
|
+
}),
|
2373
|
+
smalltalk.Package);
|
2374
|
+
|
2322
2375
|
smalltalk.addMethod(
|
2323
2376
|
"_printString",
|
2324
2377
|
smalltalk.method({
|
@@ -2810,11 +2863,11 @@ smalltalk.addMethod(
|
|
2810
2863
|
"_at_",
|
2811
2864
|
smalltalk.method({
|
2812
2865
|
selector: "at:",
|
2813
|
-
fn: function (aSymbol){
|
2814
|
-
var self=this;
|
2815
|
-
return self[aSymbol._asString()];
|
2816
|
-
;
|
2817
|
-
|
2866
|
+
fn: function (aSymbol) {
|
2867
|
+
var self = this;
|
2868
|
+
return self[aSymbol._asString()];
|
2869
|
+
return self;
|
2870
|
+
}
|
2818
2871
|
}),
|
2819
2872
|
smalltalk.Smalltalk);
|
2820
2873
|
|
@@ -2869,6 +2922,18 @@ fn: function (packageName, aDict) {
|
|
2869
2922
|
}),
|
2870
2923
|
smalltalk.Smalltalk);
|
2871
2924
|
|
2925
|
+
smalltalk.addMethod(
|
2926
|
+
"_deleteClass_",
|
2927
|
+
smalltalk.method({
|
2928
|
+
selector: "deleteClass:",
|
2929
|
+
fn: function (aClass) {
|
2930
|
+
var self = this;
|
2931
|
+
self.removeClass(aClass);
|
2932
|
+
return self;
|
2933
|
+
}
|
2934
|
+
}),
|
2935
|
+
smalltalk.Smalltalk);
|
2936
|
+
|
2872
2937
|
smalltalk.addMethod(
|
2873
2938
|
"_deletePackage_",
|
2874
2939
|
smalltalk.method({
|
@@ -2963,9 +3028,9 @@ smalltalk.addMethod(
|
|
2963
3028
|
"_pseudoVariableNames",
|
2964
3029
|
smalltalk.method({
|
2965
3030
|
selector: "pseudoVariableNames",
|
2966
|
-
fn: function (){
|
2967
|
-
var self=this;
|
2968
|
-
return ["self", "super", "nil", "true", "false", "thisContext"];
|
3031
|
+
fn: function () {
|
3032
|
+
var self = this;
|
3033
|
+
return ["self", "super", "nil", "true", "false", "thisContext"];
|
2969
3034
|
}
|
2970
3035
|
}),
|
2971
3036
|
smalltalk.Smalltalk);
|
@@ -2986,25 +3051,22 @@ smalltalk.addMethod(
|
|
2986
3051
|
"_removeClass_",
|
2987
3052
|
smalltalk.method({
|
2988
3053
|
selector: "removeClass:",
|
2989
|
-
fn: function (aClass){
|
2990
|
-
var self=this;
|
2991
|
-
var $1
|
2992
|
-
$1=smalltalk.send(aClass,"_isMetaclass",[]);
|
2993
|
-
if(smalltalk.assert($1)){
|
2994
|
-
smalltalk.send(self,"_error_",[smalltalk.send(smalltalk.send(aClass,"_asString",[]),"__comma",[" is a Metaclass and cannot be removed!"])]);
|
2995
|
-
}
|
2996
|
-
smalltalk.send(smalltalk.send(smalltalk.send(aClass,"_methodDictionary",[]),"_values",[]),"_do_",[
|
2997
|
-
return smalltalk.send(aClass,"_removeCompiledMethod_",[each]);
|
2998
|
-
|
2999
|
-
smalltalk.send(smalltalk.
|
3000
|
-
|
3001
|
-
|
3002
|
-
smalltalk.send(
|
3003
|
-
|
3004
|
-
|
3005
|
-
$3=smalltalk.send($2,"_yourself",[]);
|
3006
|
-
smalltalk.send(smalltalk.send((smalltalk.SystemAnnouncer || SystemAnnouncer),"_current",[]),"_announce_",[$3]);
|
3007
|
-
return self}
|
3054
|
+
fn: function (aClass) {
|
3055
|
+
var self = this;
|
3056
|
+
var $1, $2, $3;
|
3057
|
+
$1 = smalltalk.send(aClass, "_isMetaclass", []);
|
3058
|
+
if (smalltalk.assert($1)) {
|
3059
|
+
smalltalk.send(self, "_error_", [smalltalk.send(smalltalk.send(aClass, "_asString", []), "__comma", [" is a Metaclass and cannot be removed!"])]);
|
3060
|
+
}
|
3061
|
+
smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_methodDictionary", []), "_values", []), "_do_", [function (each) {return smalltalk.send(aClass, "_removeCompiledMethod_", [each]);}]);
|
3062
|
+
smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_class", []), "_methodDictionary", []), "_values", []), "_do_", [function (each) {return smalltalk.send(smalltalk.send(aClass, "_class", []), "_removeCompiledMethod_", [each]);}]);
|
3063
|
+
smalltalk.send(self, "_deleteClass_", [aClass]);
|
3064
|
+
$2 = smalltalk.send(smalltalk.ClassRemoved || ClassRemoved, "_new", []);
|
3065
|
+
smalltalk.send($2, "_theClass_", [aClass]);
|
3066
|
+
$3 = smalltalk.send($2, "_yourself", []);
|
3067
|
+
smalltalk.send(smalltalk.send(smalltalk.SystemAnnouncer || SystemAnnouncer, "_current", []), "_announce_", [$3]);
|
3068
|
+
return self;
|
3069
|
+
}
|
3008
3070
|
}),
|
3009
3071
|
smalltalk.Smalltalk);
|
3010
3072
|
|
data/amber/js/Kernel-Objects.js
CHANGED
@@ -3001,6 +3001,61 @@ referencedClasses: []
|
|
3001
3001
|
smalltalk.Number.klass);
|
3002
3002
|
|
3003
3003
|
|
3004
|
+
smalltalk.addClass('Organizer', smalltalk.Object, [], 'Kernel-Objects');
|
3005
|
+
smalltalk.addMethod(
|
3006
|
+
"_addElement_",
|
3007
|
+
smalltalk.method({
|
3008
|
+
selector: "addElement:",
|
3009
|
+
category: 'accessing',
|
3010
|
+
fn: function (anObject) {
|
3011
|
+
var self = this;
|
3012
|
+
self.addElement(anObject);
|
3013
|
+
return self;
|
3014
|
+
},
|
3015
|
+
args: ["anObject"],
|
3016
|
+
source: "addElement: anObject\x0a\x09<self.addElement(anObject)>",
|
3017
|
+
messageSends: [],
|
3018
|
+
referencedClasses: []
|
3019
|
+
}),
|
3020
|
+
smalltalk.Organizer);
|
3021
|
+
|
3022
|
+
smalltalk.addMethod(
|
3023
|
+
"_elements",
|
3024
|
+
smalltalk.method({
|
3025
|
+
selector: "elements",
|
3026
|
+
category: 'accessing',
|
3027
|
+
fn: function () {
|
3028
|
+
var self = this;
|
3029
|
+
var $1;
|
3030
|
+
$1 = smalltalk.send(smalltalk.send(self, "_basicAt_", ["elements"]), "_copy", []);
|
3031
|
+
return $1;
|
3032
|
+
},
|
3033
|
+
args: [],
|
3034
|
+
source: "elements\x0a\x09^ (self basicAt: 'elements') copy",
|
3035
|
+
messageSends: ["copy", "basicAt:"],
|
3036
|
+
referencedClasses: []
|
3037
|
+
}),
|
3038
|
+
smalltalk.Organizer);
|
3039
|
+
|
3040
|
+
smalltalk.addMethod(
|
3041
|
+
"_removeElement_",
|
3042
|
+
smalltalk.method({
|
3043
|
+
selector: "removeElement:",
|
3044
|
+
category: 'accessing',
|
3045
|
+
fn: function (anObject) {
|
3046
|
+
var self = this;
|
3047
|
+
self.removeElement(anObject);
|
3048
|
+
return self;
|
3049
|
+
},
|
3050
|
+
args: ["anObject"],
|
3051
|
+
source: "removeElement: anObject\x0a\x09<self.removeElement(anObject)>",
|
3052
|
+
messageSends: [],
|
3053
|
+
referencedClasses: []
|
3054
|
+
}),
|
3055
|
+
smalltalk.Organizer);
|
3056
|
+
|
3057
|
+
|
3058
|
+
|
3004
3059
|
smalltalk.addClass('Package', smalltalk.Object, ['commitPathJs', 'commitPathSt'], 'Kernel-Objects');
|
3005
3060
|
smalltalk.Package.comment="A Package is similar to a \x22class category\x22 typically found in other Smalltalks like Pharo or Squeak. Amber does not have class categories anymore, it had in the beginning but now each class in the system knows which package it belongs to.\x0a\x0aA Package has a name, an Array of \x22requires\x22, a comment and a Dictionary with other optional key value attributes. A Package can also be queried for its classes, but it will then resort to a reverse scan of all classes to find them.\x0aPackages are manipulated through \x22Smalltalk current\x22, like for example finding one based on a name:\x0a\x0a\x09Smalltalk current packageAt: 'Kernel'\x0a\x0a...but you can also use:\x0a\x0a\x09Package named: 'Kernel'\x0a\x0aA Package differs slightly from a Monticello package which can span multiple class categories using a naming convention based on hyphenation. But just as in Monticello a Package supports \x22class extensions\x22 so a Package\x0acan define behaviors in foreign classes using a naming convention for method categories where the category starts with an asterisk and then the name of the owning package follows. This can easily be seen in for example class\x0aString where the method category \x22*IDE\x22 defines #inspectOn: which thus is a method belonging to the IDE package.\x0a\x0aYou can fetch a package from the server:\x0a\x0a\x09Package fetch: 'Additional-Examples'"
|
3006
3061
|
smalltalk.addMethod(
|
@@ -3011,13 +3066,13 @@ category: 'classes',
|
|
3011
3066
|
fn: function () {
|
3012
3067
|
var self = this;
|
3013
3068
|
var $1;
|
3014
|
-
$1 = smalltalk.send(smalltalk.send(
|
3069
|
+
$1 = smalltalk.send(smalltalk.send(self, "_organization", []), "_elements", []);
|
3015
3070
|
return $1;
|
3016
3071
|
},
|
3017
3072
|
args: [],
|
3018
|
-
source: "classes\x0a\x09
|
3019
|
-
messageSends: ["
|
3020
|
-
referencedClasses: [
|
3073
|
+
source: "classes\x0a\x09^ self organization elements",
|
3074
|
+
messageSends: ["elements", "organization"],
|
3075
|
+
referencedClasses: []
|
3021
3076
|
}),
|
3022
3077
|
smalltalk.Package);
|
3023
3078
|
|
@@ -3205,6 +3260,24 @@ referencedClasses: []
|
|
3205
3260
|
}),
|
3206
3261
|
smalltalk.Package);
|
3207
3262
|
|
3263
|
+
smalltalk.addMethod(
|
3264
|
+
"_organization",
|
3265
|
+
smalltalk.method({
|
3266
|
+
selector: "organization",
|
3267
|
+
category: 'accessing',
|
3268
|
+
fn: function () {
|
3269
|
+
var self = this;
|
3270
|
+
var $1;
|
3271
|
+
$1 = smalltalk.send(self, "_basicAt_", ["organization"]);
|
3272
|
+
return $1;
|
3273
|
+
},
|
3274
|
+
args: [],
|
3275
|
+
source: "organization\x0a\x09^ self basicAt: 'organization'",
|
3276
|
+
messageSends: ["basicAt:"],
|
3277
|
+
referencedClasses: []
|
3278
|
+
}),
|
3279
|
+
smalltalk.Package);
|
3280
|
+
|
3208
3281
|
smalltalk.addMethod(
|
3209
3282
|
"_printString",
|
3210
3283
|
smalltalk.method({
|
@@ -3875,11 +3948,11 @@ smalltalk.addMethod(
|
|
3875
3948
|
smalltalk.method({
|
3876
3949
|
selector: "at:",
|
3877
3950
|
category: 'accessing',
|
3878
|
-
fn: function (aSymbol){
|
3879
|
-
var self=this;
|
3880
|
-
return self[aSymbol._asString()];
|
3881
|
-
;
|
3882
|
-
|
3951
|
+
fn: function (aSymbol) {
|
3952
|
+
var self = this;
|
3953
|
+
return self[aSymbol._asString()];
|
3954
|
+
return self;
|
3955
|
+
},
|
3883
3956
|
args: ["aSymbol"],
|
3884
3957
|
source: "at: aSymbol\x0a\x09<return self[aSymbol._asString()]>",
|
3885
3958
|
messageSends: [],
|
@@ -3908,7 +3981,7 @@ smalltalk.addMethod(
|
|
3908
3981
|
"_classes",
|
3909
3982
|
smalltalk.method({
|
3910
3983
|
selector: "classes",
|
3911
|
-
category: '
|
3984
|
+
category: 'classes',
|
3912
3985
|
fn: function () {
|
3913
3986
|
var self = this;
|
3914
3987
|
return self.classes();
|
@@ -3958,6 +4031,23 @@ referencedClasses: []
|
|
3958
4031
|
}),
|
3959
4032
|
smalltalk.Smalltalk);
|
3960
4033
|
|
4034
|
+
smalltalk.addMethod(
|
4035
|
+
"_deleteClass_",
|
4036
|
+
smalltalk.method({
|
4037
|
+
selector: "deleteClass:",
|
4038
|
+
category: 'private',
|
4039
|
+
fn: function (aClass) {
|
4040
|
+
var self = this;
|
4041
|
+
self.removeClass(aClass);
|
4042
|
+
return self;
|
4043
|
+
},
|
4044
|
+
args: ["aClass"],
|
4045
|
+
source: "deleteClass: aClass\x0a\x09\x22Deletes a class by deleting its binding only. Use #removeClass instead\x22\x0a \x0a\x09<self.removeClass(aClass)>",
|
4046
|
+
messageSends: [],
|
4047
|
+
referencedClasses: []
|
4048
|
+
}),
|
4049
|
+
smalltalk.Smalltalk);
|
4050
|
+
|
3961
4051
|
smalltalk.addMethod(
|
3962
4052
|
"_deletePackage_",
|
3963
4053
|
smalltalk.method({
|
@@ -4083,9 +4173,9 @@ smalltalk.addMethod(
|
|
4083
4173
|
smalltalk.method({
|
4084
4174
|
selector: "pseudoVariableNames",
|
4085
4175
|
category: 'packages',
|
4086
|
-
fn: function (){
|
4087
|
-
var self=this;
|
4088
|
-
return ["self", "super", "nil", "true", "false", "thisContext"];
|
4176
|
+
fn: function () {
|
4177
|
+
var self = this;
|
4178
|
+
return ["self", "super", "nil", "true", "false", "thisContext"];
|
4089
4179
|
},
|
4090
4180
|
args: [],
|
4091
4181
|
source: "pseudoVariableNames\x0a\x09^ #('self' 'super' 'nil' 'true' 'false' 'thisContext')",
|
@@ -4116,28 +4206,25 @@ smalltalk.addMethod(
|
|
4116
4206
|
smalltalk.method({
|
4117
4207
|
selector: "removeClass:",
|
4118
4208
|
category: 'classes',
|
4119
|
-
fn: function (aClass){
|
4120
|
-
var self=this;
|
4121
|
-
var $1
|
4122
|
-
$1=smalltalk.send(aClass,"_isMetaclass",[]);
|
4123
|
-
if(smalltalk.assert($1)){
|
4124
|
-
smalltalk.send(self,"_error_",[smalltalk.send(smalltalk.send(aClass,"_asString",[]),"__comma",[" is a Metaclass and cannot be removed!"])]);
|
4125
|
-
}
|
4126
|
-
smalltalk.send(smalltalk.send(smalltalk.send(aClass,"_methodDictionary",[]),"_values",[]),"_do_",[
|
4127
|
-
return smalltalk.send(aClass,"_removeCompiledMethod_",[each]);
|
4128
|
-
|
4129
|
-
smalltalk.send(smalltalk.
|
4130
|
-
|
4131
|
-
|
4132
|
-
smalltalk.send(
|
4133
|
-
|
4134
|
-
|
4135
|
-
$3=smalltalk.send($2,"_yourself",[]);
|
4136
|
-
smalltalk.send(smalltalk.send((smalltalk.SystemAnnouncer || SystemAnnouncer),"_current",[]),"_announce_",[$3]);
|
4137
|
-
return self},
|
4209
|
+
fn: function (aClass) {
|
4210
|
+
var self = this;
|
4211
|
+
var $1, $2, $3;
|
4212
|
+
$1 = smalltalk.send(aClass, "_isMetaclass", []);
|
4213
|
+
if (smalltalk.assert($1)) {
|
4214
|
+
smalltalk.send(self, "_error_", [smalltalk.send(smalltalk.send(aClass, "_asString", []), "__comma", [" is a Metaclass and cannot be removed!"])]);
|
4215
|
+
}
|
4216
|
+
smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_methodDictionary", []), "_values", []), "_do_", [function (each) {return smalltalk.send(aClass, "_removeCompiledMethod_", [each]);}]);
|
4217
|
+
smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_class", []), "_methodDictionary", []), "_values", []), "_do_", [function (each) {return smalltalk.send(smalltalk.send(aClass, "_class", []), "_removeCompiledMethod_", [each]);}]);
|
4218
|
+
smalltalk.send(self, "_deleteClass_", [aClass]);
|
4219
|
+
$2 = smalltalk.send(smalltalk.ClassRemoved || ClassRemoved, "_new", []);
|
4220
|
+
smalltalk.send($2, "_theClass_", [aClass]);
|
4221
|
+
$3 = smalltalk.send($2, "_yourself", []);
|
4222
|
+
smalltalk.send(smalltalk.send(smalltalk.SystemAnnouncer || SystemAnnouncer, "_current", []), "_announce_", [$3]);
|
4223
|
+
return self;
|
4224
|
+
},
|
4138
4225
|
args: ["aClass"],
|
4139
|
-
source: "removeClass: aClass\x0a\x09aClass isMetaclass ifTrue: [self error: aClass asString, ' is a Metaclass and cannot be removed!'].\x0a \x0a\x09aClass methodDictionary values do: [:each |\x0a\x09\x09aClass removeCompiledMethod: each].\x0a \x0a\x09aClass class methodDictionary values do: [:each |\x0a\x09\x09aClass class removeCompiledMethod: each].\x0a \x0a\x09self
|
4140
|
-
messageSends: ["ifTrue:", "error:", ",", "asString", "isMetaclass", "do:", "removeCompiledMethod:", "values", "methodDictionary", "class", "
|
4226
|
+
source: "removeClass: aClass\x0a\x09aClass isMetaclass ifTrue: [self error: aClass asString, ' is a Metaclass and cannot be removed!'].\x0a \x0a\x09aClass methodDictionary values do: [:each |\x0a\x09\x09aClass removeCompiledMethod: each].\x0a \x0a\x09aClass class methodDictionary values do: [:each |\x0a\x09\x09aClass class removeCompiledMethod: each].\x0a \x0a\x09self deleteClass: aClass.\x0a \x0a SystemAnnouncer current\x0a \x09announce: (ClassRemoved new\x0a \x09theClass: aClass;\x0a yourself)",
|
4227
|
+
messageSends: ["ifTrue:", "error:", ",", "asString", "isMetaclass", "do:", "removeCompiledMethod:", "values", "methodDictionary", "class", "deleteClass:", "announce:", "theClass:", "new", "yourself", "current"],
|
4141
4228
|
referencedClasses: ["ClassRemoved", "SystemAnnouncer"]
|
4142
4229
|
}),
|
4143
4230
|
smalltalk.Smalltalk);
|
@@ -28,6 +28,23 @@ return self}
|
|
28
28
|
}),
|
29
29
|
smalltalk.BlockClosureTest);
|
30
30
|
|
31
|
+
smalltalk.addMethod(
|
32
|
+
"_testEnsureRaises",
|
33
|
+
smalltalk.method({
|
34
|
+
selector: "testEnsureRaises",
|
35
|
+
fn: function (){
|
36
|
+
var self=this;
|
37
|
+
smalltalk.send(self,"_should_raise_",[(function(){
|
38
|
+
return smalltalk.send((function(){
|
39
|
+
return smalltalk.send(smalltalk.send((smalltalk.Error || Error),"_new",[]),"_signal",[]);
|
40
|
+
}),"_ensure_",[(function(){
|
41
|
+
return true;
|
42
|
+
})]);
|
43
|
+
}),(smalltalk.Error || Error)]);
|
44
|
+
return self}
|
45
|
+
}),
|
46
|
+
smalltalk.BlockClosureTest);
|
47
|
+
|
31
48
|
smalltalk.addMethod(
|
32
49
|
"_testNumArgs",
|
33
50
|
smalltalk.method({
|
@@ -322,6 +339,24 @@ return self}
|
|
322
339
|
}),
|
323
340
|
smalltalk.BooleanTest);
|
324
341
|
|
342
|
+
smalltalk.addMethod(
|
343
|
+
"_testNonBooleanError",
|
344
|
+
smalltalk.method({
|
345
|
+
selector: "testNonBooleanError",
|
346
|
+
fn: function (){
|
347
|
+
var self=this;
|
348
|
+
var b;
|
349
|
+
b= '' ;
|
350
|
+
;
|
351
|
+
smalltalk.send(self,"_should_raise_",[(function(){
|
352
|
+
if(smalltalk.assert(self["@nonBoolean"])){
|
353
|
+
} else {
|
354
|
+
};
|
355
|
+
}),(smalltalk.NonBooleanReceiver || NonBooleanReceiver)]);
|
356
|
+
return self}
|
357
|
+
}),
|
358
|
+
smalltalk.BooleanTest);
|
359
|
+
|
325
360
|
|
326
361
|
|
327
362
|
smalltalk.addClass('ClassBuilderTest', smalltalk.TestCase, ['builder', 'theClass'], 'Kernel-Tests');
|
data/amber/js/Kernel-Tests.js
CHANGED
@@ -38,6 +38,28 @@ referencedClasses: ["Error"]
|
|
38
38
|
}),
|
39
39
|
smalltalk.BlockClosureTest);
|
40
40
|
|
41
|
+
smalltalk.addMethod(
|
42
|
+
"_testEnsureRaises",
|
43
|
+
smalltalk.method({
|
44
|
+
selector: "testEnsureRaises",
|
45
|
+
category: 'tests',
|
46
|
+
fn: function (){
|
47
|
+
var self=this;
|
48
|
+
smalltalk.send(self,"_should_raise_",[(function(){
|
49
|
+
return smalltalk.send((function(){
|
50
|
+
return smalltalk.send(smalltalk.send((smalltalk.Error || Error),"_new",[]),"_signal",[]);
|
51
|
+
}),"_ensure_",[(function(){
|
52
|
+
return true;
|
53
|
+
})]);
|
54
|
+
}),(smalltalk.Error || Error)]);
|
55
|
+
return self},
|
56
|
+
args: [],
|
57
|
+
source: "testEnsureRaises\x0a\x09self should: [[Error new signal] ensure: [true]] raise: Error",
|
58
|
+
messageSends: ["should:raise:", "ensure:", "signal", "new"],
|
59
|
+
referencedClasses: ["Error"]
|
60
|
+
}),
|
61
|
+
smalltalk.BlockClosureTest);
|
62
|
+
|
41
63
|
smalltalk.addMethod(
|
42
64
|
"_testNumArgs",
|
43
65
|
smalltalk.method({
|
@@ -387,6 +409,29 @@ referencedClasses: []
|
|
387
409
|
}),
|
388
410
|
smalltalk.BooleanTest);
|
389
411
|
|
412
|
+
smalltalk.addMethod(
|
413
|
+
"_testNonBooleanError",
|
414
|
+
smalltalk.method({
|
415
|
+
selector: "testNonBooleanError",
|
416
|
+
category: 'tests',
|
417
|
+
fn: function (){
|
418
|
+
var self=this;
|
419
|
+
var b;
|
420
|
+
b= '' ;
|
421
|
+
;
|
422
|
+
smalltalk.send(self,"_should_raise_",[(function(){
|
423
|
+
if(smalltalk.assert(self["@nonBoolean"])){
|
424
|
+
} else {
|
425
|
+
};
|
426
|
+
}),(smalltalk.NonBooleanReceiver || NonBooleanReceiver)]);
|
427
|
+
return self},
|
428
|
+
args: [],
|
429
|
+
source: "testNonBooleanError\x0a\x09|b|\x0a b := < '' >.\x0a self should: [nonBoolean ifTrue: [] ifFalse: []] raise: NonBooleanReceiver",
|
430
|
+
messageSends: ["should:raise:", "ifTrue:ifFalse:"],
|
431
|
+
referencedClasses: ["NonBooleanReceiver"]
|
432
|
+
}),
|
433
|
+
smalltalk.BooleanTest);
|
434
|
+
|
390
435
|
|
391
436
|
|
392
437
|
smalltalk.addClass('ClassBuilderTest', smalltalk.TestCase, ['builder', 'theClass'], 'Kernel-Tests');
|