diff options
| author | Nathan Dinsmore <nathan@users.noreply.github.com> | 2015-06-17 17:11:40 -0400 |
|---|---|---|
| committer | Nathan Dinsmore <nathan@users.noreply.github.com> | 2015-06-17 17:11:40 -0400 |
| commit | 87c2503571bd7f5e753bc16a05bd198fc58d7d7c (patch) | |
| tree | 4545f569b3989ee1d2e5d1cc3e3f31108ea06742 | |
| parent | 3885ced35aee903f74d48c293bc3f0665a38dba5 (diff) | |
| download | snap-87c2503571bd7f5e753bc16a05bd198fc58d7d7c.tar.gz snap-87c2503571bd7f5e753bc16a05bd198fc58d7d7c.zip | |
Use Object.create(…) instead of new …() for inheritance (faster)
| -rw-r--r-- | blocks.js | 50 | ||||
| -rw-r--r-- | byob.js | 26 | ||||
| -rw-r--r-- | gui.js | 16 | ||||
| -rw-r--r-- | lists.js | 2 | ||||
| -rw-r--r-- | morphic.js | 58 | ||||
| -rw-r--r-- | objects.js | 22 | ||||
| -rw-r--r-- | paint.js | 6 | ||||
| -rw-r--r-- | store.js | 2 | ||||
| -rw-r--r-- | widgets.js | 16 | ||||
| -rw-r--r-- | xml.js | 2 |
10 files changed, 100 insertions, 100 deletions
@@ -240,7 +240,7 @@ WorldMorph.prototype.customMorphs = function () { // SyntaxElementMorph inherits from Morph: -SyntaxElementMorph.prototype = new Morph(); +SyntaxElementMorph.prototype = Object.create(Morph.prototype); SyntaxElementMorph.prototype.constructor = SyntaxElementMorph; SyntaxElementMorph.uber = Morph.prototype; @@ -1937,7 +1937,7 @@ SyntaxElementMorph.prototype.endLayout = function () { // BlockMorph inherits from SyntaxElementMorph: -BlockMorph.prototype = new SyntaxElementMorph(); +BlockMorph.prototype = Object.create(SyntaxElementMorph.prototype); BlockMorph.prototype.constructor = BlockMorph; BlockMorph.uber = SyntaxElementMorph.prototype; @@ -3262,7 +3262,7 @@ BlockMorph.prototype.snap = function () { // CommandBlockMorph inherits from BlockMorph: -CommandBlockMorph.prototype = new BlockMorph(); +CommandBlockMorph.prototype = Object.create(BlockMorph.prototype); CommandBlockMorph.prototype.constructor = CommandBlockMorph; CommandBlockMorph.uber = BlockMorph.prototype; @@ -3942,7 +3942,7 @@ CommandBlockMorph.prototype.drawBottomRightEdge = function (context) { // HatBlockMorph inherits from CommandBlockMorph: -HatBlockMorph.prototype = new CommandBlockMorph(); +HatBlockMorph.prototype = Object.create(CommandBlockMorph.prototype); HatBlockMorph.prototype.constructor = HatBlockMorph; HatBlockMorph.uber = CommandBlockMorph.prototype; @@ -4120,7 +4120,7 @@ HatBlockMorph.prototype.drawTopLeftEdge = function (context) { // ReporterBlockMorph inherits from BlockMorph: -ReporterBlockMorph.prototype = new BlockMorph(); +ReporterBlockMorph.prototype = Object.create(BlockMorph.prototype); ReporterBlockMorph.prototype.constructor = ReporterBlockMorph; ReporterBlockMorph.uber = BlockMorph.prototype; @@ -4644,7 +4644,7 @@ ReporterBlockMorph.prototype.drawDiamond = function (context) { // RingMorph inherits from ReporterBlockMorph: -RingMorph.prototype = new ReporterBlockMorph(); +RingMorph.prototype = Object.create(ReporterBlockMorph.prototype); RingMorph.prototype.constructor = RingMorph; RingMorph.uber = ReporterBlockMorph.prototype; @@ -4781,7 +4781,7 @@ RingMorph.prototype.fixBlockColor = function (nearest, isForced) { // ScriptsMorph inherits from FrameMorph: -ScriptsMorph.prototype = new FrameMorph(); +ScriptsMorph.prototype = Object.create(FrameMorph.prototype); ScriptsMorph.prototype.constructor = ScriptsMorph; ScriptsMorph.uber = FrameMorph.prototype; @@ -5321,7 +5321,7 @@ ScriptsMorph.prototype.reactToDropOf = function (droppedMorph, hand) { // ArgMorph inherits from SyntaxElementMorph: -ArgMorph.prototype = new SyntaxElementMorph(); +ArgMorph.prototype = Object.create(SyntaxElementMorph.prototype); ArgMorph.prototype.constructor = ArgMorph; ArgMorph.uber = SyntaxElementMorph.prototype; @@ -5434,7 +5434,7 @@ ArgMorph.prototype.isEmptySlot = function () { // CommandSlotMorph inherits from ArgMorph: -CommandSlotMorph.prototype = new ArgMorph(); +CommandSlotMorph.prototype = Object.create(ArgMorph.prototype); CommandSlotMorph.prototype.constructor = CommandSlotMorph; CommandSlotMorph.uber = ArgMorph.prototype; @@ -5884,7 +5884,7 @@ CommandSlotMorph.prototype.drawEdges = function (context) { // RingCommandSlotMorph inherits from CommandSlotMorph: -RingCommandSlotMorph.prototype = new CommandSlotMorph(); +RingCommandSlotMorph.prototype = Object.create(CommandSlotMorph.prototype); RingCommandSlotMorph.prototype.constructor = RingCommandSlotMorph; RingCommandSlotMorph.uber = CommandSlotMorph.prototype; @@ -6040,7 +6040,7 @@ RingCommandSlotMorph.prototype.drawFlat = function (context) { // CSlotMorph inherits from CommandSlotMorph: -CSlotMorph.prototype = new CommandSlotMorph(); +CSlotMorph.prototype = Object.create(CommandSlotMorph.prototype); CSlotMorph.prototype.constructor = CSlotMorph; CSlotMorph.uber = CommandSlotMorph.prototype; @@ -6463,7 +6463,7 @@ CSlotMorph.prototype.drawBottomEdge = function (context) { // InputSlotMorph inherits from ArgMorph: -InputSlotMorph.prototype = new ArgMorph(); +InputSlotMorph.prototype = Object.create(ArgMorph.prototype); InputSlotMorph.prototype.constructor = InputSlotMorph; InputSlotMorph.uber = ArgMorph.prototype; @@ -7399,7 +7399,7 @@ InputSlotMorph.prototype.drawRoundBorder = function (context) { // TemplateSlotMorph inherits from ArgMorph: -TemplateSlotMorph.prototype = new ArgMorph(); +TemplateSlotMorph.prototype = Object.create(ArgMorph.prototype); TemplateSlotMorph.prototype.constructor = TemplateSlotMorph; TemplateSlotMorph.uber = ArgMorph.prototype; @@ -7503,7 +7503,7 @@ TemplateSlotMorph.prototype.drawRounded = ReporterBlockMorph // BooleanSlotMorph inherits from ArgMorph: -BooleanSlotMorph.prototype = new ArgMorph(); +BooleanSlotMorph.prototype = Object.create(ArgMorph.prototype); BooleanSlotMorph.prototype.constructor = BooleanSlotMorph; BooleanSlotMorph.uber = ArgMorph.prototype; @@ -7660,7 +7660,7 @@ BooleanSlotMorph.prototype.isEmptySlot = function () { // ArrowMorph inherits from Morph: -ArrowMorph.prototype = new Morph(); +ArrowMorph.prototype = Object.create(Morph.prototype); ArrowMorph.prototype.constructor = ArrowMorph; ArrowMorph.uber = Morph.prototype; @@ -7730,7 +7730,7 @@ ArrowMorph.prototype.drawNew = function () { // TextSlotMorph inherits from InputSlotMorph: -TextSlotMorph.prototype = new InputSlotMorph(); +TextSlotMorph.prototype = Object.create(InputSlotMorph.prototype); TextSlotMorph.prototype.constructor = TextSlotMorph; TextSlotMorph.uber = InputSlotMorph.prototype; @@ -7813,7 +7813,7 @@ TextSlotMorph.prototype.layoutChanged = function () { // SymbolMorph inherits from Morph: -SymbolMorph.prototype = new Morph(); +SymbolMorph.prototype = Object.create(Morph.prototype); SymbolMorph.prototype.constructor = SymbolMorph; SymbolMorph.uber = Morph.prototype; @@ -9106,7 +9106,7 @@ SymbolMorph.prototype.drawSymbolRobot = function (canvas, color) { // ColorSlotMorph inherits from ArgMorph: -ColorSlotMorph.prototype = new ArgMorph(); +ColorSlotMorph.prototype = Object.create(ArgMorph.prototype); ColorSlotMorph.prototype.constructor = ColorSlotMorph; ColorSlotMorph.uber = ArgMorph.prototype; @@ -9214,7 +9214,7 @@ ColorSlotMorph.prototype.drawRectBorder = // BlockHighlightMorph inherits from Morph: -BlockHighlightMorph.prototype = new Morph(); +BlockHighlightMorph.prototype = Object.create(Morph.prototype); BlockHighlightMorph.prototype.constructor = BlockHighlightMorph; BlockHighlightMorph.uber = Morph.prototype; @@ -9239,7 +9239,7 @@ function BlockHighlightMorph() { // MultiArgMorph inherits from ArgMorph: -MultiArgMorph.prototype = new ArgMorph(); +MultiArgMorph.prototype = Object.create(ArgMorph.prototype); MultiArgMorph.prototype.constructor = MultiArgMorph; MultiArgMorph.uber = ArgMorph.prototype; @@ -9669,7 +9669,7 @@ MultiArgMorph.prototype.isEmptySlot = function () { // ArgLabelMorph inherits from ArgMorph: -ArgLabelMorph.prototype = new ArgMorph(); +ArgLabelMorph.prototype = Object.create(ArgMorph.prototype); ArgLabelMorph.prototype.constructor = ArgLabelMorph; ArgLabelMorph.uber = ArgMorph.prototype; @@ -9799,7 +9799,7 @@ ArgLabelMorph.prototype.isEmptySlot = function () { // FunctionSlotMorph inherits from ArgMorph: -FunctionSlotMorph.prototype = new ArgMorph(); +FunctionSlotMorph.prototype = Object.create(ArgMorph.prototype); FunctionSlotMorph.prototype.constructor = FunctionSlotMorph; FunctionSlotMorph.uber = ArgMorph.prototype; @@ -10180,7 +10180,7 @@ FunctionSlotMorph.prototype.drawDiamond = function (context) { // ReporterSlotMorph inherits from FunctionSlotMorph: -ReporterSlotMorph.prototype = new FunctionSlotMorph(); +ReporterSlotMorph.prototype = Object.create(FunctionSlotMorph.prototype); ReporterSlotMorph.prototype.constructor = ReporterSlotMorph; ReporterSlotMorph.uber = FunctionSlotMorph.prototype; @@ -10263,7 +10263,7 @@ ReporterSlotMorph.prototype.fixLayout = function () { // ReporterSlotMorph inherits from FunctionSlotMorph: -RingReporterSlotMorph.prototype = new ReporterSlotMorph(); +RingReporterSlotMorph.prototype = Object.create(ReporterSlotMorph.prototype); RingReporterSlotMorph.prototype.constructor = RingReporterSlotMorph; RingReporterSlotMorph.uber = ReporterSlotMorph.prototype; @@ -10651,7 +10651,7 @@ RingReporterSlotMorph.prototype.drawDiamond = function (context) { // CommentMorph inherits from BoxMorph: -CommentMorph.prototype = new BoxMorph(); +CommentMorph.prototype = Object.create(BoxMorph.prototype); CommentMorph.prototype.constructor = CommentMorph; CommentMorph.uber = BoxMorph.prototype; @@ -379,7 +379,7 @@ CustomBlockDefinition.prototype.scriptsPicture = function () { // CustomCommandBlockMorph inherits from CommandBlockMorph: -CustomCommandBlockMorph.prototype = new CommandBlockMorph(); +CustomCommandBlockMorph.prototype = Object.create(CommandBlockMorph.prototype); CustomCommandBlockMorph.prototype.constructor = CustomCommandBlockMorph; CustomCommandBlockMorph.uber = CommandBlockMorph.prototype; @@ -896,7 +896,7 @@ CustomCommandBlockMorph.prototype.alternatives = function () { // CustomReporterBlockMorph inherits from ReporterBlockMorph: -CustomReporterBlockMorph.prototype = new ReporterBlockMorph(); +CustomReporterBlockMorph.prototype = Object.create(ReporterBlockMorph.prototype); CustomReporterBlockMorph.prototype.constructor = CustomReporterBlockMorph; CustomReporterBlockMorph.uber = ReporterBlockMorph.prototype; @@ -1028,7 +1028,7 @@ CustomReporterBlockMorph.prototype.alternatives // JaggedBlockMorph inherits from ReporterBlockMorph: -JaggedBlockMorph.prototype = new ReporterBlockMorph(); +JaggedBlockMorph.prototype = Object.create(ReporterBlockMorph.prototype); JaggedBlockMorph.prototype.constructor = JaggedBlockMorph; JaggedBlockMorph.uber = ReporterBlockMorph.prototype; @@ -1177,7 +1177,7 @@ JaggedBlockMorph.prototype.drawEdges = function (context) { // BlockDialogMorph inherits from DialogBoxMorph: -BlockDialogMorph.prototype = new DialogBoxMorph(); +BlockDialogMorph.prototype = Object.create(DialogBoxMorph.prototype); BlockDialogMorph.prototype.constructor = BlockDialogMorph; BlockDialogMorph.uber = DialogBoxMorph.prototype; @@ -1624,7 +1624,7 @@ BlockDialogMorph.prototype.fixLayout = function () { // BlockEditorMorph inherits from DialogBoxMorph: -BlockEditorMorph.prototype = new DialogBoxMorph(); +BlockEditorMorph.prototype = Object.create(DialogBoxMorph.prototype); BlockEditorMorph.prototype.constructor = BlockEditorMorph; BlockEditorMorph.uber = DialogBoxMorph.prototype; @@ -1936,7 +1936,7 @@ BlockEditorMorph.prototype.fixLayout = function () { // PrototypeHatBlockMorph inherits from HatBlockMorph: -PrototypeHatBlockMorph.prototype = new HatBlockMorph(); +PrototypeHatBlockMorph.prototype = Object.create(HatBlockMorph.prototype); PrototypeHatBlockMorph.prototype.constructor = PrototypeHatBlockMorph; PrototypeHatBlockMorph.uber = HatBlockMorph.prototype; @@ -2146,7 +2146,7 @@ BlockLabelFragment.prototype.setSingleInputType = function (type) { // BlockLabelFragmentMorph inherits from StringMorph: -BlockLabelFragmentMorph.prototype = new StringMorph(); +BlockLabelFragmentMorph.prototype = Object.create(StringMorph.prototype); BlockLabelFragmentMorph.prototype.constructor = BlockLabelFragmentMorph; BlockLabelFragmentMorph.uber = StringMorph.prototype; @@ -2268,7 +2268,7 @@ BlockLabelFragmentMorph.prototype.userMenu = function () { // BlockLabelPlaceHolderMorph inherits from StringMorph: -BlockLabelPlaceHolderMorph.prototype = new StringMorph(); +BlockLabelPlaceHolderMorph.prototype = Object.create(StringMorph.prototype); BlockLabelPlaceHolderMorph.prototype.constructor = BlockLabelPlaceHolderMorph; BlockLabelPlaceHolderMorph.uber = StringMorph.prototype; @@ -2396,7 +2396,7 @@ BlockLabelPlaceHolderMorph.prototype.updateBlockLabel // BlockInputFragmentMorph inherits from TemplateSlotMorph: -BlockInputFragmentMorph.prototype = new TemplateSlotMorph(); +BlockInputFragmentMorph.prototype = Object.create(TemplateSlotMorph.prototype); BlockInputFragmentMorph.prototype.constructor = BlockInputFragmentMorph; BlockInputFragmentMorph.uber = TemplateSlotMorph.prototype; @@ -2426,7 +2426,7 @@ BlockInputFragmentMorph.prototype.updateBlockLabel // InputSlotDialogMorph inherits from DialogBoxMorph: -InputSlotDialogMorph.prototype = new DialogBoxMorph(); +InputSlotDialogMorph.prototype = Object.create(DialogBoxMorph.prototype); InputSlotDialogMorph.prototype.constructor = InputSlotDialogMorph; InputSlotDialogMorph.uber = DialogBoxMorph.prototype; @@ -3026,7 +3026,7 @@ InputSlotDialogMorph.prototype.show = function () { // VariableDialogMorph inherits from DialogBoxMorph: -VariableDialogMorph.prototype = new DialogBoxMorph(); +VariableDialogMorph.prototype = Object.create(DialogBoxMorph.prototype); VariableDialogMorph.prototype.constructor = VariableDialogMorph; VariableDialogMorph.uber = DialogBoxMorph.prototype; @@ -3145,7 +3145,7 @@ VariableDialogMorph.prototype.fixLayout = function () { // BlockExportDialogMorph inherits from DialogBoxMorph: -BlockExportDialogMorph.prototype = new DialogBoxMorph(); +BlockExportDialogMorph.prototype = Object.create(DialogBoxMorph.prototype); BlockExportDialogMorph.prototype.constructor = BlockExportDialogMorph; BlockExportDialogMorph.uber = DialogBoxMorph.prototype; @@ -3327,7 +3327,7 @@ BlockExportDialogMorph.prototype.fixLayout // BlockImportDialogMorph inherits from DialogBoxMorph // and pseudo-inherits from BlockExportDialogMorph: -BlockImportDialogMorph.prototype = new DialogBoxMorph(); +BlockImportDialogMorph.prototype = Object.create(DialogBoxMorph.prototype); BlockImportDialogMorph.prototype.constructor = BlockImportDialogMorph; BlockImportDialogMorph.uber = DialogBoxMorph.prototype; @@ -88,7 +88,7 @@ var JukeboxMorph; // IDE_Morph inherits from Morph: -IDE_Morph.prototype = new Morph(); +IDE_Morph.prototype = Object.create(Morph.prototype); IDE_Morph.prototype.constructor = IDE_Morph; IDE_Morph.uber = Morph.prototype; @@ -4274,7 +4274,7 @@ IDE_Morph.prototype.prompt = function (message, callback, choices, key) { // ProjectDialogMorph inherits from DialogBoxMorph: -ProjectDialogMorph.prototype = new DialogBoxMorph(); +ProjectDialogMorph.prototype = Object.create(DialogBoxMorph.prototype); ProjectDialogMorph.prototype.constructor = ProjectDialogMorph; ProjectDialogMorph.uber = DialogBoxMorph.prototype; @@ -5181,7 +5181,7 @@ ProjectDialogMorph.prototype.fixLayout = function () { // SpriteIconMorph inherits from ToggleButtonMorph (Widgets) -SpriteIconMorph.prototype = new ToggleButtonMorph(); +SpriteIconMorph.prototype = Object.create(ToggleButtonMorph.prototype); SpriteIconMorph.prototype.constructor = SpriteIconMorph; SpriteIconMorph.uber = ToggleButtonMorph.prototype; @@ -5571,7 +5571,7 @@ SpriteIconMorph.prototype.copySound = function (sound) { // CostumeIconMorph inherits from ToggleButtonMorph (Widgets) // ... and copies methods from SpriteIconMorph -CostumeIconMorph.prototype = new ToggleButtonMorph(); +CostumeIconMorph.prototype = Object.create(ToggleButtonMorph.prototype); CostumeIconMorph.prototype.constructor = CostumeIconMorph; CostumeIconMorph.uber = ToggleButtonMorph.prototype; @@ -5782,7 +5782,7 @@ CostumeIconMorph.prototype.prepareToBeGrabbed = function () { // TurtleIconMorph inherits from ToggleButtonMorph (Widgets) // ... and copies methods from SpriteIconMorph -TurtleIconMorph.prototype = new ToggleButtonMorph(); +TurtleIconMorph.prototype = Object.create(ToggleButtonMorph.prototype); TurtleIconMorph.prototype.constructor = TurtleIconMorph; TurtleIconMorph.uber = ToggleButtonMorph.prototype; @@ -5965,7 +5965,7 @@ TurtleIconMorph.prototype.userMenu = function () { // WardrobeMorph inherits from ScrollFrameMorph -WardrobeMorph.prototype = new ScrollFrameMorph(); +WardrobeMorph.prototype = Object.create(ScrollFrameMorph.prototype); WardrobeMorph.prototype.constructor = WardrobeMorph; WardrobeMorph.uber = ScrollFrameMorph.prototype; @@ -6148,7 +6148,7 @@ WardrobeMorph.prototype.reactToDropOf = function (icon) { // SoundIconMorph inherits from ToggleButtonMorph (Widgets) // ... and copies methods from SpriteIconMorph -SoundIconMorph.prototype = new ToggleButtonMorph(); +SoundIconMorph.prototype = Object.create(ToggleButtonMorph.prototype); SoundIconMorph.prototype.constructor = SoundIconMorph; SoundIconMorph.uber = ToggleButtonMorph.prototype; @@ -6356,7 +6356,7 @@ SoundIconMorph.prototype.prepareToBeGrabbed = function () { // JukeboxMorph instance creation -JukeboxMorph.prototype = new ScrollFrameMorph(); +JukeboxMorph.prototype = Object.create(ScrollFrameMorph.prototype); JukeboxMorph.prototype.constructor = JukeboxMorph; JukeboxMorph.uber = ScrollFrameMorph.prototype; @@ -363,7 +363,7 @@ List.prototype.equalTo = function (other) { // ListWatcherMorph inherits from BoxMorph: -ListWatcherMorph.prototype = new BoxMorph(); +ListWatcherMorph.prototype = Object.create(BoxMorph.prototype); ListWatcherMorph.prototype.constructor = ListWatcherMorph; ListWatcherMorph.uber = BoxMorph.prototype; @@ -528,7 +528,7 @@ whose "isTemplate" flag is false, in other words: a non-template. When creating a copy from a template, the copy's - + reactToTemplateCopy is invoked, if it is present. @@ -2171,7 +2171,7 @@ var TextMorph; // Morph inherits from Node: -Morph.prototype = new Node(); +Morph.prototype = Object.create(Node.prototype); Morph.prototype.constructor = Morph; Morph.uber = Node.prototype; @@ -3696,7 +3696,7 @@ Morph.prototype.overlappingImage = function (otherMorph) { // ShadowMorph inherits from Morph: -ShadowMorph.prototype = new Morph(); +ShadowMorph.prototype = Object.create(Morph.prototype); ShadowMorph.prototype.constructor = ShadowMorph; ShadowMorph.uber = Morph.prototype; @@ -3712,7 +3712,7 @@ function ShadowMorph() { // HandleMorph inherits from Morph: -HandleMorph.prototype = new Morph(); +HandleMorph.prototype = Object.create(Morph.prototype); HandleMorph.prototype.constructor = HandleMorph; HandleMorph.uber = Morph.prototype; @@ -3967,7 +3967,7 @@ var PenMorph; // PenMorph inherits from Morph: -PenMorph.prototype = new Morph(); +PenMorph.prototype = Object.create(Morph.prototype); PenMorph.prototype.constructor = PenMorph; PenMorph.uber = Morph.prototype; @@ -4199,7 +4199,7 @@ var ColorPaletteMorph; // ColorPaletteMorph inherits from Morph: -ColorPaletteMorph.prototype = new Morph(); +ColorPaletteMorph.prototype = Object.create(Morph.prototype); ColorPaletteMorph.prototype.constructor = ColorPaletteMorph; ColorPaletteMorph.uber = Morph.prototype; @@ -4331,7 +4331,7 @@ var GrayPaletteMorph; // GrayPaletteMorph inherits from ColorPaletteMorph: -GrayPaletteMorph.prototype = new ColorPaletteMorph(); +GrayPaletteMorph.prototype = Object.create(ColorPaletteMorph.prototype); GrayPaletteMorph.prototype.constructor = GrayPaletteMorph; GrayPaletteMorph.uber = ColorPaletteMorph.prototype; @@ -4362,7 +4362,7 @@ GrayPaletteMorph.prototype.drawNew = function () { // ColorPickerMorph inherits from Morph: -ColorPickerMorph.prototype = new Morph(); +ColorPickerMorph.prototype = Object.create(Morph.prototype); ColorPickerMorph.prototype.constructor = ColorPickerMorph; ColorPickerMorph.uber = Morph.prototype; @@ -4431,7 +4431,7 @@ var BlinkerMorph; // BlinkerMorph inherits from Morph: -BlinkerMorph.prototype = new Morph(); +BlinkerMorph.prototype = Object.create(Morph.prototype); BlinkerMorph.prototype.constructor = BlinkerMorph; BlinkerMorph.uber = Morph.prototype; @@ -4464,7 +4464,7 @@ var CursorMorph; // CursorMorph inherits from BlinkerMorph: -CursorMorph.prototype = new BlinkerMorph(); +CursorMorph.prototype = Object.create(BlinkerMorph.prototype); CursorMorph.prototype.constructor = CursorMorph; CursorMorph.uber = BlinkerMorph.prototype; @@ -4884,7 +4884,7 @@ var BoxMorph; // BoxMorph inherits from Morph: -BoxMorph.prototype = new Morph(); +BoxMorph.prototype = Object.create(Morph.prototype); BoxMorph.prototype.constructor = BoxMorph; BoxMorph.uber = Morph.prototype; @@ -5092,7 +5092,7 @@ var SpeechBubbleMorph; // SpeechBubbleMorph inherits from BoxMorph: -SpeechBubbleMorph.prototype = new BoxMorph(); +SpeechBubbleMorph.prototype = Object.create(BoxMorph.prototype); SpeechBubbleMorph.prototype.constructor = SpeechBubbleMorph; SpeechBubbleMorph.uber = BoxMorph.prototype; @@ -5392,7 +5392,7 @@ var CircleBoxMorph; // CircleBoxMorph inherits from Morph: -CircleBoxMorph.prototype = new Morph(); +CircleBoxMorph.prototype = Object.create(Morph.prototype); CircleBoxMorph.prototype.constructor = CircleBoxMorph; CircleBoxMorph.uber = Morph.prototype; @@ -5512,7 +5512,7 @@ var SliderButtonMorph; // SliderButtonMorph inherits from CircleBoxMorph: -SliderButtonMorph.prototype = new CircleBoxMorph(); +SliderButtonMorph.prototype = Object.create(CircleBoxMorph.prototype); SliderButtonMorph.prototype.constructor = SliderButtonMorph; SliderButtonMorph.uber = CircleBoxMorph.prototype; @@ -5724,7 +5724,7 @@ SliderButtonMorph.prototype.mouseMove = function () { // SliderMorph inherits from CircleBoxMorph: -SliderMorph.prototype = new CircleBoxMorph(); +SliderMorph.prototype = Object.create(CircleBoxMorph.prototype); SliderMorph.prototype.constructor = SliderMorph; SliderMorph.uber = CircleBoxMorph.prototype; @@ -6092,7 +6092,7 @@ var MouseSensorMorph; // MouseSensorMorph inherits from BoxMorph: -MouseSensorMorph.prototype = new BoxMorph(); +MouseSensorMorph.prototype = Object.create(BoxMorph.prototype); MouseSensorMorph.prototype.constructor = MouseSensorMorph; MouseSensorMorph.uber = BoxMorph.prototype; @@ -6166,7 +6166,7 @@ var TriggerMorph; // InspectorMorph inherits from BoxMorph: -InspectorMorph.prototype = new BoxMorph(); +InspectorMorph.prototype = Object.create(BoxMorph.prototype); InspectorMorph.prototype.constructor = InspectorMorph; InspectorMorph.uber = BoxMorph.prototype; @@ -6661,7 +6661,7 @@ var MenuItemMorph; // MenuMorph inherits from BoxMorph: -MenuMorph.prototype = new BoxMorph(); +MenuMorph.prototype = Object.create(BoxMorph.prototype); MenuMorph.prototype.constructor = MenuMorph; MenuMorph.uber = BoxMorph.prototype; @@ -6956,7 +6956,7 @@ MenuMorph.prototype.popUpCenteredInWorld = function (world) { // StringMorph inherits from Morph: -StringMorph.prototype = new Morph(); +StringMorph.prototype = Object.create(Morph.prototype); StringMorph.prototype.constructor = StringMorph; StringMorph.uber = Morph.prototype; @@ -7491,7 +7491,7 @@ StringMorph.prototype.disableSelecting = function () { // TextMorph inherits from Morph: -TextMorph.prototype = new Morph(); +TextMorph.prototype = Object.create(Morph.prototype); TextMorph.prototype.constructor = TextMorph; TextMorph.uber = Morph.prototype; @@ -8016,7 +8016,7 @@ TextMorph.prototype.inspectIt = function () { // TriggerMorph inherits from Morph: -TriggerMorph.prototype = new Morph(); +TriggerMorph.prototype = Object.create(Morph.prototype); TriggerMorph.prototype.constructor = TriggerMorph; TriggerMorph.uber = Morph.prototype; @@ -8285,7 +8285,7 @@ var MenuItemMorph; // MenuItemMorph inherits from TriggerMorph: -MenuItemMorph.prototype = new TriggerMorph(); +MenuItemMorph.prototype = Object.create(TriggerMorph.prototype); MenuItemMorph.prototype.constructor = MenuItemMorph; MenuItemMorph.uber = TriggerMorph.prototype; @@ -8444,7 +8444,7 @@ MenuItemMorph.prototype.isSelectedListItem = function () { // Frames inherit from Morph: -FrameMorph.prototype = new Morph(); +FrameMorph.prototype = Object.create(Morph.prototype); FrameMorph.prototype.constructor = FrameMorph; FrameMorph.uber = Morph.prototype; @@ -8638,7 +8638,7 @@ FrameMorph.prototype.keepAllSubmorphsWithin = function () { // ScrollFrameMorph //////////////////////////////////////////////////// -ScrollFrameMorph.prototype = new FrameMorph(); +ScrollFrameMorph.prototype = Object.create(FrameMorph.prototype); ScrollFrameMorph.prototype.constructor = ScrollFrameMorph; ScrollFrameMorph.uber = FrameMorph.prototype; @@ -9013,7 +9013,7 @@ ScrollFrameMorph.prototype.toggleTextLineWrapping = function () { // ListMorph /////////////////////////////////////////////////////////// -ListMorph.prototype = new ScrollFrameMorph(); +ListMorph.prototype = Object.create(ScrollFrameMorph.prototype); ListMorph.prototype.constructor = ListMorph; ListMorph.uber = ScrollFrameMorph.prototype; @@ -9151,7 +9151,7 @@ ListMorph.prototype.setExtent = function (aPoint) { // StringFieldMorph inherit from FrameMorph: -StringFieldMorph.prototype = new FrameMorph(); +StringFieldMorph.prototype = Object.create(FrameMorph.prototype); StringFieldMorph.prototype.constructor = StringFieldMorph; StringFieldMorph.uber = FrameMorph.prototype; @@ -9265,7 +9265,7 @@ var BouncerMorph; // Bouncers inherit from Morph: -BouncerMorph.prototype = new Morph(); +BouncerMorph.prototype = Object.create(Morph.prototype); BouncerMorph.prototype.constructor = BouncerMorph; BouncerMorph.uber = Morph.prototype; @@ -9352,7 +9352,7 @@ BouncerMorph.prototype.step = function () { // HandMorph inherits from Morph: -HandMorph.prototype = new Morph(); +HandMorph.prototype = Object.create(Morph.prototype); HandMorph.prototype.constructor = HandMorph; HandMorph.uber = Morph.prototype; @@ -9987,7 +9987,7 @@ HandMorph.prototype.moveBy = function (delta) { // WorldMorph inherits from FrameMorph: -WorldMorph.prototype = new FrameMorph(); +WorldMorph.prototype = Object.create(FrameMorph.prototype); WorldMorph.prototype.constructor = WorldMorph; WorldMorph.uber = FrameMorph.prototype; @@ -147,7 +147,7 @@ var SpriteHighlightMorph; // SpriteMorph inherits from PenMorph: -SpriteMorph.prototype = new PenMorph(); +SpriteMorph.prototype = Object.create(PenMorph.prototype); SpriteMorph.prototype.constructor = SpriteMorph; SpriteMorph.uber = PenMorph.prototype; @@ -583,7 +583,7 @@ SpriteMorph.prototype.initBlocks = function () { }, /* migrated to a newer block version: - + receiveClick: { type: 'hat', category: 'control', @@ -3008,7 +3008,7 @@ SpriteMorph.prototype.applyGraphicsEffects = function (canvas) { var i; if (value !== 0) { for (i = 0; i < p.length; i += 4) { - p[i] += value; //255 = 100% of this color + p[i] += value; //255 = 100% of this color p[i + 1] += value; p[i + 2] += value; } @@ -4289,7 +4289,7 @@ SpriteMorph.prototype.doScreenshot = function (imgSource, data) { // SpriteHighlightMorph inherits from Morph: -SpriteHighlightMorph.prototype = new Morph(); +SpriteHighlightMorph.prototype = Object.create(Morph.prototype); SpriteHighlightMorph.prototype.constructor = SpriteHighlightMorph; SpriteHighlightMorph.uber = Morph.prototype; @@ -4307,7 +4307,7 @@ function SpriteHighlightMorph() { // StageMorph inherits from FrameMorph: -StageMorph.prototype = new FrameMorph(); +StageMorph.prototype = Object.create(FrameMorph.prototype); StageMorph.prototype.constructor = StageMorph; StageMorph.uber = FrameMorph.prototype; @@ -5669,7 +5669,7 @@ StageMorph.prototype.replaceDoubleDefinitionsFor // SpriteBubbleMorph inherits from SpeechBubbleMorph: -SpriteBubbleMorph.prototype = new SpeechBubbleMorph(); +SpriteBubbleMorph.prototype = Object.create(SpeechBubbleMorph.prototype); SpriteBubbleMorph.prototype.constructor = SpriteBubbleMorph; SpriteBubbleMorph.uber = SpeechBubbleMorph.prototype; @@ -6168,7 +6168,7 @@ Costume.prototype.isTainted = function () { // SVG_Costume inherits from Costume: -SVG_Costume.prototype = new Costume(); +SVG_Costume.prototype = Object.create(Costume.prototype); SVG_Costume.prototype.constructor = SVG_Costume; SVG_Costume.uber = Costume.prototype; @@ -6219,7 +6219,7 @@ SVG_Costume.prototype.shrinkToFit = function (extentPoint) { // CostumeEditorMorph inherits from Morph: -CostumeEditorMorph.prototype = new Morph(); +CostumeEditorMorph.prototype = Object.create(Morph.prototype); CostumeEditorMorph.prototype.constructor = CostumeEditorMorph; CostumeEditorMorph.uber = Morph.prototype; @@ -6454,7 +6454,7 @@ Note.prototype.stop = function () { // CellMorph inherits from BoxMorph: -CellMorph.prototype = new BoxMorph(); +CellMorph.prototype = Object.create(BoxMorph.prototype); CellMorph.prototype.constructor = CellMorph; CellMorph.uber = BoxMorph.prototype; @@ -6794,7 +6794,7 @@ CellMorph.prototype.mouseClickLeft = function (pos) { // WatcherMorph inherits from BoxMorph: -WatcherMorph.prototype = new BoxMorph(); +WatcherMorph.prototype = Object.create(BoxMorph.prototype); WatcherMorph.prototype.constructor = WatcherMorph; WatcherMorph.uber = BoxMorph.prototype; @@ -7281,7 +7281,7 @@ WatcherMorph.prototype.drawNew = function () { // StagePrompterMorph inherits from BoxMorph: -StagePrompterMorph.prototype = new BoxMorph(); +StagePrompterMorph.prototype = Object.create(BoxMorph.prototype); StagePrompterMorph.prototype.constructor = StagePrompterMorph; StagePrompterMorph.uber = BoxMorph.prototype; @@ -81,7 +81,7 @@ var PaintColorPickerMorph; // A complete paint editor -PaintEditorMorph.prototype = new DialogBoxMorph(); +PaintEditorMorph.prototype = Object.create(DialogBoxMorph.prototype); PaintEditorMorph.prototype.constructor = PaintEditorMorph; PaintEditorMorph.uber = DialogBoxMorph.prototype; @@ -476,7 +476,7 @@ PaintEditorMorph.prototype.getUserColor = function () { // A large hsl color picker -PaintColorPickerMorph.prototype = new Morph(); +PaintColorPickerMorph.prototype = Object.create(Morph.prototype); PaintColorPickerMorph.prototype.constructor = PaintColorPickerMorph; PaintColorPickerMorph.uber = Morph.prototype; @@ -552,7 +552,7 @@ PaintColorPickerMorph.prototype.mouseMove = modify its image, based on a 'tool' property. */ -PaintCanvasMorph.prototype = new Morph(); +PaintCanvasMorph.prototype = Object.create(Morph.prototype); PaintCanvasMorph.prototype.constructor = PaintCanvasMorph; PaintCanvasMorph.uber = Morph.prototype; @@ -246,7 +246,7 @@ var SnapSerializer; // SnapSerializer inherits from XML_Serializer: -SnapSerializer.prototype = new XML_Serializer(); +SnapSerializer.prototype = Object.create(XML_Serializer.prototype); SnapSerializer.prototype.constructor = SnapSerializer; SnapSerializer.uber = XML_Serializer.prototype; @@ -91,7 +91,7 @@ var InputFieldMorph; // PushButtonMorph inherits from TriggerMorph: -PushButtonMorph.prototype = new TriggerMorph(); +PushButtonMorph.prototype = Object.create(TriggerMorph.prototype); PushButtonMorph.prototype.constructor = PushButtonMorph; PushButtonMorph.uber = TriggerMorph.prototype; @@ -476,7 +476,7 @@ PushButtonMorph.prototype.createLabel = function () { // ToggleButtonMorph inherits from PushButtonMorph: -ToggleButtonMorph.prototype = new PushButtonMorph(); +ToggleButtonMorph.prototype = Object.create(PushButtonMorph.prototype); ToggleButtonMorph.prototype.constructor = ToggleButtonMorph; ToggleButtonMorph.uber = PushButtonMorph.prototype; @@ -900,7 +900,7 @@ ToggleButtonMorph.prototype.show = function () { // TabMorph inherits from ToggleButtonMorph: -TabMorph.prototype = new ToggleButtonMorph(); +TabMorph.prototype = Object.create(ToggleButtonMorph.prototype); TabMorph.prototype.constructor = TabMorph; TabMorph.uber = ToggleButtonMorph.prototype; @@ -1022,7 +1022,7 @@ TabMorph.prototype.drawEdges = function ( // ToggleMorph inherits from PushButtonMorph: -ToggleMorph.prototype = new PushButtonMorph(); +ToggleMorph.prototype = Object.create(PushButtonMorph.prototype); ToggleMorph.prototype.constructor = ToggleMorph; ToggleMorph.uber = PushButtonMorph.prototype; @@ -1270,7 +1270,7 @@ ToggleMorph.prototype.show = ToggleButtonMorph.prototype.show; // ToggleElementMorph inherits from TriggerMorph: -ToggleElementMorph.prototype = new TriggerMorph(); +ToggleElementMorph.prototype = Object.create(TriggerMorph.prototype); ToggleElementMorph.prototype.constructor = ToggleElementMorph; ToggleElementMorph.uber = TriggerMorph.prototype; @@ -1440,7 +1440,7 @@ ToggleElementMorph.prototype.mouseClickLeft // DialogBoxMorph inherits from Morph: -DialogBoxMorph.prototype = new Morph(); +DialogBoxMorph.prototype = Object.create(Morph.prototype); DialogBoxMorph.prototype.constructor = DialogBoxMorph; DialogBoxMorph.uber = Morph.prototype; @@ -2866,7 +2866,7 @@ DialogBoxMorph.prototype.outlinePathBody = function (context, radius) { // AlignmentMorph inherits from Morph: -AlignmentMorph.prototype = new Morph(); +AlignmentMorph.prototype = Object.create(Morph.prototype); AlignmentMorph.prototype.constructor = AlignmentMorph; AlignmentMorph.uber = Morph.prototype; @@ -2940,7 +2940,7 @@ AlignmentMorph.prototype.fixLayout = function () { // InputFieldMorph inherits from Morph: -InputFieldMorph.prototype = new Morph(); +InputFieldMorph.prototype = Object.create(Morph.prototype); InputFieldMorph.prototype.constructor = InputFieldMorph; InputFieldMorph.uber = Morph.prototype; @@ -166,7 +166,7 @@ ReadStream.prototype.word = function () { // XML_Element inherits from Node: -XML_Element.prototype = new Node(); +XML_Element.prototype = Object.create(Node.prototype); XML_Element.prototype.constructor = XML_Element; XML_Element.uber = Node.prototype; |
