Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 29 additions & 29 deletions src/PharoCompatibility-Core/PharoCompatibility.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@ Class {
#tag : 'Core'
}

{ #category : 'accessing' }
PharoCompatibility class >> currentMajorVersion [

^ SystemVersion current major
]

{ #category : 'errors' }
PharoCompatibility class >> compilationAstFromException: anError [

Expand All @@ -28,6 +22,12 @@ PharoCompatibility class >> compilationAstFromException: anError [
do: [ :ignored | nil ]
]

{ #category : 'accessing' }
PharoCompatibility class >> currentMajorVersion [

^ SystemVersion current major
]

{ #category : 'private' }
PharoCompatibility class >> firstExistingGlobalFrom: globalNames [

Expand Down Expand Up @@ -72,29 +72,6 @@ PharoCompatibility class >> installMissingGlobalNamed: missingGlobalName from: r
^ replacement
]

{ #category : 'errors' }
PharoCompatibility class >> noticeFromException: anError ifKindOfAnyNamed: classNames [

| candidate |
candidate := anError.
(anError respondsTo: #notice) ifTrue: [
anError notice ifNotNil: [ :notice | candidate := notice ] ].
^ (self object: candidate isKindOfAnyClassNamed: classNames)
ifTrue: [ candidate ]
ifFalse: [ nil ]
]

{ #category : 'private' }
PharoCompatibility class >> object: anObject isKindOfAnyClassNamed: classNames [

classNames do: [ :className |
| class |
class := Smalltalk at: className ifAbsent: [ nil ].
(class notNil and: [ anObject isKindOf: class ]) ifTrue: [
^ true ] ].
^ false
]

{ #category : 'installing' }
PharoCompatibility class >> installPharo12Surface [

Expand Down Expand Up @@ -145,6 +122,29 @@ PharoCompatibility class >> loadedSurfaces [
^ surfaces asArray
]

{ #category : 'errors' }
PharoCompatibility class >> noticeFromException: anError ifKindOfAnyNamed: classNames [

| candidate |
candidate := anError.
(anError respondsTo: #notice) ifTrue: [
anError notice ifNotNil: [ :notice | candidate := notice ] ].
^ (self object: candidate isKindOfAnyClassNamed: classNames)
ifTrue: [ candidate ]
ifFalse: [ nil ]
]

{ #category : 'private' }
PharoCompatibility class >> object: anObject isKindOfAnyClassNamed: classNames [

classNames do: [ :className |
| class |
class := Smalltalk at: className ifAbsent: [ nil ].
(class notNil and: [ anObject isKindOf: class ]) ifTrue: [
^ true ] ].
^ false
]

{ #category : 'errors' }
PharoCompatibility class >> resumeDeprecationsDuring: aBlock [

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,15 @@ PharoCompatibilityP13SurfacePharo14Test >> testMoveClassRefactoringUsesTheClassB
self removePackageNamed: packageName ]
]

{ #category : 'tests' }
PharoCompatibilityP13SurfacePharo14Test >> testPharo13ContextTempNamesSelector [

| names temporaryValue |
temporaryValue := 42.
names := thisContext tempNames collect: [ :each | each asString ].
self assert: (names includes: 'temporaryValue')
]

{ #category : 'tests' }
PharoCompatibilityP13SurfacePharo14Test >> testUndeclaredVariableNodeFromCompilationError [

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Extension { #name : 'Context' }

{ #category : '*PharoCompatibility-Pharo13Surface-Pharo14' }
Context >> tempNames [

^ self temporaryVariableNames
]
Loading