1
0
Ver Fonte

Recompile.

Herby Vojčík há 3 anos atrás
pai
commit
0625ecc192

+ 0 - 2
lang/src/Compiler-AST.js

@@ -1134,8 +1134,6 @@ return $recv([$self._arguments()
 ,$ctx1.sendIdx["arguments"]=1
 //>>excludeEnd("ctx");
 ][0])._copy();
-} else {
-$1;
 }
 return $recv($self._arguments())._copyWithFirst_($self._receiver());
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);

+ 1 - 5
lang/src/Compiler-IR.js

@@ -24,9 +24,7 @@ var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-if(anInstruction == null || anInstruction.a$nil){
-anInstruction;
-} else {
+if(anInstruction != null && !anInstruction.a$nil){
 if(!$core.assert($recv(anInstruction)._isVariable())){
 $recv($self._sequence())._add_(anInstruction);
 }
@@ -122,8 +120,6 @@ return nil;
 $2=threshold;
 if($2 == null || $2.a$nil){
 return $self._visitAll_(aCollection);
-} else {
-$2;
 }
 shouldAlias=true;
 return $recv(aCollection)._collect_((function(each){

+ 1 - 3
lang/src/Compiler-Inlining.js

@@ -37,9 +37,7 @@ if($core.assert([$recv($recv($globals.IRSendInliner)._inlinedSelectors())._inclu
 //>>excludeEnd("ctx");
 ][0];
 $1=$recv(aNode)._receiver();
-if($1 == null || $1.a$nil){
-$1;
-} else {
+if($1 != null && !$1.a$nil){
 var receiver;
 receiver=$1;
 if($core.assert($recv($recv($globals.IRSendInliner)._inlinedSelectorsNeedingIdempotentReceiver())._includes_($recv(aNode)._selector()))){

+ 7 - 35
lang/src/Compiler-Interpreter.js

@@ -403,8 +403,6 @@ return $recv(context)._ast();
 $2=$self.ast;
 if($2 == null || $2.a$nil){
 $self._initializeAST();
-} else {
-$2;
 }
 return $self.ast;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -719,15 +717,11 @@ $1=[$recv(aMethodContext)._outerContext()
 ,$ctx1.sendIdx["outerContext"]=1
 //>>excludeEnd("ctx");
 ][0];
-if($1 == null || $1.a$nil){
-$1;
-} else {
+if($1 != null && !$1.a$nil){
 var outer;
 outer=$1;
 $2=$recv(outer)._methodContext();
-if($2 == null || $2.a$nil){
-$2;
-} else {
+if($2 != null && !$2.a$nil){
 $self._outerContext_($recv($self._class())._fromMethodContext_($recv(aMethodContext)._outerContext()));
 }
 $recv([$recv(aMethodContext)._locals()
@@ -772,9 +766,7 @@ $1=$recv($globals.ASTInterpreter)._new();
 $recv($1)._context_(self);
 $self.interpreter=$recv($1)._yourself();
 $2=$self._innerContext();
-if($2 == null || $2.a$nil){
-$2;
-} else {
+if($2 != null && !$2.a$nil){
 $self._setupInterpreter_($self.interpreter);
 }
 return self;
@@ -866,8 +858,6 @@ var $1;
 $1=$self.interpreter;
 if($1 == null || $1.a$nil){
 $self._initializeInterpreter();
-} else {
-$1;
 }
 return $self.interpreter;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -1026,8 +1016,6 @@ var $1;
 $1=$self.locals;
 if($1 == null || $1.a$nil){
 $self._initializeLocals();
-} else {
-$1;
 }
 return $self.locals;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -1174,9 +1162,7 @@ return $core.withContext(function($ctx1) {
 var $1;
 $self.outerContext=anAIContext;
 $1=$self.outerContext;
-if($1 == null || $1.a$nil){
-$1;
-} else {
+if($1 != null && !$1.a$nil){
 var context;
 context=$1;
 $recv(context)._innerContext_(self);
@@ -1355,9 +1341,7 @@ $recv($1)._visit_([$self._ast()
 ][0]);
 currentNode=$recv($1)._currentNode();
 $2=$recv($self._ast())._sequenceNode();
-if($2 == null || $2.a$nil){
-$2;
-} else {
+if($2 != null && !$2.a$nil){
 var sequence;
 sequence=$2;
 [$recv($recv(sequence)._temps())._do_((function(each){
@@ -1662,8 +1646,6 @@ $1=[$self._context()
 ][0];
 if($1 == null || $1.a$nil){
 return true;
-} else {
-$1;
 }
 if($core.assert($recv($self._interpreter())._atEnd())){
 return $recv($self._context())._isTopContext();
@@ -1731,9 +1713,7 @@ return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
 var $1;
 $1=$self._context();
-if($1 == null || $1.a$nil){
-$1;
-} else {
+if($1 != null && !$1.a$nil){
 var cxt;
 cxt=$1;
 $recv(cxt)._innerContext_(nil);
@@ -1841,9 +1821,7 @@ if($core.assert([$recv([$self._interpreter()
 //>>excludeEnd("ctx");
 ][0])){
 $1=$recv($self._context())._outerContext();
-if($1 == null || $1.a$nil){
-$1;
-} else {
+if($1 != null && !$1.a$nil){
 var outerContext;
 outerContext=$1;
 $self._context_(outerContext);
@@ -2852,8 +2830,6 @@ return [$self._messageNotUnderstood_receiver_(aMessage,anObject)
 ,$ctx1.sendIdx["messageNotUnderstood:receiver:"]=1
 //>>excludeEnd("ctx");
 ][0];
-} else {
-$1;
 }
 $2=$recv(parent)._at_(aString);
 if($2 == null || $2.a$nil){
@@ -2898,8 +2874,6 @@ return [$self._messageNotUnderstood_receiver_(aMessage,anObject)
 ,$ctx1.sendIdx["messageNotUnderstood:receiver:"]=1
 //>>excludeEnd("ctx");
 ][0];
-} else {
-$1;
 }
 $2=$recv(parent)._at_(aString);
 if($2 == null || $2.a$nil){
@@ -2940,8 +2914,6 @@ return [$self._messageNotUnderstood_receiver_(aMessage,anObject)
 ,$ctx1.sendIdx["messageNotUnderstood:receiver:"]=1
 //>>excludeEnd("ctx");
 ][0];
-} else {
-$1;
 }
 $2=$recv(parent)._lookupSelector_($recv(aMessage)._selector());
 if($2 == null || $2.a$nil){

+ 4 - 20
lang/src/Compiler-Semantic.js

@@ -254,9 +254,7 @@ $recv($2)._scope_($recv(old)._scope());
 $recv($2)._name_($recv(old)._name());
 $recv($1)._binding_($recv($2)._yourself());
 $3=$self._args();
-if($3 == null || $3.a$nil){
-$3;
-} else {
+if($3 != null && !$3.a$nil){
 var myArgs;
 myArgs=$3;
 if(!$core.assert($recv(myArgs).__eq([$self._arguments()
@@ -696,8 +694,6 @@ lookup=$2;
 lookup=$recv($self._outerScope())._lookupVariable_(aString);
 }
 lookup;
-} else {
-$1;
 }
 return lookup;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -860,8 +856,6 @@ $1=[$self._outerScope()
 ][0];
 if($1 == null || $1.a$nil){
 return (1);
-} else {
-$1;
 }
 if($core.assert($self._isInlined())){
 return [$recv([$self._outerScope()
@@ -1252,8 +1246,6 @@ return $recv($2)._at_put_(each,$recv($3)._yourself());
 }, function($ctx2) {$ctx2.fillBlock({each:each,impl:impl},$ctx1,2)});
 //>>excludeEnd("ctx");
 }));
-} else {
-$1;
 }
 return $self.pseudoVars;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -2125,9 +2117,7 @@ var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-if(aPackage == null || aPackage.a$nil){
-aPackage;
-} else {
+if(aPackage != null && !aPackage.a$nil){
 var packageKnownVars;
 packageKnownVars=$recv($recv($recv(aPackage)._imports())._reject_("isString"))._collect_("key");
 if($core.assert($recv(packageKnownVars)._includes_(aString))){
@@ -2276,8 +2266,6 @@ $1=$self.blockIndex;
 if($1 == null || $1.a$nil){
 $self.blockIndex=(0);
 $self.blockIndex;
-} else {
-$1;
 }
 $self.blockIndex=$recv($self.blockIndex).__plus((1));
 return $self.blockIndex;
@@ -2305,9 +2293,7 @@ return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
 var $1;
 $1=$self.currentScope;
-if($1 == null || $1.a$nil){
-$1;
-} else {
+if($1 != null && !$1.a$nil){
 $self.currentScope=$recv($self.currentScope)._outerScope();
 $self.currentScope;
 }
@@ -2435,9 +2421,7 @@ return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
 var $1;
 $1=$recv($self.currentScope)._lookupVariable_(aString);
-if($1 == null || $1.a$nil){
-$1;
-} else {
+if($1 != null && !$1.a$nil){
 $self._errorShadowingVariable_(aString);
 }
 return self;

+ 1 - 3
lang/src/Compiler-Tests.js

@@ -4798,9 +4798,7 @@ $recv($1)._selector_($recv(ast)._selector());
 $recv($1)._interpreter_($recv($globals.ASTInterpreter)._new());
 ctx=$recv($1)._yourself();
 $2=$recv(ast)._sequenceNode();
-if($2 == null || $2.a$nil){
-$2;
-} else {
+if($2 != null && !$2.a$nil){
 var sequence;
 sequence=$2;
 $recv($recv(sequence)._temps())._do_((function(each){

+ 7 - 23
lang/src/Kernel-Classes.js

@@ -133,8 +133,6 @@ $1=[$self._superclass()
 ][0];
 if($1 == null || $1.a$nil){
 return [];
-} else {
-$1;
 }
 return $recv($recv([$self._superclass()
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -1388,9 +1386,7 @@ var $1,$2;
 theClass=$recv($recv($globals.Smalltalk)._globals())._at_(className);
 thePackage=$recv($globals.Package)._named_(packageName);
 $1=theClass;
-if($1 == null || $1.a$nil){
-$1;
-} else {
+if($1 != null && !$1.a$nil){
 $recv(theClass)._package_(thePackage);
 if(!$core.assert($recv($recv(theClass)._superclass()).__eq_eq(aClass))){
 return $self._migrateClassNamed_superclass_slots_package_(className,aClass,aCollection,packageName);
@@ -1426,9 +1422,7 @@ var $1,$2,$3,$4;
 theTrait=$recv($recv($globals.Smalltalk)._globals())._at_(traitName);
 thePackage=$recv($globals.Package)._named_(packageName);
 $1=theTrait;
-if($1 == null || $1.a$nil){
-$1;
-} else {
+if($1 != null && !$1.a$nil){
 $2=theTrait;
 $recv($2)._package_(thePackage);
 $recv($2)._recompile();
@@ -2448,9 +2442,7 @@ return $core.withContext(function($ctx1) {
 var $1;
 result=$recv($self._slots())._copy();
 $1=$self._superclass();
-if($1 == null || $1.a$nil){
-$1;
-} else {
+if($1 != null && !$1.a$nil){
 var s;
 s=$1;
 $recv(result)._addAll_($recv(s)._allSlots());
@@ -2649,18 +2641,14 @@ var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-if(aMethod == null || aMethod.a$nil){
-aMethod;
-} else {
+if(aMethod != null && !aMethod.a$nil){
 $recv($self._organization())._addElement_([$recv(aMethod)._protocol()
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 ,$ctx1.sendIdx["protocol"]=1
 //>>excludeEnd("ctx");
 ][0]);
 }
-if(oldMethod == null || oldMethod.a$nil){
-oldMethod;
-} else {
+if(oldMethod != null && !oldMethod.a$nil){
 $self._removeProtocolIfEmpty_($recv(oldMethod)._protocol());
 }
 return self;
@@ -3535,9 +3523,7 @@ return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
 var $1,$2;
 $1=$globals.Smalltalk;
-if($1 == null || $1.a$nil){
-$1;
-} else {
+if($1 != null && !$1.a$nil){
 $2=$self._basicAt_("category");
 if($2 == null || $2.a$nil){
 [$self._basicPackage_(nil)
@@ -3577,9 +3563,7 @@ return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
 var $1;
 $1=$globals.Smalltalk;
-if($1 == null || $1.a$nil){
-$1;
-} else {
+if($1 != null && !$1.a$nil){
 $recv($recv($self._package())._organization())._removeElement_(self);
 }
 return self;

+ 2 - 6
lang/src/Kernel-Infrastructure.js

@@ -2713,9 +2713,7 @@ return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
 var $1;
 $1=$recv(anAnnouncement)._theClass();
-if($1 == null || $1.a$nil){
-$1;
-} else {
+if($1 != null && !$1.a$nil){
 var theClass;
 theClass=$1;
 $recv($recv(theClass)._package())._beDirty();
@@ -2745,9 +2743,7 @@ return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
 var $1;
 $1=$recv($recv(anAnnouncement)._method())._package();
-if($1 == null || $1.a$nil){
-$1;
-} else {
+if($1 != null && !$1.a$nil){
 var package_;
 package_=$1;
 $recv(package_)._beDirty();

+ 2 - 10
lang/src/Kernel-Methods.js

@@ -1233,8 +1233,6 @@ superclass=[$recv([$self._methodClass()
 $1=superclass;
 if($1 == null || $1.a$nil){
 return false;
-} else {
-$1;
 }
 return $recv($recv($recv($self._methodClass())._superclass())._lookupSelector_($self._selector()))._notNil();
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -1441,9 +1439,7 @@ var $1,$2,$3,$4;
 oldProtocol=$self._protocol();
 $self.protocol=aString;
 $1=oldProtocol;
-if($1 == null || $1.a$nil){
-$1;
-} else {
+if($1 != null && !$1.a$nil){
 $2=$recv($globals.SystemAnnouncer)._current();
 $3=$recv($globals.MethodMoved)._new();
 $recv($3)._method_(self);
@@ -1451,9 +1447,7 @@ $recv($3)._oldProtocol_(oldProtocol);
 $recv($2)._announce_($recv($3)._yourself());
 }
 $4=$self._origin();
-if($4 == null || $4.a$nil){
-$4;
-} else {
+if($4 != null && !$4.a$nil){
 var origin;
 origin=$4;
 $recv($recv(origin)._organization())._addElement_(aString);
@@ -3576,8 +3570,6 @@ $1=[$self._methodContext()
 ][0];
 if($1 == null || $1.a$nil){
 return nil;
-} else {
-$1;
 }
 receiverClass=$recv($recv([$self._methodContext()
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);

+ 2 - 6
lang/src/Kernel-Tests.js

@@ -1990,9 +1990,7 @@ return $core.withContext(function($ctx1) {
 var $1;
 $self._tearDownTheClass();
 $1=$self.theClass;
-if($1 == null || $1.a$nil){
-$1;
-} else {
+if($1 != null && !$1.a$nil){
 $self._deny_($recv($recv($recv($self.theClass)._package())._classes())._includes_($self.theClass));
 $self._assert_equals_($recv($recv($globals.Smalltalk)._globals())._at_($recv($self.theClass)._name()),nil);
 }
@@ -18088,9 +18086,7 @@ return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
 var $1;
 $1=$self._theClass();
-if($1 == null || $1.a$nil){
-$1;
-} else {
+if($1 != null && !$1.a$nil){
 var theClass;
 theClass=$1;
 $recv($recv($globals.Array)._streamContents_((function(s){

+ 3 - 13
lang/src/Platform-ImportExport.js

@@ -1371,8 +1371,6 @@ if($1 == null || $1.a$nil){
 ,$ctx1.sendIdx["lf"]=5
 //>>excludeEnd("ctx");
 ][0];
-} else {
-$1;
 }
 [$recv(aStream)._write_("//>>excludeStart(\x22ide\x22, pragmas.excludeIdeData);")
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -1470,9 +1468,7 @@ $1;
 //>>excludeEnd("ctx");
 ][0];
 $2=$recv(aMethod)._instantiateFn();
-if($2 == null || $2.a$nil){
-$2;
-} else {
+if($2 != null && !$2.a$nil){
 var ifn;
 ifn=$2;
 [$recv(aStream)._write_([", ",$recv(ifn)._compiledSource()])
@@ -1608,9 +1604,7 @@ return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
 var $1;
 $1=$recv(aPackage)._contextFunctionSource();
-if($1 == null || $1.a$nil){
-$1;
-} else {
+if($1 != null && !$1.a$nil){
 var source;
 source=$1;
 $recv(aStream)._write_(["$pkg.context = ",source,";"]);
@@ -4099,8 +4093,6 @@ return [$self._for_($self._defaultType())
 ,$ctx1.sendIdx["for:"]=1
 //>>excludeEnd("ctx");
 ][0];
-} else {
-anObject;
 }
 $1=$self._for_($recv(anObject)._type());
 $recv($1)._setupFromJson_(anObject);
@@ -4195,9 +4187,7 @@ $1=[$recv(aClass)._type()
 ,$ctx1.sendIdx["type"]=1
 //>>excludeEnd("ctx");
 ][0];
-if($1 == null || $1.a$nil){
-$1;
-} else {
+if($1 != null && !$1.a$nil){
 $recv($self.registry)._at_put_($recv(aClass)._type(),aClass);
 }
 return self;

+ 7 - 27
lang/src/Platform-Services.js

@@ -29,9 +29,7 @@ $1=[$recv(anError)._context()
 ,$ctx1.sendIdx["context"]=1
 //>>excludeEnd("ctx");
 ][0];
-if($1 == null || $1.a$nil){
-$1;
-} else {
+if($1 != null && !$1.a$nil){
 $self._logErrorContext_($recv(anError)._context());
 }
 $self._logError_(anError);
@@ -88,9 +86,7 @@ $1=[$recv(aContext)._home()
 ,$ctx1.sendIdx["home"]=1
 //>>excludeEnd("ctx");
 ][0];
-if($1 == null || $1.a$nil){
-$1;
-} else {
+if($1 != null && !$1.a$nil){
 $self._logContext_($recv(aContext)._home());
 }
 $self._log_($recv(aContext)._asString());
@@ -142,17 +138,13 @@ var self=this,$self=this;
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
 var $1;
-if(aContext == null || aContext.a$nil){
-aContext;
-} else {
+if(aContext != null && !aContext.a$nil){
 $1=[$recv(aContext)._home()
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 ,$ctx1.sendIdx["home"]=1
 //>>excludeEnd("ctx");
 ][0];
-if($1 == null || $1.a$nil){
-$1;
-} else {
+if($1 != null && !$1.a$nil){
 $self._logContext_($recv(aContext)._home());
 }
 }
@@ -450,9 +442,7 @@ $1=[$recv(aClass)._superclass()
 ,$ctx1.sendIdx["superclass"]=1
 //>>excludeEnd("ctx");
 ][0];
-if($1 == null || $1.a$nil){
-$1;
-} else {
+if($1 != null && !$1.a$nil){
 $recv(protocols)._addAll_($self._availableProtocolsFor_($recv(aClass)._superclass()));
 }
 return $recv($recv($recv(protocols)._asSet())._asArray())._sort();
@@ -666,9 +656,7 @@ return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
 var $1;
 $1=$recv($recv($globals.Smalltalk)._globals())._at_(aClassName);
-if($1 == null || $1.a$nil){
-$1;
-} else {
+if($1 != null && !$1.a$nil){
 $self._error_([$recv("A class named ".__comma(aClassName)).__comma(" already exists")
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 ,$ctx1.sendIdx[","]=1
@@ -798,8 +786,6 @@ package_=$recv($globals.Package)._named_(aPackageName);
 $1=package_;
 if($1 == null || $1.a$nil){
 $self._error_("Invalid package name");
-} else {
-$1;
 }
 if($core.assert($recv(package_).__eq_eq($recv(aClass)._package()))){
 return self;
@@ -1121,9 +1107,7 @@ return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
 var $1;
 $1=$recv($recv($globals.Smalltalk)._globals())._at_(aClassName);
-if($1 == null || $1.a$nil){
-$1;
-} else {
+if($1 != null && !$1.a$nil){
 $self._error_([$recv("A class named ".__comma(aClassName)).__comma(" already exists")
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 ,$ctx1.sendIdx[","]=1
@@ -1385,8 +1369,6 @@ var $1;
 $1=$self._current();
 if($1 == null || $1.a$nil){
 $self._register_(anObject);
-} else {
-$1;
 }
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -1423,8 +1405,6 @@ smalltalkError=$recv($globals.Smalltalk)._asSmalltalkException_(anError);
 $1=$recv(smalltalkError)._context();
 if($1 == null || $1.a$nil){
 $recv(smalltalkError)._context_($core.getThisContext());
-} else {
-$1;
 }
 $self._handleUnhandledError_(smalltalkError);
 return self;

+ 2 - 6
lang/src/SUnit.js

@@ -497,9 +497,7 @@ return $core.withContext(function($ctx1) {
 var $1;
 $self._errorIfNotAsync_("#finished");
 $1=$self.asyncTimeout;
-if($1 == null || $1.a$nil){
-$1;
-} else {
+if($1 != null && !$1.a$nil){
 $recv($self.asyncTimeout)._clearTimeout();
 }
 $self.asyncTimeout=nil;
@@ -792,9 +790,7 @@ return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
 var $1;
 $1=$self.asyncTimeout;
-if($1 == null || $1.a$nil){
-$1;
-} else {
+if($1 != null && !$1.a$nil){
 $recv($self.asyncTimeout)._clearTimeout();
 }
 $self.asyncTimeout=(0);