Browse Source

fixes issue #499

Nicolas Petton 11 years ago
parent
commit
c551d0107c

+ 11 - 0
js/Helios-Core.deploy.js

@@ -381,6 +381,17 @@ return self}, function($ctx1) {$ctx1.fill(self,"handleUnkownVariableError:",{anE
 messageSends: ["announce:", "error:", "new", "yourself", "announcer"]}),
 smalltalk.HLToolModel);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "inspect:",
+fn: function (anObject){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+_st(_st(self)._environment())._inspect_(anObject);
+return self}, function($ctx1) {$ctx1.fill(self,"inspect:",{anObject:anObject},smalltalk.HLToolModel)})},
+messageSends: ["inspect:", "environment"]}),
+smalltalk.HLToolModel);
+
 smalltalk.addMethod(
 smalltalk.method({
 selector: "isToolModel",

+ 16 - 0
js/Helios-Core.js

@@ -508,6 +508,22 @@ referencedClasses: ["HLUnknownVariableErrorRaised"]
 }),
 smalltalk.HLToolModel);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "inspect:",
+category: 'actions',
+fn: function (anObject){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+_st(_st(self)._environment())._inspect_(anObject);
+return self}, function($ctx1) {$ctx1.fill(self,"inspect:",{anObject:anObject},smalltalk.HLToolModel)})},
+args: ["anObject"],
+source: "inspect: anObject\x0a\x09self environment inspect: anObject",
+messageSends: ["inspect:", "environment"],
+referencedClasses: []
+}),
+smalltalk.HLToolModel);
+
 smalltalk.addMethod(
 smalltalk.method({
 selector: "isToolModel",

+ 13 - 2
js/Helios-Workspace.deploy.js

@@ -77,6 +77,17 @@ return self}, function($ctx1) {$ctx1.fill(self,"environment:",{anEnvironment:anE
 messageSends: []}),
 smalltalk.HLCodeModel);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "inspect:",
+fn: function (anObject){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+_st(_st(self)._environment())._inspect_(anObject);
+return self}, function($ctx1) {$ctx1.fill(self,"inspect:",{anObject:anObject},smalltalk.HLCodeModel)})},
+messageSends: ["inspect:", "environment"]}),
+smalltalk.HLCodeModel);
+
 smalltalk.addMethod(
 smalltalk.method({
 selector: "receiver",
@@ -327,9 +338,9 @@ var newInspector;
 function $HLInspectItRequested(){return smalltalk.HLInspectItRequested||(typeof HLInspectItRequested=="undefined"?nil:HLInspectItRequested)}
 return smalltalk.withContext(function($ctx1) { 
 _st(_st(_st(self)._model())._announcer())._announce_(_st($HLInspectItRequested())._on_(self["@model"]));
-_st(_st(self)._doIt())._inspect();
+_st(_st(self)._model())._inspect_(_st(self)._doIt());
 return self}, function($ctx1) {$ctx1.fill(self,"inspectIt",{newInspector:newInspector},smalltalk.HLCodeWidget)})},
-messageSends: ["announce:", "on:", "announcer", "model", "inspect", "doIt"]}),
+messageSends: ["announce:", "on:", "announcer", "model", "inspect:", "doIt"]}),
 smalltalk.HLCodeWidget);
 
 smalltalk.addMethod(

+ 19 - 3
js/Helios-Workspace.js

@@ -102,6 +102,22 @@ referencedClasses: []
 }),
 smalltalk.HLCodeModel);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "inspect:",
+category: 'actions',
+fn: function (anObject){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+_st(_st(self)._environment())._inspect_(anObject);
+return self}, function($ctx1) {$ctx1.fill(self,"inspect:",{anObject:anObject},smalltalk.HLCodeModel)})},
+args: ["anObject"],
+source: "inspect: anObject\x0a\x09self environment inspect: anObject",
+messageSends: ["inspect:", "environment"],
+referencedClasses: []
+}),
+smalltalk.HLCodeModel);
+
 smalltalk.addMethod(
 smalltalk.method({
 selector: "receiver",
@@ -438,11 +454,11 @@ var newInspector;
 function $HLInspectItRequested(){return smalltalk.HLInspectItRequested||(typeof HLInspectItRequested=="undefined"?nil:HLInspectItRequested)}
 return smalltalk.withContext(function($ctx1) { 
 _st(_st(_st(self)._model())._announcer())._announce_(_st($HLInspectItRequested())._on_(self["@model"]));
-_st(_st(self)._doIt())._inspect();
+_st(_st(self)._model())._inspect_(_st(self)._doIt());
 return self}, function($ctx1) {$ctx1.fill(self,"inspectIt",{newInspector:newInspector},smalltalk.HLCodeWidget)})},
 args: [],
-source: "inspectIt\x0a\x09| newInspector |\x0a       \x0a\x09self model announcer announce: (HLInspectItRequested on: model).\x0a\x09self doIt inspect",
-messageSends: ["announce:", "on:", "announcer", "model", "inspect", "doIt"],
+source: "inspectIt\x0a\x09| newInspector |\x0a       \x0a\x09self model announcer announce: (HLInspectItRequested on: model).\x0a\x09self model inspect: self doIt",
+messageSends: ["announce:", "on:", "announcer", "model", "inspect:", "doIt"],
 referencedClasses: ["HLInspectItRequested"]
 }),
 smalltalk.HLCodeWidget);

+ 15 - 5
js/Kernel-Objects.deploy.js

@@ -1817,6 +1817,18 @@ return self}, function($ctx1) {$ctx1.fill(self,"evaluate:on:do:",{aBlock:aBlock,
 messageSends: ["try:catch:", "ifTrue:ifFalse:", "value:", "signal", "isKindOf:", "classNamed:", "name"]}),
 smalltalk.Environment);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "inspect:",
+fn: function (anObject){
+var self=this;
+function $InspectorHandler(){return smalltalk.InspectorHandler||(typeof InspectorHandler=="undefined"?nil:InspectorHandler)}
+return smalltalk.withContext(function($ctx1) { 
+_st(_st($InspectorHandler())._inspector())._inspect_(anObject);
+return self}, function($ctx1) {$ctx1.fill(self,"inspect:",{anObject:anObject},smalltalk.Environment)})},
+messageSends: ["inspect:", "inspector"]}),
+smalltalk.Environment);
+
 smalltalk.addMethod(
 smalltalk.method({
 selector: "moveClass:toPackage:",
@@ -2077,12 +2089,10 @@ selector: "register:",
 fn: function (anInspector){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $1;
+_st(console)._log_(_st(anInspector)._name());
 self["@inspector"]=anInspector;
-$1=self["@inspector"];
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"register:",{anInspector:anInspector},smalltalk.InspectorHandler.klass)})},
-messageSends: []}),
+return self}, function($ctx1) {$ctx1.fill(self,"register:",{anInspector:anInspector},smalltalk.InspectorHandler.klass)})},
+messageSends: ["log:", "name"]}),
 smalltalk.InspectorHandler.klass);
 
 

+ 21 - 6
js/Kernel-Objects.js

@@ -2516,6 +2516,23 @@ referencedClasses: []
 }),
 smalltalk.Environment);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "inspect:",
+category: 'actions',
+fn: function (anObject){
+var self=this;
+function $InspectorHandler(){return smalltalk.InspectorHandler||(typeof InspectorHandler=="undefined"?nil:InspectorHandler)}
+return smalltalk.withContext(function($ctx1) { 
+_st(_st($InspectorHandler())._inspector())._inspect_(anObject);
+return self}, function($ctx1) {$ctx1.fill(self,"inspect:",{anObject:anObject},smalltalk.Environment)})},
+args: ["anObject"],
+source: "inspect: anObject\x0a\x09InspectorHandler inspector inspect: anObject",
+messageSends: ["inspect:", "inspector"],
+referencedClasses: ["InspectorHandler"]
+}),
+smalltalk.Environment);
+
 smalltalk.addMethod(
 smalltalk.method({
 selector: "moveClass:toPackage:",
@@ -2858,14 +2875,12 @@ category: 'registration',
 fn: function (anInspector){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $1;
+_st(console)._log_(_st(anInspector)._name());
 self["@inspector"]=anInspector;
-$1=self["@inspector"];
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"register:",{anInspector:anInspector},smalltalk.InspectorHandler.klass)})},
+return self}, function($ctx1) {$ctx1.fill(self,"register:",{anInspector:anInspector},smalltalk.InspectorHandler.klass)})},
 args: ["anInspector"],
-source: "register: anInspector\x0a\x09^ inspector := anInspector",
-messageSends: [],
+source: "register: anInspector\x0a\x09console log: anInspector name.\x0a\x09inspector := anInspector",
+messageSends: ["log:", "name"],
 referencedClasses: []
 }),
 smalltalk.InspectorHandler.klass);

+ 4 - 0
st/Helios-Core.st

@@ -176,6 +176,10 @@ addInstVarNamed: aString
 		yourself)
 !
 
+inspect: anObject
+	self environment inspect: anObject
+!
+
 save: aString
 	self announcer announce: HLSourceCodeSaved new.
 	

+ 5 - 1
st/Helios-Workspace.st

@@ -30,6 +30,10 @@ receiver: anObject
 doIt: aString
 
 	^ self environment eval: aString on: self receiver
+!
+
+inspect: anObject
+	self environment inspect: anObject
 ! !
 
 !HLCodeModel methodsFor: 'defaults'!
@@ -159,7 +163,7 @@ inspectIt
 	| newInspector |
        
 	self model announcer announce: (HLInspectItRequested on: model).
-	self doIt inspect
+	self model inspect: self doIt
 !
 
 print: aString

+ 6 - 1
st/Kernel-Objects.st

@@ -782,6 +782,10 @@ eval: aString on: aReceiver
 	^ compiler evaluateExpression: aString on: aReceiver
 !
 
+inspect: anObject
+	InspectorHandler inspector inspect: anObject
+!
+
 moveClass: aClass toPackage: aPackageName
 	| package |
 	
@@ -913,7 +917,8 @@ inspect: anObject
 !
 
 register: anInspector
-	^ inspector := anInspector
+	console log: anInspector name.
+	inspector := anInspector
 ! !
 
 Object subclass: #JSObjectProxy