Browse Source

Merge branch 'master' into requirejs

Herbert Vojčík 10 years ago
parent
commit
d3a679c45e

+ 1 - 1
bower.json

@@ -1,6 +1,6 @@
 {
   "name": "amber",
-  "version": "0.11.0",
+  "version": "0.12.0-pre",
   "main": "support/amber.js",
   "ignore": [
     "**/.*",

+ 18 - 12
js/Kernel-Collections.deploy.js

@@ -1784,18 +1784,6 @@ return self}, function($ctx1) {$ctx1.fill(self,"do:",{aBlock:aBlock},smalltalk.S
 messageSends: []}),
 smalltalk.SequenceableCollection);
 
-smalltalk.addMethod(
-smalltalk.method({
-selector: "do:displayingProgress:",
-fn: function (aBlock,aString){
-var self=this;
-function $ProgressHandler(){return smalltalk.ProgressHandler||(typeof ProgressHandler=="undefined"?nil:ProgressHandler)}
-return smalltalk.withContext(function($ctx1) { 
-_st(_st($ProgressHandler())._current())._do_on_displaying_(aBlock,self,aString);
-return self}, function($ctx1) {$ctx1.fill(self,"do:displayingProgress:",{aBlock:aBlock,aString:aString},smalltalk.SequenceableCollection)})},
-messageSends: ["do:on:displaying:", "current"]}),
-smalltalk.SequenceableCollection);
-
 smalltalk.addMethod(
 smalltalk.method({
 selector: "first",
@@ -2710,6 +2698,24 @@ return self}, function($ctx1) {$ctx1.fill(self,"asLowercase",{},smalltalk.String
 messageSends: []}),
 smalltalk.String);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "asMutator",
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+var $1,$2,$3;
+$1=_st(self._last()).__eq(":");
+if(! smalltalk.assert($1)){
+$2=self.__comma(":");
+return $2;
+};
+$3=self;
+return $3;
+}, function($ctx1) {$ctx1.fill(self,"asMutator",{},smalltalk.String)})},
+messageSends: ["ifFalse:", ",", "=", "last"]}),
+smalltalk.String);
+
 smalltalk.addMethod(
 smalltalk.method({
 selector: "asNumber",

+ 23 - 17
js/Kernel-Collections.js

@@ -2360,23 +2360,6 @@ referencedClasses: []
 }),
 smalltalk.SequenceableCollection);
 
-smalltalk.addMethod(
-smalltalk.method({
-selector: "do:displayingProgress:",
-category: 'enumerating',
-fn: function (aBlock,aString){
-var self=this;
-function $ProgressHandler(){return smalltalk.ProgressHandler||(typeof ProgressHandler=="undefined"?nil:ProgressHandler)}
-return smalltalk.withContext(function($ctx1) { 
-_st(_st($ProgressHandler())._current())._do_on_displaying_(aBlock,self,aString);
-return self}, function($ctx1) {$ctx1.fill(self,"do:displayingProgress:",{aBlock:aBlock,aString:aString},smalltalk.SequenceableCollection)})},
-args: ["aBlock", "aString"],
-source: "do: aBlock displayingProgress: aString\x0a\x09ProgressHandler current\x0a\x09\x09do: aBlock on: self displaying: aString",
-messageSends: ["do:on:displaying:", "current"],
-referencedClasses: ["ProgressHandler"]
-}),
-smalltalk.SequenceableCollection);
-
 smalltalk.addMethod(
 smalltalk.method({
 selector: "first",
@@ -3634,6 +3617,29 @@ referencedClasses: []
 }),
 smalltalk.String);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "asMutator",
+category: 'converting',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+var $1,$2,$3;
+$1=_st(self._last()).__eq(":");
+if(! smalltalk.assert($1)){
+$2=self.__comma(":");
+return $2;
+};
+$3=self;
+return $3;
+}, function($ctx1) {$ctx1.fill(self,"asMutator",{},smalltalk.String)})},
+args: [],
+source: "asMutator\x0a\x09\x22Answer a setter selector. For example,\x0a\x09#name asMutator returns #name:\x22\x0a\x0a\x09self last = ':' ifFalse: [  ^ self, ':' ].\x0a\x09^ self",
+messageSends: ["ifFalse:", ",", "=", "last"],
+referencedClasses: []
+}),
+smalltalk.String);
+
 smalltalk.addMethod(
 smalltalk.method({
 selector: "asNumber",

+ 12 - 0
js/Kernel-Infrastructure.deploy.js

@@ -1745,6 +1745,18 @@ return self}, function($ctx1) {$ctx1.fill(self,"current",{},smalltalk.Smalltalk.
 messageSends: []}),
 smalltalk.Smalltalk.klass);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "do:displayingProgress:",
+fn: function (aBlock,aString){
+var self=this;
+function $ProgressHandler(){return smalltalk.ProgressHandler||(typeof ProgressHandler=="undefined"?nil:ProgressHandler)}
+return smalltalk.withContext(function($ctx1) { 
+_st(_st($ProgressHandler())._current())._do_on_displaying_(aBlock,self,aString);
+return self}, function($ctx1) {$ctx1.fill(self,"do:displayingProgress:",{aBlock:aBlock,aString:aString},smalltalk.SequenceableCollection)})},
+messageSends: ["do:on:displaying:", "current"]}),
+smalltalk.SequenceableCollection);
+
 smalltalk.addMethod(
 smalltalk.method({
 selector: "asJavaScriptSelector",

+ 17 - 0
js/Kernel-Infrastructure.js

@@ -2321,6 +2321,23 @@ referencedClasses: []
 }),
 smalltalk.Smalltalk.klass);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "do:displayingProgress:",
+category: '*Kernel-Infrastructure',
+fn: function (aBlock,aString){
+var self=this;
+function $ProgressHandler(){return smalltalk.ProgressHandler||(typeof ProgressHandler=="undefined"?nil:ProgressHandler)}
+return smalltalk.withContext(function($ctx1) { 
+_st(_st($ProgressHandler())._current())._do_on_displaying_(aBlock,self,aString);
+return self}, function($ctx1) {$ctx1.fill(self,"do:displayingProgress:",{aBlock:aBlock,aString:aString},smalltalk.SequenceableCollection)})},
+args: ["aBlock", "aString"],
+source: "do: aBlock displayingProgress: aString\x0a\x09ProgressHandler current\x0a\x09\x09do: aBlock on: self displaying: aString",
+messageSends: ["do:on:displaying:", "current"],
+referencedClasses: ["ProgressHandler"]
+}),
+smalltalk.SequenceableCollection);
+
 smalltalk.addMethod(
 smalltalk.method({
 selector: "asJavaScriptSelector",

+ 3 - 3
package.json

@@ -1,6 +1,6 @@
 {
   "name": "amber",
-  "version": "0.11.0",
+  "version": "0.12.0-pre",
   "description": "An implementation of the Smalltalk language that runs on top of the JS runtime.",
   "homepage": "http://amber-lang.net",
   "keywords": [
@@ -20,10 +20,10 @@
   },
   "repository": {
     "type": "git",
-    "url": "git://github.com/amber-smalltalk/amber.git#0.11.0"
+    "url": "git://github.com/amber-smalltalk/amber.git"
   },
   "engines": {
-    "node": "0.8.x"
+    "node": ">=0.8.0"
   },
   "bin": {
     "amber": "./bin/amber",

+ 8 - 5
st/Kernel-Collections.st

@@ -886,11 +886,6 @@ do: aBlock
 	<for(var i=0;i<self.length;i++){aBlock._value_(self[i]);}>
 !
 
-do: aBlock displayingProgress: aString
-	ProgressHandler current
-		do: aBlock on: self displaying: aString
-!
-
 with: anotherCollection do: aBlock
 	<for(var i=0;i<self.length;i++){aBlock._value_value_(self[i], anotherCollection[i]);}>
 !
@@ -1274,6 +1269,14 @@ asLowercase
 	<return self.toLowerCase()>
 !
 
+asMutator
+	"Answer a setter selector. For example,
+	#name asMutator returns #name:"
+
+	self last = ':' ifFalse: [  ^ self, ':' ].
+	^ self
+!
+
 asNumber
 	<return Number(self)>
 !

+ 7 - 0
st/Kernel-Infrastructure.st

@@ -922,6 +922,13 @@ current
 	<return smalltalk>
 ! !
 
+!SequenceableCollection methodsFor: '*Kernel-Infrastructure'!
+
+do: aBlock displayingProgress: aString
+	ProgressHandler current
+		do: aBlock on: self displaying: aString
+! !
+
 !String methodsFor: '*Kernel-Infrastructure'!
 
 asJavaScriptSelector