Change fourth argument of Post constructor to more general flags argument.

This commit is contained in:
ccd0 2019-07-12 14:27:33 -07:00
parent 4f0a24484a
commit 64d8dce693
2 changed files with 4 additions and 3 deletions

View File

@ -76,7 +76,7 @@ Test =
root = g.SITE.Build.post obj
t2 = new Date().getTime()
Test.time += t2 - t1
post2 = new Post root, post.thread, post.board, 'forBuildTest'
post2 = new Post root, post.thread, post.board, {forBuildTest: true}
fail = false
x = post.normalizedOriginal

View File

@ -1,11 +1,12 @@
class Post
toString: -> @ID
constructor: (root, @thread, @board) ->
constructor: (root, @thread, @board, flags={}) ->
<% if (readJSON('/.tests_enabled')) { %>
@normalizedOriginal = Test.normalize root
<% } %>
$.extend @, flags
@ID = +root.id.match(/\d*$/)[0]
@threadID = @thread.ID
@boardID = @board.ID
@ -55,7 +56,7 @@ class Post
@clones = []
<% if (readJSON('/.tests_enabled')) { %>
return if arguments[3] is 'forBuildTest'
return if @forBuildTest
<% } %>
if g.posts[@fullID]
@isRebuilt = true