浏览代码

Move ivars from `obj["@x"]` to `obj.x`.

Step 3: Inline JS.
Herby Vojčík 6 年之前
父节点
当前提交
435756246a
共有 2 个文件被更改,包括 15 次插入15 次删除
  1. 10 10
      src/Web.js
  2. 5 5
      src/Web.st

+ 10 - 10
src/Web.js

@@ -2857,7 +2857,7 @@ var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
-var element=$self["@element"];
+var element=$self.element;
 	if (null == element.canHaveChildren || element.canHaveChildren) {
 	if (null == element.canHaveChildren || element.canHaveChildren) {
 		element.appendChild(anElement);
 		element.appendChild(anElement);
 	} else {
 	} else {
@@ -2870,7 +2870,7 @@ return self;
 },
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: ["anElement"],
 args: ["anElement"],
-source: "appendChild: anElement\x0a\x09\x22In IE7 and IE8 appendChild fails on several node types. So we need to check\x22\x0a\x09<inlineJS: 'var element=$self[\x22@element\x22];\x0a\x09if (null == element.canHaveChildren || element.canHaveChildren) {\x0a\x09\x09element.appendChild(anElement);\x0a\x09} else {\x0a\x09\x09element.text = String(element.text) + anElement.innerHTML;\x0a\x09}'>",
+source: "appendChild: anElement\x0a\x09\x22In IE7 and IE8 appendChild fails on several node types. So we need to check\x22\x0a\x09<inlineJS: 'var element=$self.element;\x0a\x09if (null == element.canHaveChildren || element.canHaveChildren) {\x0a\x09\x09element.appendChild(anElement);\x0a\x09} else {\x0a\x09\x09element.text = String(element.text) + anElement.innerHTML;\x0a\x09}'>",
 referencedClasses: [],
 referencedClasses: [],
 //>>excludeEnd("ide");
 //>>excludeEnd("ide");
 messageSends: []
 messageSends: []
@@ -3029,7 +3029,7 @@ var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
-return $self["@element"].hasAttribute(aString) ? $self["@element"].getAttribute(aString) : aBlock._value();
+return $self.element.hasAttribute(aString) ? $self.element.getAttribute(aString) : aBlock._value();
 return self;
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"at:ifAbsent:",{aString:aString,aBlock:aBlock},$globals.TagBrush)});
 }, function($ctx1) {$ctx1.fill(self,"at:ifAbsent:",{aString:aString,aBlock:aBlock},$globals.TagBrush)});
@@ -3037,7 +3037,7 @@ return self;
 },
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: ["aString", "aBlock"],
 args: ["aString", "aBlock"],
-source: "at: aString ifAbsent: aBlock\x0a\x09<inlineJS: 'return $self[\x22@element\x22].hasAttribute(aString) ? $self[\x22@element\x22].getAttribute(aString) : aBlock._value()'>",
+source: "at: aString ifAbsent: aBlock\x0a\x09<inlineJS: 'return $self.element.hasAttribute(aString) ? $self.element.getAttribute(aString) : aBlock._value()'>",
 referencedClasses: [],
 referencedClasses: [],
 //>>excludeEnd("ide");
 //>>excludeEnd("ide");
 messageSends: []
 messageSends: []
@@ -3053,7 +3053,7 @@ var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
-$self["@element"].setAttribute(aString, aValue); return aValue;
+$self.element.setAttribute(aString, aValue); return aValue;
 return self;
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"at:put:",{aString:aString,aValue:aValue},$globals.TagBrush)});
 }, function($ctx1) {$ctx1.fill(self,"at:put:",{aString:aString,aValue:aValue},$globals.TagBrush)});
@@ -3061,7 +3061,7 @@ return self;
 },
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: ["aString", "aValue"],
 args: ["aString", "aValue"],
-source: "at: aString put: aValue\x0a\x09<inlineJS: '$self[\x22@element\x22].setAttribute(aString, aValue); return aValue'>",
+source: "at: aString put: aValue\x0a\x09<inlineJS: '$self.element.setAttribute(aString, aValue); return aValue'>",
 referencedClasses: [],
 referencedClasses: [],
 //>>excludeEnd("ide");
 //>>excludeEnd("ide");
 messageSends: []
 messageSends: []
@@ -3077,7 +3077,7 @@ var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
-$self["@element"].className = aString;
+$self.element.className = aString;
 return self;
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"class:",{aString:aString},$globals.TagBrush)});
 }, function($ctx1) {$ctx1.fill(self,"class:",{aString:aString},$globals.TagBrush)});
@@ -3085,7 +3085,7 @@ return self;
 },
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: ["aString"],
 args: ["aString"],
-source: "class: aString\x0a\x09<inlineJS: '$self[\x22@element\x22].className = aString'>",
+source: "class: aString\x0a\x09<inlineJS: '$self.element.className = aString'>",
 referencedClasses: [],
 referencedClasses: [],
 //>>excludeEnd("ide");
 //>>excludeEnd("ide");
 messageSends: []
 messageSends: []
@@ -4058,7 +4058,7 @@ var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
-$self["@element"].removeAttribute(aString);
+$self.element.removeAttribute(aString);
 return self;
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"removeAt:",{aString:aString},$globals.TagBrush)});
 }, function($ctx1) {$ctx1.fill(self,"removeAt:",{aString:aString},$globals.TagBrush)});
@@ -4066,7 +4066,7 @@ return self;
 },
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: ["aString"],
 args: ["aString"],
-source: "removeAt: aString\x0a\x09<inlineJS: '$self[\x22@element\x22].removeAttribute(aString)'>",
+source: "removeAt: aString\x0a\x09<inlineJS: '$self.element.removeAttribute(aString)'>",
 referencedClasses: [],
 referencedClasses: [],
 //>>excludeEnd("ide");
 //>>excludeEnd("ide");
 messageSends: []
 messageSends: []

+ 5 - 5
src/Web.st

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