Selaa lähdekoodia

Merge branch 'master' into debugger

Nicolas Petton 11 vuotta sitten
vanhempi
commit
1dd073fb54

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 59 - 59
cli/js/AmberCli.deploy.js


+ 3 - 3
cli/js/AmberCli.js

@@ -783,12 +783,12 @@ return _st(console)._log_("Error starting server: ".__comma(error));
 }, function($ctx2) {$ctx2.fillBlock({error:error},$ctx1)})}));
 _st($1)._on_do_("listening",(function(){
 return smalltalk.withContext(function($ctx2) {
-return _st(console)._log_(_st(_st("Starting file server on ".__comma(self._host())).__comma(":")).__comma(_st(self._port())._asString()));
+return _st(console)._log_(_st(_st("Starting file server on http://".__comma(self._host())).__comma(":")).__comma(_st(self._port())._asString()));
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
 $2=_st($1)._listen_host_(self._port(),self._host());
 return self}, function($ctx1) {$ctx1.fill(self,"start",{},smalltalk.FileServer)})},
 args: [],
-source: "start\x0a\x09\x22Checks if required directory layout is present (issue warning if not).\x0a\x09 Afterwards start the server.\x22\x0a\x09self checkDirectoryLayout.\x0a\x09(http createServer: [:request :response |\x0a\x09      self handleRequest: request respondTo: response])\x0a\x09      on: 'error' do: [:error | console log: 'Error starting server: ', error];\x0a\x09      on: 'listening' do: [console log: 'Starting file server on ', self host, ':', self port asString];\x0a\x09      listen: self port host: self host.",
+source: "start\x0a\x09\x22Checks if required directory layout is present (issue warning if not).\x0a\x09 Afterwards start the server.\x22\x0a\x09self checkDirectoryLayout.\x0a\x09(http createServer: [:request :response |\x0a\x09      self handleRequest: request respondTo: response])\x0a\x09      on: 'error' do: [:error | console log: 'Error starting server: ', error];\x0a\x09      on: 'listening' do: [console log: 'Starting file server on http://', self host, ':', self port asString];\x0a\x09      listen: self port host: self host.",
 messageSends: ["checkDirectoryLayout", "on:do:", "log:", ",", "createServer:", "handleRequest:respondTo:", "asString", "port", "host", "listen:host:"],
 referencedClasses: []
 }),
@@ -1252,7 +1252,7 @@ smalltalk.Repl);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "main",
-category: 'not yet classified',
+category: 'initialization',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 264 - 268
cli/js/amber-cli.js


+ 2 - 2
cli/st/AmberCli.st

@@ -357,7 +357,7 @@ start
 	(http createServer: [:request :response |
 	      self handleRequest: request respondTo: response])
 	      on: 'error' do: [:error | console log: 'Error starting server: ', error];
-	      on: 'listening' do: [console log: 'Starting file server on ', self host, ':', self port asString];
+	      on: 'listening' do: [console log: 'Starting file server on http://', self host, ':', self port asString];
 	      listen: self port host: self host.
 !
 
@@ -947,7 +947,7 @@ initialize
 	util := require value: 'util'
 ! !
 
-!Repl class methodsFor: 'not yet classified'!
+!Repl class methodsFor: 'initialization'!
 
 main
 	self new createInterface

+ 7 - 0
js/Helios-Browser.js

@@ -1,5 +1,6 @@
 smalltalk.addPackage('Helios-Browser');
 smalltalk.addClass('HLBrowser', smalltalk.HLWidget, ['model', 'packagesListWidget', 'classesListWidget', 'protocolsListWidget', 'methodsListWidget', 'sourceWidget', 'bottomDiv'], 'Helios-Browser');
+smalltalk.HLBrowser.comment="I render a system browser with 4 panes (Packages, Classes, Protocols, Methods) and a source area.";
 smalltalk.addMethod(
 smalltalk.method({
 selector: "canHaveFocus",
@@ -375,6 +376,7 @@ smalltalk.HLBrowser.klass);
 
 
 smalltalk.addClass('HLBrowserBottomWidget', smalltalk.HLWidget, ['model', 'codeWidget', 'documentationWidget'], 'Helios-Browser');
+smalltalk.HLBrowserBottomWidget.comment="I render the code area of a browser and optionally the documentation for the selected class.";
 smalltalk.addMethod(
 smalltalk.method({
 selector: "canHaveFocus",
@@ -1159,6 +1161,7 @@ smalltalk.HLClassCache.klass);
 
 
 smalltalk.addClass('HLClassesListWidget', smalltalk.HLToolListWidget, [], 'Helios-Browser');
+smalltalk.HLClassesListWidget.comment="I render a list of classes in the selected package.";
 smalltalk.addMethod(
 smalltalk.method({
 selector: "cssClassForItem:",
@@ -1951,6 +1954,7 @@ smalltalk.HLClassesListWidget);
 
 
 smalltalk.addClass('HLDocumentationWidget', smalltalk.HLFocusableWidget, ['model'], 'Helios-Browser');
+smalltalk.HLDocumentationWidget.comment="I render the documentation for the selected class";
 smalltalk.addMethod(
 smalltalk.method({
 selector: "defaultDocumentation",
@@ -2379,6 +2383,7 @@ smalltalk.HLDocumentationWidget);
 
 
 smalltalk.addClass('HLMethodsListWidget', smalltalk.HLToolListWidget, ['selectorsCache'], 'Helios-Browser');
+smalltalk.HLMethodsListWidget.comment="I render a list of methods for the selected protocol.";
 smalltalk.addMethod(
 smalltalk.method({
 selector: "allProtocol",
@@ -3038,6 +3043,7 @@ smalltalk.HLMethodsListWidget.klass);
 
 
 smalltalk.addClass('HLPackagesListWidget', smalltalk.HLToolListWidget, [], 'Helios-Browser');
+smalltalk.HLPackagesListWidget.comment="I render a list of the system packages.";
 smalltalk.addMethod(
 smalltalk.method({
 selector: "commitPackage",
@@ -3286,6 +3292,7 @@ smalltalk.HLPackagesListWidget);
 
 
 smalltalk.addClass('HLProtocolsListWidget', smalltalk.HLToolListWidget, [], 'Helios-Browser');
+smalltalk.HLProtocolsListWidget.comment="I render a list of protocols for the selected class.";
 smalltalk.addMethod(
 smalltalk.method({
 selector: "allProtocol",

+ 1 - 1
js/Kernel-Collections.deploy.js

@@ -3430,7 +3430,7 @@ return smalltalk.withContext(function($ctx1) {
 
 		var found;
 		for(var i=0; i < self['@elements'].length; i++) {
-			if(anObject == self['@elements'][i]) {
+			if(_st(anObject).__eq_eq(self['@elements'][i])) {
 				found = true;
 				break;
 			}

+ 2 - 2
js/Kernel-Collections.js

@@ -4611,7 +4611,7 @@ return smalltalk.withContext(function($ctx1) {
 
 		var found;
 		for(var i=0; i < self['@elements'].length; i++) {
-			if(anObject == self['@elements'][i]) {
+			if(_st(anObject).__eq_eq(self['@elements'][i])) {
 				found = true;
 				break;
 			}
@@ -4620,7 +4620,7 @@ return smalltalk.withContext(function($ctx1) {
 	;
 return self}, function($ctx1) {$ctx1.fill(self,"add:",{anObject:anObject},smalltalk.Set)})},
 args: ["anObject"],
-source: "add: anObject\x0a\x09<\x0a\x09\x09var found;\x0a\x09\x09for(var i=0; i < self['@elements'].length; i++) {\x0a\x09\x09\x09if(anObject == self['@elements'][i]) {\x0a\x09\x09\x09\x09found = true;\x0a\x09\x09\x09\x09break;\x0a\x09\x09\x09}\x0a\x09\x09}\x0a\x09\x09if(!found) {self['@elements'].push(anObject)}\x0a\x09>",
+source: "add: anObject\x0a\x09<\x0a\x09\x09var found;\x0a\x09\x09for(var i=0; i < self['@elements'].length; i++) {\x0a\x09\x09\x09if(_st(anObject).__eq_eq(self['@elements'][i])) {\x0a\x09\x09\x09\x09found = true;\x0a\x09\x09\x09\x09break;\x0a\x09\x09\x09}\x0a\x09\x09}\x0a\x09\x09if(!found) {self['@elements'].push(anObject)}\x0a\x09>",
 messageSends: [],
 referencedClasses: []
 }),

+ 11 - 0
js/Kernel-Tests.deploy.js

@@ -3353,6 +3353,17 @@ return self}, function($ctx1) {$ctx1.fill(self,"testSize",{},smalltalk.SetTest)}
 messageSends: ["assert:equals:", "size", "new", "withAll:"]}),
 smalltalk.SetTest);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "testUnboxedObjects",
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+self._assert_equals_(_st(_st(["foo"._yourself(),"foo"._yourself()])._asSet())._asArray(),["foo"]);
+return self}, function($ctx1) {$ctx1.fill(self,"testUnboxedObjects",{},smalltalk.SetTest)})},
+messageSends: ["assert:equals:", "asArray", "asSet", "yourself"]}),
+smalltalk.SetTest);
+
 smalltalk.addMethod(
 smalltalk.method({
 selector: "testUnicity",

+ 16 - 0
js/Kernel-Tests.js

@@ -4224,6 +4224,22 @@ referencedClasses: ["Set"]
 }),
 smalltalk.SetTest);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "testUnboxedObjects",
+category: 'tests',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+self._assert_equals_(_st(_st(["foo"._yourself(),"foo"._yourself()])._asSet())._asArray(),["foo"]);
+return self}, function($ctx1) {$ctx1.fill(self,"testUnboxedObjects",{},smalltalk.SetTest)})},
+args: [],
+source: "testUnboxedObjects\x0a\x09self assert: {'foo' yourself. 'foo' yourself} asSet asArray equals: #('foo')",
+messageSends: ["assert:equals:", "asArray", "asSet", "yourself"],
+referencedClasses: []
+}),
+smalltalk.SetTest);
+
 smalltalk.addMethod(
 smalltalk.method({
 selector: "testUnicity",

+ 14 - 0
st/Helios-Browser.st

@@ -2,6 +2,8 @@ Smalltalk current createPackage: 'Helios-Browser'!
 HLWidget subclass: #HLBrowser
 	instanceVariableNames: 'model packagesListWidget classesListWidget protocolsListWidget methodsListWidget sourceWidget bottomDiv'
 	package: 'Helios-Browser'!
+!HLBrowser commentStamp!
+I render a system browser with 4 panes (Packages, Classes, Protocols, Methods) and a source area.!
 
 !HLBrowser methodsFor: 'accessing'!
 
@@ -129,6 +131,8 @@ canBeOpenAsTab
 HLWidget subclass: #HLBrowserBottomWidget
 	instanceVariableNames: 'model codeWidget documentationWidget'
 	package: 'Helios-Browser'!
+!HLBrowserBottomWidget commentStamp!
+I render the code area of a browser and optionally the documentation for the selected class.!
 
 !HLBrowserBottomWidget methodsFor: 'accessing'!
 
@@ -379,6 +383,8 @@ on: aClass selectorsCache: aSelectorsCache
 HLToolListWidget subclass: #HLClassesListWidget
 	instanceVariableNames: ''
 	package: 'Helios-Browser'!
+!HLClassesListWidget commentStamp!
+I render a list of classes in the selected package.!
 
 !HLClassesListWidget methodsFor: 'accessing'!
 
@@ -692,6 +698,8 @@ showInstance
 HLFocusableWidget subclass: #HLDocumentationWidget
 	instanceVariableNames: 'model'
 	package: 'Helios-Browser'!
+!HLDocumentationWidget commentStamp!
+I render the documentation for the selected class!
 
 !HLDocumentationWidget methodsFor: 'accessing'!
 
@@ -836,6 +844,8 @@ renderInheritanceOn: html
 HLToolListWidget subclass: #HLMethodsListWidget
 	instanceVariableNames: 'selectorsCache'
 	package: 'Helios-Browser'!
+!HLMethodsListWidget commentStamp!
+I render a list of methods for the selected protocol.!
 
 !HLMethodsListWidget methodsFor: 'accessing'!
 
@@ -1081,6 +1091,8 @@ selectorsCache
 HLToolListWidget subclass: #HLPackagesListWidget
 	instanceVariableNames: ''
 	package: 'Helios-Browser'!
+!HLPackagesListWidget commentStamp!
+I render a list of the system packages.!
 
 !HLPackagesListWidget methodsFor: 'accessing'!
 
@@ -1171,6 +1183,8 @@ renderItemLabel: aPackage on: html
 HLToolListWidget subclass: #HLProtocolsListWidget
 	instanceVariableNames: ''
 	package: 'Helios-Browser'!
+!HLProtocolsListWidget commentStamp!
+I render a list of protocols for the selected class.!
 
 !HLProtocolsListWidget methodsFor: 'accessing'!
 

+ 1 - 1
st/Kernel-Collections.st

@@ -1524,7 +1524,7 @@ add: anObject
 	<
 		var found;
 		for(var i=0; i < self['@elements'].length; i++) {
-			if(anObject == self['@elements'][i]) {
+			if(_st(anObject).__eq_eq(self['@elements'][i])) {
 				found = true;
 				break;
 			}

+ 4 - 0
st/Kernel-Tests.st

@@ -1604,6 +1604,10 @@ testSize
 	self assert: (Set withAll: #(1 1 1 1)) size equals: 1
 !
 
+testUnboxedObjects
+	self assert: {'foo' yourself. 'foo' yourself} asSet asArray equals: #('foo')
+!
+
 testUnicity
 	| set |
 	set := Set new.

Kaikkia tiedostoja ei voida näyttää, sillä liian monta tiedostoa muuttui tässä diffissä