From 10f5f60b7f4e5c4fb15b7c9434f98077c23aed0c Mon Sep 17 00:00:00 2001 From: ccd0 Date: Fri, 19 Jul 2019 10:26:29 -0700 Subject: [PATCH] Changes in preparation for Coffeescript 2. #829 --- src/classes/Callbacks.coffee | 2 +- src/classes/Post.Clone.coffee | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/classes/Callbacks.coffee b/src/classes/Callbacks.coffee index 31aee94f5e..89aa2f5522 100644 --- a/src/classes/Callbacks.coffee +++ b/src/classes/Callbacks.coffee @@ -11,7 +11,7 @@ class Callbacks @keys.push name unless @[name] @[name] = cb - execute: (node, keys=@keys, force) -> + execute: (node, keys=@keys, force=false) -> return if node.callbacksExecuted and !force node.callbacksExecuted = true for name in keys diff --git a/src/classes/Post.Clone.coffee b/src/classes/Post.Clone.coffee index 8f87315eaa..efa3089b78 100644 --- a/src/classes/Post.Clone.coffee +++ b/src/classes/Post.Clone.coffee @@ -1,7 +1,12 @@ Post.Clone = class extends Post isClone: true - constructor: (@origin, @context, contractThumb) -> + constructor: -> + that = Object.create(Post.Clone.prototype) + that.construct arguments... + return that + + construct: (@origin, @context, contractThumb) -> for key in ['ID', 'postID', 'threadID', 'boardID', 'siteID', 'fullID', 'board', 'thread', 'info', 'quotes', 'isReply'] # Copy or point to the origin's key value. @[key] = @origin[key]