Adding comments + extend default error - #21
Merged
Conversation
Use special string method for mustache when it turns an object into a…
added pharo 13 and alpha builds
Make sure that when a path element is not defined the error is passed the element name so that we can build advanced error handing (similar to DNU)
noha
requested changes
Feb 24, 2026
|
|
||
| { #category : '*mustache-core' } | ||
| Object >> mustacheDefaultWhenLookupFails [ | ||
| Object >> mustacheDefaultWhenLookupFails: failingPartString [ |
Owner
There was a problem hiding this comment.
I think you need change the sender of this method as well. Now we get a DNU
| ^ [ self perform: aString asSymbol ] | ||
| on: MessageNotUnderstood | ||
| do: [ :err | self mustacheLookupComplex: aString ] | ||
| ^ (self respondsTo: aString asSymbol) |
Owner
There was a problem hiding this comment.
I don't want to change that. Asking before performing is way slower and unnecessary. I think a piece of code should support the intended case first. Just execution method assumes that it goes well most of the time so no check needed, just a guard. Defensively asking before is rather the exception that it often does not respondTo: . A short check turns out this new version is more than 5 times slower
Owner
|
@Ducasse I integrate and fix it without the perform change |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Make sure that when a path element is not defined the error is passed the element name so that we can build advanced error handing (similar to DNU)