Browse Source

Compile both self and $self into method.

'self' meant to be used for the value.
'$self' meant to be used as a receiver.
ATM, both are defined as 'this'.
Herbert Vojčík 7 years ago
parent
commit
e29ccfd56c
3 changed files with 182 additions and 182 deletions
  1. 32 32
      src/Web-Snippets.js
  2. 145 145
      src/Web.js
  3. 5 5
      src/Web.st

+ 32 - 32
src/Web-Snippets.js

@@ -24,15 +24,15 @@ $core.method({
 selector: "initializeFromJQuery:",
 protocol: "initialization",
 fn: function (aJQuery){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-$recv(self._snippetsFromJQuery_(aJQuery))._do_((function(each){
+$recv($self._snippetsFromJQuery_(aJQuery))._do_((function(each){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
-return self._installSnippetFromJQuery_($recv(each)._asJQuery());
+return $self._installSnippetFromJQuery_($recv(each)._asJQuery());
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
 //>>excludeEnd("ctx");
@@ -56,7 +56,7 @@ $core.method({
 selector: "installSnippetFromJQuery:",
 protocol: "snippet installation",
 fn: function (element){
-var self=this;
+var self=this,$self=this;
 var name;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
@@ -73,7 +73,7 @@ $recv(element)._attr_put_("data-snippet","*");
 } else {
 $recv(element)._removeAttr_("data-snippet");
 }
-self._snippetAt_install_(name,$recv($recv(element)._detach())._get_((0)));
+$self._snippetAt_install_(name,$recv($recv(element)._detach())._get_((0)));
 }
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -94,11 +94,11 @@ $core.method({
 selector: "snippetAt:",
 protocol: "accessing",
 fn: function (aString){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-return $recv(self._snippets())._at_(aString);
+return $recv($self._snippets())._at_(aString);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"snippetAt:",{aString:aString},$globals.HTMLSnippet)});
 //>>excludeEnd("ctx");
@@ -117,7 +117,7 @@ $core.method({
 selector: "snippetAt:compile:",
 protocol: "method generation",
 fn: function (aString,anElement){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
@@ -149,12 +149,12 @@ $core.method({
 selector: "snippetAt:install:",
 protocol: "snippet installation",
 fn: function (aString,anElement){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-$recv(self._snippets())._at_put_(aString,anElement);
-self._snippetAt_compile_(aString,anElement);
+$recv($self._snippets())._at_put_(aString,anElement);
+$self._snippetAt_compile_(aString,anElement);
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"snippetAt:install:",{aString:aString,anElement:anElement},$globals.HTMLSnippet)});
@@ -174,15 +174,15 @@ $core.method({
 selector: "snippets",
 protocol: "accessing",
 fn: function (){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
 var $1,$receiver;
-$1=self["@snippets"];
+$1=$self["@snippets"];
 if(($receiver = $1) == null || $receiver.a$nil){
-self["@snippets"]=$globals.HashedCollection._newFromPairs_([]);
-return self["@snippets"];
+$self["@snippets"]=$globals.HashedCollection._newFromPairs_([]);
+return $self["@snippets"];
 } else {
 return $1;
 }
@@ -204,7 +204,7 @@ $core.method({
 selector: "snippetsFromJQuery:",
 protocol: "private",
 fn: function (aJQuery){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
@@ -229,8 +229,8 @@ $core.method({
 selector: "current",
 protocol: "instance creation",
 fn: function (){
-var self=this;
-return self["@current"];
+var self=this,$self=this;
+return $self["@current"];
 
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -247,24 +247,24 @@ $core.method({
 selector: "ensureCurrent",
 protocol: "initialization",
 fn: function (){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
 var $1,$2,$receiver;
-$1=self["@current"];
+$1=$self["@current"];
 if(($receiver = $1) == null || $receiver.a$nil){
 $2=(
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.supercall = true,
 //>>excludeEnd("ctx");
-($globals.HTMLSnippet.a$cls.superclass||$boot.nilAsClass).fn.prototype._new.apply($recv(self), []));
+($globals.HTMLSnippet.a$cls.superclass||$boot.nilAsClass).fn.prototype._new.apply($self, []));
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.supercall = false;
 //>>excludeEnd("ctx");;
 $recv($2)._initializeFromJQuery_($recv(document)._asJQuery());
-self["@current"]=$recv($2)._yourself();
-self["@current"];
+$self["@current"]=$recv($2)._yourself();
+$self["@current"];
 } else {
 $1;
 }
@@ -287,7 +287,7 @@ $core.method({
 selector: "initialize",
 protocol: "initialization",
 fn: function (){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
@@ -296,13 +296,13 @@ var $1;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.supercall = true,
 //>>excludeEnd("ctx");
-($globals.HTMLSnippet.a$cls.superclass||$boot.nilAsClass).fn.prototype._initialize.apply($recv(self), []));
+($globals.HTMLSnippet.a$cls.superclass||$boot.nilAsClass).fn.prototype._initialize.apply($self, []));
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.supercall = false;
 //>>excludeEnd("ctx");;
 $1=$recv($globals.PlatformDom)._isFeasible();
 if($core.assert($1)){
-self._ensureCurrent();
+$self._ensureCurrent();
 }
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -323,11 +323,11 @@ $core.method({
 selector: "new",
 protocol: "instance creation",
 fn: function (){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-self._shouldNotImplement();
+$self._shouldNotImplement();
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"new",{},$globals.HTMLSnippet.a$cls)});
@@ -347,11 +347,11 @@ $core.method({
 selector: "asSnippet",
 protocol: "*Web-Snippets",
 fn: function (){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-return $recv($recv($globals.HTMLSnippet)._current())._snippetAt_(self._asString());
+return $recv($recv($globals.HTMLSnippet)._current())._snippetAt_($self._asString());
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"asSnippet",{},$globals.CharacterArray)});
 //>>excludeEnd("ctx");
@@ -370,7 +370,7 @@ $core.method({
 selector: "snippet:",
 protocol: "*Web-Snippets",
 fn: function (anElement){
-var self=this;
+var self=this,$self=this;
 var clone,caret;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
@@ -381,7 +381,7 @@ $1=$recv($globals.TagBrush)._fromJQuery_canvas_(clone,self);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.sendIdx["fromJQuery:canvas:"]=1;
 //>>excludeEnd("ctx");
-self._with_($1);
+$self._with_($1);
 caret=$recv(clone)._find_("[data-snippet=\x22*\x22]");
 $recv($recv(caret)._toArray())._ifEmpty_((function(){
 caret=clone;

File diff suppressed because it is too large
+ 145 - 145
src/Web.js


+ 5 - 5
src/Web.st

@@ -562,7 +562,7 @@ appendBlock: aBlock
 
 appendChild: anElement
 	"In IE7 and IE8 appendChild fails on several node types. So we need to check"
-	<inlineJS: 'var element=self["@element"];
+	<inlineJS: 'var element=$self["@element"];
 	if (null == element.canHaveChildren || element.canHaveChildren) {
 		element.appendChild(anElement);
 	} else {
@@ -615,15 +615,15 @@ at: aString
 !
 
 at: aString ifAbsent: aBlock
-	<inlineJS: 'return self["@element"].hasAttribute(aString) ? self["@element"].getAttribute(aString) : aBlock._value()'>
+	<inlineJS: 'return $self["@element"].hasAttribute(aString) ? $self["@element"].getAttribute(aString) : aBlock._value()'>
 !
 
 at: aString put: aValue
-	<inlineJS: 'self["@element"].setAttribute(aString, aValue); return aValue'>
+	<inlineJS: '$self["@element"].setAttribute(aString, aValue); return aValue'>
 !
 
 class: aString
-	<inlineJS: 'self["@element"].className = aString'>
+	<inlineJS: '$self["@element"].className = aString'>
 !
 
 cols: aString
@@ -683,7 +683,7 @@ rel: aString
 !
 
 removeAt: aString
-	<inlineJS: 'self["@element"].removeAttribute(aString)'>
+	<inlineJS: '$self["@element"].removeAttribute(aString)'>
 !
 
 rows: aString

Some files were not shown because too many files changed in this diff