Skip to content

Commit

Permalink
using Coffeescript 2 for fine-granularity compilation of classes. Nee…
Browse files Browse the repository at this point in the history
…ded to replace all "null"s with "nil"s (which are really "undefined"s)
  • Loading branch information
davidedc committed Dec 5, 2017
1 parent 0e31cc1 commit 3d43e90
Show file tree
Hide file tree
Showing 116 changed files with 1,039 additions and 1,018 deletions.
2 changes: 1 addition & 1 deletion src/AnalogClockMorph.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class AnalogClockMorph extends Morph
[area,sl,st,al,at,w,h] = @calculateKeyValues aContext, clippingRectangle
if area.isNotEmpty()
if w < 1 or h < 1
return null
return nil

aContext.save()

Expand Down
2 changes: 1 addition & 1 deletion src/Appearance.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class Appearance

@augmentWith DeepCopierMixin

morph: null
morph: nil

constructor: (@morph) ->

Expand Down
6 changes: 3 additions & 3 deletions src/Arg.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# REQUIRES ProfilerData

class Arg
valWrappedByThisArg: null
valWrappedByThisArg: nil
maybeChangedSinceLastCalculation: true

# an argument can either be
Expand All @@ -39,8 +39,8 @@ class Arg
# depend on a parent value at some stage.
directlyOrIndirectlyCalculatedFromParent: false

morphContainingThisArg: null
args: null
morphContainingThisArg: nil
args: nil
markedForRemoval: false
# we keep the vals of the args we
# used to calculate the last val. This is so
Expand Down
18 changes: 9 additions & 9 deletions src/Args.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,26 @@ class Args
# not the case for children Args as
# obviously you may have many children and hence
# many arguments)
argById: null
parentArgByName: null
childrenArgByName: null
argById: nil
parentArgByName: nil
childrenArgByName: nil
# we want to group together all children
# values under the same name
# so we keep this count separate
# rather than counting navigating the keys
childrenArgByNameCount: null
localArgByName: null
calculatedDirectlyOfIndirectlyFromParentById: null
childrenArgByNameCount: nil
localArgByName: nil
calculatedDirectlyOfIndirectlyFromParentById: nil
calculatedDirectlyOfIndirectlyFromParentByIdCount: 0

countOfDamaged: 0
morphContainingTheseArgs: null
morphContainingTheseArgs: nil

# just some flags to keep track of which
# args might have changed. Again, we might
# not know for sure because we don't necessarily
# recalculate them
argsMaybeChangedSinceLastCalculationById: null
argsMaybeChangedSinceLastCalculationById: nil

constructor: (@valContainingTheseArgs) ->
@argById = {}
Expand Down Expand Up @@ -129,7 +129,7 @@ class Args
existingArg.markedForRemoval = false
existingArg.valContainingThisArg.argMightHaveChanged parentOrChildVal
return existingArg
return null
return nil


# connects a val depending on a children val to a child val.
Expand Down
12 changes: 6 additions & 6 deletions src/AutomatorCommandKeyDown.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@


class AutomatorCommandKeyDown extends AutomatorCommand
scanCode: null
shiftKey: null
ctrlKey: null
altKey: null
metaKey: null
scanCode: nil
shiftKey: nil
ctrlKey: nil
altKey: nil
metaKey: nil

@replayFunction: (automatorRecorderAndPlayer, commandBeingPlayed) ->
console.log "replaying key"
automatorRecorderAndPlayer.worldMorph.processKeydown null, commandBeingPlayed.scanCode, commandBeingPlayed.shiftKey, commandBeingPlayed.ctrlKey, commandBeingPlayed.altKey, commandBeingPlayed.metaKey
automatorRecorderAndPlayer.worldMorph.processKeydown nil, commandBeingPlayed.scanCode, commandBeingPlayed.shiftKey, commandBeingPlayed.ctrlKey, commandBeingPlayed.altKey, commandBeingPlayed.metaKey


constructor: (@scanCode, @shiftKey, @ctrlKey, @altKey, @metaKey, automatorRecorderAndPlayer) ->
Expand Down
14 changes: 7 additions & 7 deletions src/AutomatorCommandKeyPress.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@


class AutomatorCommandKeyPress extends AutomatorCommand
charCode: null
symbol: null
shiftKey: null
ctrlKey: null
altKey: null
metaKey: null
charCode: nil
symbol: nil
shiftKey: nil
ctrlKey: nil
altKey: nil
metaKey: nil

@replayFunction: (automatorRecorderAndPlayer, commandBeingPlayed) ->
console.log "replaying key"
automatorRecorderAndPlayer.worldMorph.processKeypress null, commandBeingPlayed.charCode, commandBeingPlayed.symbol, commandBeingPlayed.shiftKey, commandBeingPlayed.ctrlKey, commandBeingPlayed.altKey, commandBeingPlayed.metaKey
automatorRecorderAndPlayer.worldMorph.processKeypress nil, commandBeingPlayed.charCode, commandBeingPlayed.symbol, commandBeingPlayed.shiftKey, commandBeingPlayed.ctrlKey, commandBeingPlayed.altKey, commandBeingPlayed.metaKey


constructor: (@charCode, @symbol, @shiftKey, @ctrlKey, @altKey, @metaKey, automatorRecorderAndPlayer) ->
Expand Down
12 changes: 6 additions & 6 deletions src/AutomatorCommandKeyUp.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@


class AutomatorCommandKeyUp extends AutomatorCommand
scanCode: null
shiftKey: null
ctrlKey: null
altKey: null
metaKey: null
scanCode: nil
shiftKey: nil
ctrlKey: nil
altKey: nil
metaKey: nil

@replayFunction: (automatorRecorderAndPlayer, commandBeingPlayed) ->
console.log "replaying key"
automatorRecorderAndPlayer.worldMorph.processKeyup null, commandBeingPlayed.scanCode, commandBeingPlayed.shiftKey, commandBeingPlayed.ctrlKey, commandBeingPlayed.altKey, commandBeingPlayed.metaKey
automatorRecorderAndPlayer.worldMorph.processKeyup nil, commandBeingPlayed.scanCode, commandBeingPlayed.shiftKey, commandBeingPlayed.ctrlKey, commandBeingPlayed.altKey, commandBeingPlayed.metaKey


constructor: (@scanCode, @shiftKey, @ctrlKey, @altKey, @metaKey, automatorRecorderAndPlayer) ->
Expand Down
30 changes: 15 additions & 15 deletions src/AutomatorCommandMouseButtonChange.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@


class AutomatorCommandMouseButtonChange extends AutomatorCommand
upOrDown: null
button: null
ctrlKey: null
upOrDown: nil
button: nil
ctrlKey: nil

buttons: null
shiftKey: null
altKey: null
metaKey: null
buttons: nil
shiftKey: nil
altKey: nil
metaKey: nil

morphIdentifierViaTextLabel: null
pointerPositionFractionalInMorph: null
pointerPositionPixelsInMorph: null
pointerPositionPixelsInWorld: null
absoluteBoundsOfMorphRelativeToWorld: null
morphUniqueIDString: null
morphPathRelativeToWorld: null
isPartOfListMorph: null
morphIdentifierViaTextLabel: nil
pointerPositionFractionalInMorph: nil
pointerPositionPixelsInMorph: nil
pointerPositionPixelsInWorld: nil
absoluteBoundsOfMorphRelativeToWorld: nil
morphUniqueIDString: nil
morphPathRelativeToWorld: nil
isPartOfListMorph: nil

@replayFunction: (automatorRecorderAndPlayer, commandBeingPlayed) ->
theMorph = world.getMorphViaTextLabel(commandBeingPlayed.morphIdentifierViaTextLabel)
Expand Down
20 changes: 10 additions & 10 deletions src/AutomatorCommandMouseClick.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@


class AutomatorCommandMouseClick extends AutomatorCommand
button: null
ctrlKey: null
morphIdentifierViaTextLabel: null
pointerPositionFractionalInMorph: null
pointerPositionPixelsInMorph: null
pointerPositionPixelsInWorld: null
absoluteBoundsOfMorphRelativeToWorld: null
morphUniqueIDString: null
morphPathRelativeToWorld: null
isPartOfListMorph: null
button: nil
ctrlKey: nil
morphIdentifierViaTextLabel: nil
pointerPositionFractionalInMorph: nil
pointerPositionPixelsInMorph: nil
pointerPositionPixelsInWorld: nil
absoluteBoundsOfMorphRelativeToWorld: nil
morphUniqueIDString: nil
morphPathRelativeToWorld: nil
isPartOfListMorph: nil

@replayFunction: (automatorRecorderAndPlayer, commandBeingPlayed) ->

Expand Down
18 changes: 9 additions & 9 deletions src/AutomatorCommandMouseDoubleClick.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@


class AutomatorCommandMouseDoubleClick extends AutomatorCommand
ctrlKey: null
morphIdentifierViaTextLabel: null
pointerPositionFractionalInMorph: null
pointerPositionPixelsInMorph: null
pointerPositionPixelsInWorld: null
absoluteBoundsOfMorphRelativeToWorld: null
morphUniqueIDString: null
morphPathRelativeToWorld: null
isPartOfListMorph: null
ctrlKey: nil
morphIdentifierViaTextLabel: nil
pointerPositionFractionalInMorph: nil
pointerPositionPixelsInMorph: nil
pointerPositionPixelsInWorld: nil
absoluteBoundsOfMorphRelativeToWorld: nil
morphUniqueIDString: nil
morphPathRelativeToWorld: nil
isPartOfListMorph: nil


# you'd ask why can't we *always* trigger the double click action
Expand Down
18 changes: 9 additions & 9 deletions src/AutomatorCommandMouseMove.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@


class AutomatorCommandMouseMove extends AutomatorCommand
mouseX: null
mouseY: null
floatDraggingSomething: null
button: null
buttons: null
ctrlKey: null
shiftKey: null
altKey: null
metaKey: null
mouseX: nil
mouseY: nil
floatDraggingSomething: nil
button: nil
buttons: nil
ctrlKey: nil
shiftKey: nil
altKey: nil
metaKey: nil

@replayFunction: (automatorRecorderAndPlayer, commandBeingPlayed) ->
automatorRecorderAndPlayer.handMorph.processMouseMove \
Expand Down
18 changes: 9 additions & 9 deletions src/AutomatorCommandMouseTripleClick.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@


class AutomatorCommandMouseTripleClick extends AutomatorCommand
ctrlKey: null
morphIdentifierViaTextLabel: null
pointerPositionFractionalInMorph: null
pointerPositionPixelsInMorph: null
pointerPositionPixelsInWorld: null
absoluteBoundsOfMorphRelativeToWorld: null
morphUniqueIDString: null
morphPathRelativeToWorld: null
isPartOfListMorph: null
ctrlKey: nil
morphIdentifierViaTextLabel: nil
pointerPositionFractionalInMorph: nil
pointerPositionPixelsInMorph: nil
pointerPositionPixelsInWorld: nil
absoluteBoundsOfMorphRelativeToWorld: nil
morphUniqueIDString: nil
morphPathRelativeToWorld: nil
isPartOfListMorph: nil


# you'd ask why can't we *always* trigger the triple click action
Expand Down
2 changes: 1 addition & 1 deletion src/AutomatorCommandOpenContextMenu.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


class AutomatorCommandOpenContextMenu extends AutomatorCommand
morphToOpenContextMenuAgainst_UniqueIDString: null
morphToOpenContextMenuAgainst_UniqueIDString: nil

@replayFunction: (automatorRecorderAndPlayer, commandBeingPlayed) ->
#automatorRecorderAndPlayer.handMorph.openContextMenuAtPointer (Morph.morphFromUniqueIDString commandBeingPlayed.morphToOpenContextMenuAgainst_UniqueIDString)
Expand Down
2 changes: 1 addition & 1 deletion src/AutomatorCommandPaste.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


class AutomatorCommandPaste extends AutomatorCommand
clipboardText: null
clipboardText: nil

@replayFunction: (automatorRecorderAndPlayer, commandBeingPlayed) ->
console.log "test player inserting text: " + commandBeingPlayed.clipboardText
Expand Down
2 changes: 1 addition & 1 deletion src/AutomatorCommandScreenshot.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


class AutomatorCommandScreenshot extends AutomatorCommand
screenShotImageName: null
screenShotImageName: nil
# The screenshot can be of the entire
# world or of a particular morph (through
# the "take pic" menu entry.
Expand Down
Loading

0 comments on commit 3d43e90

Please sign in to comment.