Manuscript (Case [Issue]22309) _Inbox - findSelectorFromAST implementation sucks!

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Manuscript (Case [Issue]22309) _Inbox - findSelectorFromAST implementation sucks!

Pharo Issue Tracker
Manuscript Notification
avatar
Stephane Ducasse opened Case 22309: findSelectorFromAST implementation sucks! and assigned it to Everyone:
Bug in Project:  _Inbox: Not Spam  •  You are subscribed to this case
When the fallbackBlock is executed.... a Rub object is returned instead of something else. This use of block is bad!!! It is like an exception but a silent one. So a bug nest

findSelectorFromAST
"Try to make a selector out of the current text selection"

| node fallbackBlock |

fallbackBlock := [^self].
node := self bestNodeInTextAreaOnError: fallbackBlock.

node isMethod ifFalse: [
(node isValue and: [ node value isSymbol ]) ifTrue: [ ^node value ].

[ node isMessage ] whileFalse: [
(node := node parent) ifNil: fallbackBlock ]].

^node selector

Let us look at the senders

implementorsOfIt
"Open an implementors browser on the selected selector"

| aSelector |
"self lineSelectAndEmptyCheck: [^ self]."
(aSelector := self selectedSelector) ifNil: [^ textArea flash].
self implementorsOf: aSelector

Bingo!!! just check for nil!
Bad to me
Priority Priority: 5 – Fix If Time Status Status: Work Needed
Assigned To Assigned to: Everyone Milestone Milestone: Later

Go to Case
No longer need updates? Unsubscribe from this case.

Don't want Manuscript notifications anymore? Update your preferences.

Manuscript

_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
https://lists.gforge.inria.fr/mailman/listinfo/pharo-bugtracker