Skip to content

Commit

Permalink
Merge pull request #21 from OpenSmock/fix_BlGridLayoutConstraints
Browse files Browse the repository at this point in the history
Fix bugs
  • Loading branch information
labordep authored Jul 18, 2024
2 parents f7c2b3d + 2f3115f commit 09a182b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
11 changes: 11 additions & 0 deletions src/Bloc-Serialization-STON/BlGridLayoutSpec.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Extension { #name : #BlGridLayoutSpec }

{ #category : #'*Bloc-Serialization-STON' }
BlGridLayoutSpec class >> fromSton: stonReader [
"Create a new instance and delegate decoding to instance side.
Override only when new instance should be created directly (see implementors). "

^ (self start: UNDEFINED)
fromSton: stonReader;
yourself
]
6 changes: 3 additions & 3 deletions src/Bloc-Serialization/TBlSerializer.trait.st
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Trait {
#name : #TBlSerializer,
#category : #'Bloc-Serialization'
#category : #'Bloc-Serialization-Core'
}

{ #category : #serialization }
Expand All @@ -9,7 +9,7 @@ TBlSerializer classSide >> materialize: aString [
| blElement |
aString isString not ifTrue:[ BlocMaterializationError signal: 'Cannot materialize a no String object into BlElement' ].
"Try to materialize and catch an error into a BlocMaterialization error"
[ blElement := STON fromString: aString ] onErrorDo: [ :e | BlocMaterializationError signal: 'Cannot support Bloc materialization of this String (', e asString, ')' ].
[ blElement := self materializeImplementation: aString ] onErrorDo: [ :e | BlocMaterializationError signal: 'Cannot support Bloc materialization of this String (', e asString, ')' ].
blElement ifNil:[ BlocMaterializationError signal: 'Bloc materialization result is nil' ].

^ blElement
Expand All @@ -25,7 +25,7 @@ TBlSerializer classSide >> serialize: aBlElementOrABlElementsCollection [
ifFalse: [ self verifyElement: aBlElementOrABlElementsCollection ].

"Try to serialize and catch an error into a BlocSerialization error"
[ string := STON toStringPretty: aBlElementOrABlElementsCollection ] onErrorDo: [ :e | BlocSerializationError signal: 'Cannot support serialization of this BlElement (', e asString, ')' ].
[ string := self serializeImplementation: aBlElementOrABlElementsCollection ] onErrorDo: [ :e | BlocSerializationError signal: 'Cannot support serialization of this BlElement (', e asString, ')' ].

^ string
]
Expand Down

0 comments on commit 09a182b

Please sign in to comment.