1
0
Herby Vojčík 4 vuotta sitten
vanhempi
commit
1c6b30f906
2 muutettua tiedostoa jossa 101 lisäystä ja 100 poistoa
  1. 81 78
      src/Silk-Tests.js
  2. 20 22
      src/Silk.js

+ 81 - 78
src/Silk-Tests.js

@@ -47,22 +47,21 @@ var sanitizedBody,sanitizedAssertion;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-var $2,$3,$1;
-sanitizedBody=$recv($recv($recv(document)._body())._innerHTML())._replace_with_("\x5cs*","");
+sanitizedBody=[$recv($recv($recv(document)._body())._innerHTML())._replace_with_("\x5cs*","")
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-$ctx1.sendIdx["replace:with:"]=1;
+,$ctx1.sendIdx["replace:with:"]=1
 //>>excludeEnd("ctx");
+][0];
 sanitizedAssertion=$recv(aString)._replace_with_("\x5cs*","");
-$2=$recv(sanitizedBody)._size();
+$self._assert_($recv([$recv(sanitizedBody)._size()
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-$ctx1.sendIdx["size"]=1;
+,$ctx1.sendIdx["size"]=1
 //>>excludeEnd("ctx");
-$3=$recv(sanitizedAssertion)._size();
+][0]).__gt_eq([$recv(sanitizedAssertion)._size()
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-$ctx1.sendIdx["size"]=2;
+,$ctx1.sendIdx["size"]=2
 //>>excludeEnd("ctx");
-$1=$recv($2).__gt_eq($3);
-$self._assert_($1);
+][0]));
 $self._assert_equals_($recv(sanitizedBody)._last_($recv(sanitizedAssertion)._size()),sanitizedAssertion);
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -88,13 +87,14 @@ var sanitizedBody,err;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-var $2,$3,$1,$4,$receiver;
+var $1;
 var $early={};
 try {
-sanitizedBody=$recv($recv($recv(document)._body())._innerHTML())._replace_with_("\x5cs*","");
+sanitizedBody=[$recv($recv($recv(document)._body())._innerHTML())._replace_with_("\x5cs*","")
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-$ctx1.sendIdx["replace:with:"]=1;
+,$ctx1.sendIdx["replace:with:"]=1
 //>>excludeEnd("ctx");
+][0];
 $recv(aStringArray)._do_((function(aString){
 var sanitizedAssertion;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -105,16 +105,15 @@ return $recv((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx3) {
 //>>excludeEnd("ctx");
-$2=$recv(sanitizedBody)._size();
+$self._assert_($recv([$recv(sanitizedBody)._size()
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-$ctx3.sendIdx["size"]=1;
+,$ctx3.sendIdx["size"]=1
 //>>excludeEnd("ctx");
-$3=$recv(sanitizedAssertion)._size();
+][0]).__gt_eq([$recv(sanitizedAssertion)._size()
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-$ctx3.sendIdx["size"]=2;
+,$ctx3.sendIdx["size"]=2
 //>>excludeEnd("ctx");
-$1=$recv($2).__gt_eq($3);
-$self._assert_($1);
+][0]));
 $self._assert_equals_($recv(sanitizedBody)._last_($recv(sanitizedAssertion)._size()),sanitizedAssertion);
 throw $early=[self];
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -129,9 +128,9 @@ return err;
 }, function($ctx2) {$ctx2.fillBlock({aString:aString,sanitizedAssertion:sanitizedAssertion},$ctx1,1)});
 //>>excludeEnd("ctx");
 }));
-$4=err;
-if(($receiver = $4) == null || $receiver.a$nil){
-$4;
+$1=err;
+if($1 == null || $1.a$nil){
+$1;
 } else {
 $recv(err)._signal();
 }
@@ -188,12 +187,11 @@ var lastChild;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-var $1;
-$1=$recv(document)._body();
+lastChild=$recv([$recv(document)._body()
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-$ctx1.sendIdx["body"]=1;
+,$ctx1.sendIdx["body"]=1
 //>>excludeEnd("ctx");
-lastChild=$recv($1)._lastChild();
+][0])._lastChild();
 $self._assert_equals_(lastChild,$self.fixtureDiv);
 $recv($recv(document)._body())._removeChild_(lastChild);
 return self;
@@ -223,31 +221,37 @@ return $core.withContext(function($ctx1) {
 var $1,$2;
 d="html body div#fixture"._asSilk();
 tbl=$recv(d)._TABLE();
-$1=$recv(tbl)._TR();
+$1=[$recv(tbl)._TR()
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-$ctx1.sendIdx["TR"]=1;
+,$ctx1.sendIdx["TR"]=1
 //>>excludeEnd("ctx");
-$recv($1)._TD_("A");
+][0];
+[$recv($1)._TD_("A")
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-$ctx1.sendIdx["TD:"]=1;
+,$ctx1.sendIdx["TD:"]=1
 //>>excludeEnd("ctx");
-$recv($1)._TD_("B");
+][0];
+[$recv($1)._TD_("B")
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-$ctx1.sendIdx["TD:"]=2;
+,$ctx1.sendIdx["TD:"]=2
 //>>excludeEnd("ctx");
-$recv($1)._TD_("C");
+][0];
+[$recv($1)._TD_("C")
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-$ctx1.sendIdx["TD:"]=3;
+,$ctx1.sendIdx["TD:"]=3
 //>>excludeEnd("ctx");
+][0];
 $2=$recv(tbl)._TR();
-$recv($2)._TD_("D");
+[$recv($2)._TD_("D")
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-$ctx1.sendIdx["TD:"]=4;
+,$ctx1.sendIdx["TD:"]=4
 //>>excludeEnd("ctx");
-$recv($2)._TD_("E");
+][0];
+[$recv($2)._TD_("E")
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-$ctx1.sendIdx["TD:"]=5;
+,$ctx1.sendIdx["TD:"]=5
 //>>excludeEnd("ctx");
+][0];
 $recv($2)._TD_("F");
 $self._assertBodyEndsWith_(">sentinel<table><tr><td>A</td><td>B</td><td>C</td></tr><tr><td>D</td><td>E</td><td>F</td></tr></table></div>");
 return self;
@@ -274,37 +278,36 @@ var d,tbl;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-var $1,$3,$4,$5,$2,$7,$8,$6;
+var $1;
 d="html body div#fixture"._asSilk();
 tbl=$recv(d)._TABLE();
 $1=tbl;
-$3=$recv($globals.Silk)._TD_("A");
+[$recv($1)._TR_([[$recv($globals.Silk)._TD_("A")
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-$ctx1.sendIdx["TD:"]=1;
+,$ctx1.sendIdx["TD:"]=1
 //>>excludeEnd("ctx");
-$4=$recv($globals.Silk)._TD_("B");
+][0],[$recv($globals.Silk)._TD_("B")
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-$ctx1.sendIdx["TD:"]=2;
+,$ctx1.sendIdx["TD:"]=2
 //>>excludeEnd("ctx");
-$5=$recv($globals.Silk)._TD_("C");
+][0],[$recv($globals.Silk)._TD_("C")
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-$ctx1.sendIdx["TD:"]=3;
+,$ctx1.sendIdx["TD:"]=3
 //>>excludeEnd("ctx");
-$2=[$3,$4,$5];
-$recv($1)._TR_($2);
+][0]])
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-$ctx1.sendIdx["TR:"]=1;
+,$ctx1.sendIdx["TR:"]=1
 //>>excludeEnd("ctx");
-$7=$recv($globals.Silk)._TD_("D");
+][0];
+$recv($1)._TR_([[$recv($globals.Silk)._TD_("D")
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-$ctx1.sendIdx["TD:"]=4;
+,$ctx1.sendIdx["TD:"]=4
 //>>excludeEnd("ctx");
-$8=$recv($globals.Silk)._TD_("E");
+][0],[$recv($globals.Silk)._TD_("E")
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-$ctx1.sendIdx["TD:"]=5;
+,$ctx1.sendIdx["TD:"]=5
 //>>excludeEnd("ctx");
-$6=[$7,$8,$recv($globals.Silk)._TD_("F")];
-$recv($1)._TR_($6);
+][0],$recv($globals.Silk)._TD_("F")]);
 $self._assertBodyEndsWith_(">sentinel<table><tr><td>A</td><td>B</td><td>C</td></tr><tr><td>D</td><td>E</td><td>F</td></tr></table></div>");
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -330,54 +333,54 @@ var s;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-var $2,$3,$1,$4,$6,$7,$5,$9,$10,$8;
 s="#fixture"._asSilk();
-$2=$recv(s)._DIV();
+s=[$recv([$recv([$recv(s)._DIV()
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-$ctx1.sendIdx["DIV"]=1;
+,$ctx1.sendIdx["DIV"]=1
 //>>excludeEnd("ctx");
-$3="id".__minus_gt("container");
+][0]).__lt_lt(["id".__minus_gt("container")
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-$ctx1.sendIdx["->"]=1;
+,$ctx1.sendIdx["->"]=1
 //>>excludeEnd("ctx");
-$1=$recv($2).__lt_lt($3);
+][0])
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-$ctx1.sendIdx["<<"]=2;
+,$ctx1.sendIdx["<<"]=2
 //>>excludeEnd("ctx");
-$4="class".__minus_gt("mySilkContainerClass");
+][0]).__lt_lt(["class".__minus_gt("mySilkContainerClass")
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-$ctx1.sendIdx["->"]=2;
+,$ctx1.sendIdx["->"]=2
 //>>excludeEnd("ctx");
-s=$recv($1).__lt_lt($4);
+][0])
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-$ctx1.sendIdx["<<"]=1;
+,$ctx1.sendIdx["<<"]=1
 //>>excludeEnd("ctx");
-$6=$recv(s)._DIV();
+][0];
+[$recv([$recv([$recv(s)._DIV()
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-$ctx1.sendIdx["DIV"]=2;
+,$ctx1.sendIdx["DIV"]=2
 //>>excludeEnd("ctx");
-$7="id".__minus_gt("contentarea");
+][0]).__lt_lt(["id".__minus_gt("contentarea")
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-$ctx1.sendIdx["->"]=3;
+,$ctx1.sendIdx["->"]=3
 //>>excludeEnd("ctx");
-$5=$recv($6).__lt_lt($7);
+][0])
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-$ctx1.sendIdx["<<"]=4;
+,$ctx1.sendIdx["<<"]=4
 //>>excludeEnd("ctx");
-$recv($5).__lt_lt("here comes the content");
+][0]).__lt_lt("here comes the content")
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-$ctx1.sendIdx["<<"]=3;
+,$ctx1.sendIdx["<<"]=3
 //>>excludeEnd("ctx");
-$9=$recv(s)._DIV();
-$10="id".__minus_gt("toolbar");
+][0];
+s=[$recv($recv($recv(s)._DIV()).__lt_lt(["id".__minus_gt("toolbar")
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-$ctx1.sendIdx["->"]=4;
+,$ctx1.sendIdx["->"]=4
 //>>excludeEnd("ctx");
-$8=$recv($9).__lt_lt($10);
-s=$recv($8).__lt_lt("class".__minus_gt("myToolbarClass"));
+][0])).__lt_lt("class".__minus_gt("myToolbarClass"))
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-$ctx1.sendIdx["<<"]=5;
+,$ctx1.sendIdx["<<"]=5
 //>>excludeEnd("ctx");
+][0];
 $recv($recv(s)._BUTTON_("do something"))._on_bind_("click",(function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx2) {

+ 20 - 22
src/Silk.js

@@ -73,17 +73,18 @@ var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-var $1,$receiver;
+var $1;
 $1=$recv(anObject)._renderOnSilk_(self);
-if(($receiver = $1) == null || $receiver.a$nil){
-(
+if($1 == null || $1.a$nil){
+[(
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.supercall = true,
 //>>excludeEnd("ctx");
-($methodClass.superclass||$boot.nilAsClass).fn.prototype._nextPut_.call($self,anObject));
+($methodClass.superclass||$boot.nilAsClass).fn.prototype._nextPut_.call($self,anObject))
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-$ctx1.supercall = false;
-//>>excludeEnd("ctx");;
+,$ctx1.supercall = false
+//>>excludeEnd("ctx");
+][0];
 } else {
 $1;
 }
@@ -157,17 +158,18 @@ var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-var $1,$receiver;
+var $1;
 $1=$self._tryMakeDnuElement_(aMessage);
-if(($receiver = $1) == null || $receiver.a$nil){
-return (
+if($1 == null || $1.a$nil){
+return [(
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.supercall = true,
 //>>excludeEnd("ctx");
-($methodClass.superclass||$boot.nilAsClass).fn.prototype._doesNotUnderstand_.call($self,aMessage));
+($methodClass.superclass||$boot.nilAsClass).fn.prototype._doesNotUnderstand_.call($self,aMessage))
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-$ctx1.supercall = false;
-//>>excludeEnd("ctx");;
+,$ctx1.supercall = false
+//>>excludeEnd("ctx");
+][0];
 } else {
 return $1;
 }
@@ -217,17 +219,15 @@ var selector,newElement,useArg;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-var $1,$2,$3,$4;
 selector=$recv(aMessage)._selector();
-$1=$recv($recv(selector)._asUppercase()).__eq(selector);
+if(!$core.assert([$recv($recv(selector)._asUppercase()).__eq(selector)
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-$ctx1.sendIdx["="]=1;
+,$ctx1.sendIdx["="]=1
 //>>excludeEnd("ctx");
-if(!$core.assert($1)){
+][0])){
 return nil;
 }
-$2=$recv($recv(selector)._last()).__eq(":");
-if($core.assert($2)){
+if($core.assert($recv($recv(selector)._last()).__eq(":"))){
 useArg=true;
 selector=$recv(selector)._allButLast();
 selector;
@@ -235,13 +235,11 @@ selector;
 useArg=false;
 useArg;
 }
-$3=$recv(selector)._includes_(":");
-if($core.assert($3)){
+if($core.assert($recv(selector)._includes_(":"))){
 return nil;
 }
 newElement=$self._newElement_xmlns_($recv(selector)._asLowercase(),$self._namespace());
-$4=useArg;
-if($core.assert($4)){
+if($core.assert(useArg)){
 $recv(newElement).__lt_lt($recv($recv(aMessage)._arguments())._first());
 }
 return newElement;