Skip to content

Commit

Permalink
Add backwards compatibility Pharo9 to Pharo8.
Browse files Browse the repository at this point in the history
 - OSWindowHandle should have been deprecated
 - Key should have been deprecated
 - send:toSuperOf: should be able to generate code for traits just as before sista compilation was the main one
  • Loading branch information
guillep committed Oct 14, 2020
1 parent 5ef105a commit c2d2f2f
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 12 deletions.
17 changes: 17 additions & 0 deletions src/OSWindow-Core/OSWindowHandle.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
"
OSWindowHandle was deprecated in Pharo 9 in favor of OSBackendWindow.
Replace your usages.
For more information, please check the comment in OSBackendWindow.
"
Class {
#name : #OSWindowHandle,
#superclass : #OSBackendWindow,
#category : #'OSWindow-Core-Utilities'
}

{ #category : #testing }
OSWindowHandle class >> isDeprecated [

^ true
]
16 changes: 4 additions & 12 deletions src/OpalCompiler-Core/IRBytecodeGenerator.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -702,25 +702,17 @@ IRBytecodeGenerator >> send: selector [

{ #category : #instructions }
IRBytecodeGenerator >> send: selector toSuperOf: behavior [
| index nArgs |
nArgs := selector numArgs.
stack pop: nArgs.
index := self literalIndexOf: selector.

(encoder class = EncoderForSistaV1 and: [ inBlock ])
ifTrue: [
| index nArgs |
behavior isTrait ifTrue: [
"Trait methods are copied to the users and only the last literal is updated.
For directed super send the literal of the super send should be updated too."
self error: 'not supported' ].
nArgs := selector numArgs.
stack pop: nArgs.
encoder genPushLiteralVar: (self literalIndexOf: behavior binding).
index := self literalIndexOf: selector.
encoder genSendDirectedSuper: index numArgs: nArgs ]
ifFalse: [
| index nArgs |
nArgs := selector numArgs.
stack pop: nArgs.
self addLastLiteral: behavior binding.
index := self literalIndexOf: selector.
encoder genSendSuper: index numArgs: nArgs ]

]
Expand Down
16 changes: 16 additions & 0 deletions src/System-Platforms/Key.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
"
Key was deprecated in Pharo 9 in favor of KeyboardKey.
Replace your usages.
For more information, please check the comment in KeyboardKey.
"
Class {
#name : #Key,
#superclass : #KeyboardKey,
#category : #'System-Platforms-Utilities'
}

{ #category : #testing }
Key class >> isDeprecated [
^true
]

0 comments on commit c2d2f2f

Please sign in to comment.