|
@@ -14,17 +14,12 @@ selector: "doesNotUnderstand:",
|
|
protocol: 'writing',
|
|
protocol: 'writing',
|
|
fn: function (aMessage){
|
|
fn: function (aMessage){
|
|
var self=this;
|
|
var self=this;
|
|
-var selector,newElement,useArg;
|
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
return $core.withContext(function($ctx1) {
|
|
return $core.withContext(function($ctx1) {
|
|
//>>excludeEnd("ctx");
|
|
//>>excludeEnd("ctx");
|
|
-var $1,$2,$3,$4,$5,$6,$7;
|
|
|
|
-selector=$recv(aMessage)._selector();
|
|
|
|
-$1=$recv($recv(selector)._asUppercase()).__eq(selector);
|
|
|
|
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
|
-$ctx1.sendIdx["="]=1;
|
|
|
|
-//>>excludeEnd("ctx");
|
|
|
|
-if(!$core.assert($1)){
|
|
|
|
|
|
+var $1,$2,$receiver;
|
|
|
|
+$1=$recv(self._class())._tryMakeDnuElement_(aMessage);
|
|
|
|
+if(($receiver = $1) == null || $receiver.isNil){
|
|
$2=(
|
|
$2=(
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
$ctx1.supercall = true,
|
|
$ctx1.supercall = true,
|
|
@@ -33,54 +28,24 @@ $globals.Silk.superclass.fn.prototype._doesNotUnderstand_.apply($recv(self), [aM
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
$ctx1.supercall = false;
|
|
$ctx1.supercall = false;
|
|
//>>excludeEnd("ctx");;
|
|
//>>excludeEnd("ctx");;
|
|
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
|
-$ctx1.sendIdx["doesNotUnderstand:"]=1;
|
|
|
|
-//>>excludeEnd("ctx");
|
|
|
|
return $2;
|
|
return $2;
|
|
-};
|
|
|
|
-$3=$recv($recv(selector)._last()).__eq(":");
|
|
|
|
-if($core.assert($3)){
|
|
|
|
-useArg=true;
|
|
|
|
-useArg;
|
|
|
|
-selector=$recv(selector)._allButLast();
|
|
|
|
-selector;
|
|
|
|
} else {
|
|
} else {
|
|
-useArg=false;
|
|
|
|
-useArg;
|
|
|
|
-};
|
|
|
|
-$4=$recv(selector)._includes_(":");
|
|
|
|
-if($core.assert($4)){
|
|
|
|
-$5=(
|
|
|
|
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
|
-$ctx1.supercall = true,
|
|
|
|
-//>>excludeEnd("ctx");
|
|
|
|
-$globals.Silk.superclass.fn.prototype._doesNotUnderstand_.apply($recv(self), [aMessage]));
|
|
|
|
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
|
-$ctx1.supercall = false;
|
|
|
|
-//>>excludeEnd("ctx");;
|
|
|
|
-return $5;
|
|
|
|
-};
|
|
|
|
-newElement=$recv(self._class())._newElement_($recv(selector)._asLowercase());
|
|
|
|
|
|
+var newElement;
|
|
|
|
+newElement=$receiver;
|
|
self.__lt_lt(newElement);
|
|
self.__lt_lt(newElement);
|
|
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
|
-$ctx1.sendIdx["<<"]=1;
|
|
|
|
-//>>excludeEnd("ctx");
|
|
|
|
-$6=useArg;
|
|
|
|
-if($core.assert($6)){
|
|
|
|
-$recv(newElement).__lt_lt($recv($recv(aMessage)._arguments())._first());
|
|
|
|
|
|
+return newElement;
|
|
};
|
|
};
|
|
-$7=newElement;
|
|
|
|
-return $7;
|
|
|
|
|
|
+return self;
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
-}, function($ctx1) {$ctx1.fill(self,"doesNotUnderstand:",{aMessage:aMessage,selector:selector,newElement:newElement,useArg:useArg},$globals.Silk)});
|
|
|
|
|
|
+}, function($ctx1) {$ctx1.fill(self,"doesNotUnderstand:",{aMessage:aMessage},$globals.Silk)});
|
|
//>>excludeEnd("ctx");
|
|
//>>excludeEnd("ctx");
|
|
},
|
|
},
|
|
//>>excludeStart("ide", pragmas.excludeIdeData);
|
|
//>>excludeStart("ide", pragmas.excludeIdeData);
|
|
args: ["aMessage"],
|
|
args: ["aMessage"],
|
|
-source: "doesNotUnderstand: aMessage\x0a\x09\x22`aSilk DIV` creates a div element and inserts it.\x0a\x09`aSilk DIV: anObject` creates a div element, inserts it\x0a\x09and puts contents in it\x22\x0a\x09| selector newElement useArg |\x0a\x09selector := aMessage selector.\x0a\x09selector asUppercase = selector\x0a\x09\x09ifFalse: [ ^ super doesNotUnderstand: aMessage ].\x0a\x09selector last = ':'\x0a\x09\x09ifTrue: [ useArg := true. selector := selector allButLast ]\x0a\x09\x09ifFalse: [ useArg := false ].\x0a\x09(selector includes: ':')\x0a\x09\x09ifTrue: [ ^ super doesNotUnderstand: aMessage ].\x0a\x09newElement := self class newElement: selector asLowercase.\x0a\x09self << newElement.\x0a\x09useArg ifTrue: [ newElement << aMessage arguments first ].\x0a\x09^ newElement",
|
|
|
|
|
|
+source: "doesNotUnderstand: aMessage\x0a\x09\x22`aSilk DIV` creates a div element and inserts it.\x0a\x09`aSilk DIV: anObject` creates a div element, inserts it\x0a\x09and puts contents in it\x22\x0a\x09(self class tryMakeDnuElement: aMessage)\x0a\x09\x09ifNil: [ ^ super doesNotUnderstand: aMessage ]\x0a\x09\x09ifNotNil: [ :newElement | self << newElement. ^ newElement ]",
|
|
referencedClasses: [],
|
|
referencedClasses: [],
|
|
//>>excludeEnd("ide");
|
|
//>>excludeEnd("ide");
|
|
-messageSends: ["selector", "ifFalse:", "=", "asUppercase", "doesNotUnderstand:", "ifTrue:ifFalse:", "last", "allButLast", "ifTrue:", "includes:", "newElement:", "class", "asLowercase", "<<", "first", "arguments"]
|
|
|
|
|
|
+messageSends: ["ifNil:ifNotNil:", "tryMakeDnuElement:", "class", "doesNotUnderstand:", "<<"]
|
|
}),
|
|
}),
|
|
$globals.Silk);
|
|
$globals.Silk);
|
|
|
|
|
|
@@ -128,17 +93,12 @@ selector: "doesNotUnderstand:",
|
|
protocol: 'message handling',
|
|
protocol: 'message handling',
|
|
fn: function (aMessage){
|
|
fn: function (aMessage){
|
|
var self=this;
|
|
var self=this;
|
|
-var selector,newElement,useArg;
|
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
return $core.withContext(function($ctx1) {
|
|
return $core.withContext(function($ctx1) {
|
|
//>>excludeEnd("ctx");
|
|
//>>excludeEnd("ctx");
|
|
-var $1,$2,$3,$4,$5,$6,$7;
|
|
|
|
-selector=$recv(aMessage)._selector();
|
|
|
|
-$1=$recv($recv(selector)._asUppercase()).__eq(selector);
|
|
|
|
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
|
-$ctx1.sendIdx["="]=1;
|
|
|
|
-//>>excludeEnd("ctx");
|
|
|
|
-if(!$core.assert($1)){
|
|
|
|
|
|
+var $1,$2,$receiver;
|
|
|
|
+$1=self._tryMakeDnuElement_(aMessage);
|
|
|
|
+if(($receiver = $1) == null || $receiver.isNil){
|
|
$2=(
|
|
$2=(
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
$ctx1.supercall = true,
|
|
$ctx1.supercall = true,
|
|
@@ -147,13 +107,47 @@ $globals.Silk.klass.superclass.fn.prototype._doesNotUnderstand_.apply($recv(self
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
$ctx1.supercall = false;
|
|
$ctx1.supercall = false;
|
|
//>>excludeEnd("ctx");;
|
|
//>>excludeEnd("ctx");;
|
|
|
|
+return $2;
|
|
|
|
+} else {
|
|
|
|
+var newElement;
|
|
|
|
+newElement=$receiver;
|
|
|
|
+return newElement;
|
|
|
|
+};
|
|
|
|
+return self;
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
-$ctx1.sendIdx["doesNotUnderstand:"]=1;
|
|
|
|
|
|
+}, function($ctx1) {$ctx1.fill(self,"doesNotUnderstand:",{aMessage:aMessage},$globals.Silk.klass)});
|
|
//>>excludeEnd("ctx");
|
|
//>>excludeEnd("ctx");
|
|
-return $2;
|
|
|
|
|
|
+},
|
|
|
|
+//>>excludeStart("ide", pragmas.excludeIdeData);
|
|
|
|
+args: ["aMessage"],
|
|
|
|
+source: "doesNotUnderstand: aMessage\x0a\x09\x22`Silk DIV` creates a div element.\x0a\x09`Silk DIV: anObject` creates a div element and puts contents in it\x22\x0a\x09(self tryMakeDnuElement: aMessage)\x0a\x09\x09ifNil: [ ^ super doesNotUnderstand: aMessage ]\x0a\x09\x09ifNotNil: [ :newElement | ^ newElement ]",
|
|
|
|
+referencedClasses: [],
|
|
|
|
+//>>excludeEnd("ide");
|
|
|
|
+messageSends: ["ifNil:ifNotNil:", "tryMakeDnuElement:", "doesNotUnderstand:"]
|
|
|
|
+}),
|
|
|
|
+$globals.Silk.klass);
|
|
|
|
+
|
|
|
|
+$core.addMethod(
|
|
|
|
+$core.method({
|
|
|
|
+selector: "tryMakeDnuElement:",
|
|
|
|
+protocol: 'instance creation',
|
|
|
|
+fn: function (aMessage){
|
|
|
|
+var self=this;
|
|
|
|
+var selector,newElement,useArg;
|
|
|
|
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
|
+return $core.withContext(function($ctx1) {
|
|
|
|
+//>>excludeEnd("ctx");
|
|
|
|
+var $1,$2,$3,$4,$5;
|
|
|
|
+selector=$recv(aMessage)._selector();
|
|
|
|
+$1=$recv($recv(selector)._asUppercase()).__eq(selector);
|
|
|
|
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
|
+$ctx1.sendIdx["="]=1;
|
|
|
|
+//>>excludeEnd("ctx");
|
|
|
|
+if(!$core.assert($1)){
|
|
|
|
+return nil;
|
|
};
|
|
};
|
|
-$3=$recv($recv(selector)._last()).__eq(":");
|
|
|
|
-if($core.assert($3)){
|
|
|
|
|
|
+$2=$recv($recv(selector)._last()).__eq(":");
|
|
|
|
+if($core.assert($2)){
|
|
useArg=true;
|
|
useArg=true;
|
|
useArg;
|
|
useArg;
|
|
selector=$recv(selector)._allButLast();
|
|
selector=$recv(selector)._allButLast();
|
|
@@ -162,35 +156,27 @@ selector;
|
|
useArg=false;
|
|
useArg=false;
|
|
useArg;
|
|
useArg;
|
|
};
|
|
};
|
|
-$4=$recv(selector)._includes_(":");
|
|
|
|
-if($core.assert($4)){
|
|
|
|
-$5=(
|
|
|
|
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
|
-$ctx1.supercall = true,
|
|
|
|
-//>>excludeEnd("ctx");
|
|
|
|
-$globals.Silk.klass.superclass.fn.prototype._doesNotUnderstand_.apply($recv(self), [aMessage]));
|
|
|
|
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
|
-$ctx1.supercall = false;
|
|
|
|
-//>>excludeEnd("ctx");;
|
|
|
|
-return $5;
|
|
|
|
|
|
+$3=$recv(selector)._includes_(":");
|
|
|
|
+if($core.assert($3)){
|
|
|
|
+return nil;
|
|
};
|
|
};
|
|
newElement=self._newElement_($recv(selector)._asLowercase());
|
|
newElement=self._newElement_($recv(selector)._asLowercase());
|
|
-$6=useArg;
|
|
|
|
-if($core.assert($6)){
|
|
|
|
|
|
+$4=useArg;
|
|
|
|
+if($core.assert($4)){
|
|
$recv(newElement).__lt_lt($recv($recv(aMessage)._arguments())._first());
|
|
$recv(newElement).__lt_lt($recv($recv(aMessage)._arguments())._first());
|
|
};
|
|
};
|
|
-$7=newElement;
|
|
|
|
-return $7;
|
|
|
|
|
|
+$5=newElement;
|
|
|
|
+return $5;
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
-}, function($ctx1) {$ctx1.fill(self,"doesNotUnderstand:",{aMessage:aMessage,selector:selector,newElement:newElement,useArg:useArg},$globals.Silk.klass)});
|
|
|
|
|
|
+}, function($ctx1) {$ctx1.fill(self,"tryMakeDnuElement:",{aMessage:aMessage,selector:selector,newElement:newElement,useArg:useArg},$globals.Silk.klass)});
|
|
//>>excludeEnd("ctx");
|
|
//>>excludeEnd("ctx");
|
|
},
|
|
},
|
|
//>>excludeStart("ide", pragmas.excludeIdeData);
|
|
//>>excludeStart("ide", pragmas.excludeIdeData);
|
|
args: ["aMessage"],
|
|
args: ["aMessage"],
|
|
-source: "doesNotUnderstand: aMessage\x0a\x09\x22`Silk DIV` creates a div element.\x0a\x09`Silk DIV: anObject` creates a div element and puts contents in it\x22\x0a\x09| selector newElement useArg |\x0a\x09selector := aMessage selector.\x0a\x09selector asUppercase = selector\x0a\x09\x09ifFalse: [ ^ super doesNotUnderstand: aMessage ].\x0a\x09selector last = ':'\x0a\x09\x09ifTrue: [ useArg := true. selector := selector allButLast ]\x0a\x09\x09ifFalse: [ useArg := false ].\x0a\x09(selector includes: ':')\x0a\x09\x09ifTrue: [ ^ super doesNotUnderstand: aMessage ].\x0a\x09newElement := self newElement: selector asLowercase.\x0a\x09useArg ifTrue: [ newElement << aMessage arguments first ].\x0a\x09^ newElement",
|
|
|
|
|
|
+source: "tryMakeDnuElement: aMessage\x0a\x09\x22`DIV` creates a div element.\x0a\x09`DIV: anObject` creates a div element and puts contents in it\x22\x0a\x09| selector newElement useArg |\x0a\x09selector := aMessage selector.\x0a\x09selector asUppercase = selector\x0a\x09\x09ifFalse: [ ^ nil ].\x0a\x09selector last = ':'\x0a\x09\x09ifTrue: [ useArg := true. selector := selector allButLast ]\x0a\x09\x09ifFalse: [ useArg := false ].\x0a\x09(selector includes: ':')\x0a\x09\x09ifTrue: [ ^ nil ].\x0a\x09newElement := self newElement: selector asLowercase.\x0a\x09useArg ifTrue: [ newElement << aMessage arguments first ].\x0a\x09^ newElement",
|
|
referencedClasses: [],
|
|
referencedClasses: [],
|
|
//>>excludeEnd("ide");
|
|
//>>excludeEnd("ide");
|
|
-messageSends: ["selector", "ifFalse:", "=", "asUppercase", "doesNotUnderstand:", "ifTrue:ifFalse:", "last", "allButLast", "ifTrue:", "includes:", "newElement:", "asLowercase", "<<", "first", "arguments"]
|
|
|
|
|
|
+messageSends: ["selector", "ifFalse:", "=", "asUppercase", "ifTrue:ifFalse:", "last", "allButLast", "ifTrue:", "includes:", "newElement:", "asLowercase", "<<", "first", "arguments"]
|
|
}),
|
|
}),
|
|
$globals.Silk.klass);
|
|
$globals.Silk.klass);
|
|
|
|
|