Browse Source

JSObjectProxy >> putOn:

... and ProtoStream >> nextPutJSObject:
Herbert Vojčík 9 years ago
parent
commit
7ac18c2a62

+ 8 - 0
API-CHANGES.txt

@@ -1,3 +1,11 @@
+0.14.12:
+
++ JSObjectProxy >>
+  + putOn:
++ ProtoStream >>
+  + nextPutJSObject:
+
+
 0.14.11:
 
 * Basic streaming protocol extracted from Stream to ProtoStream

+ 24 - 0
src/Kernel-Collections.js

@@ -8938,6 +8938,30 @@ messageSends: ["do:", "nextPut:"]
 }),
 $globals.ProtoStream);
 
+$core.addMethod(
+$core.method({
+selector: "nextPutJSObject:",
+protocol: 'writing',
+fn: function (aJSObject){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+self._nextPut_(aJSObject);
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"nextPutJSObject:",{aJSObject:aJSObject},$globals.ProtoStream)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aJSObject"],
+source: "nextPutJSObject: aJSObject\x0a\x09self nextPut: aJSObject",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["nextPut:"]
+}),
+$globals.ProtoStream);
+
 $core.addMethod(
 $core.method({
 selector: "nextPutString:",

+ 4 - 0
src/Kernel-Collections.st

@@ -2119,6 +2119,10 @@ nextPutAll: aCollection
 		self nextPut: each ]
 !
 
+nextPutJSObject: aJSObject
+	self nextPut: aJSObject
+!
+
 nextPutString: aString
 	self nextPut: aString
 !

+ 24 - 0
src/Kernel-Infrastructure.js

@@ -389,6 +389,30 @@ messageSends: []
 }),
 $globals.JSObjectProxy);
 
+$core.addMethod(
+$core.method({
+selector: "putOn:",
+protocol: 'accessing',
+fn: function (aStream){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+$recv(aStream)._nextPutJSObject_(self["@jsObject"]);
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"putOn:",{aStream:aStream},$globals.JSObjectProxy)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aStream"],
+source: "putOn: aStream\x0a\x09aStream nextPutJSObject: jsObject",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["nextPutJSObject:"]
+}),
+$globals.JSObjectProxy);
+
 
 $core.addMethod(
 $core.method({

+ 4 - 0
src/Kernel-Infrastructure.st

@@ -68,6 +68,10 @@ in: aValuable
 
 jsObject
 	^ jsObject
+!
+
+putOn: aStream
+	aStream nextPutJSObject: jsObject
 ! !
 
 !JSObjectProxy methodsFor: 'comparing'!