JS resources now use functions for defaults
Review Request #7381 — Created June 4, 2015 and submitted
Previously, the
RB.BaseResource
model was using an object literal for
its defaults, but its default value for extra data was an empty object.
This could possibly result in shared state if a resource did not return
anextra_data
JSON field, so thedefaults
property has been changed
into a function to avoid this.All child resources of
RB.BaseResource
have been modified to use a
function instead of an attribute fordefaults
and to correctly invoke
the parent class's definition ofdefaults
.
Ran JS tests.
- Description:
-
Previously, the
RB.BaseResource
model was using an object literal forits defaults, but its default value for extra data was an empty object. This could possibly result in shared state if a resource did not return an extra_data
JSON field, so thedefaults
property has been changedinto a function to avoid this. + + All child resources of
RB.BaseResource
have been modified to use a+ function instead of an attribute for defaults
and to correctly invoke+ the parent class's definition of defaults
. - Testing Done:
-
+ Ran JS tests.
- Commit:
-
6e28dde89e26371366f4b4767282f378309636a74c43fa7de12469bd23b6b7e913fadbfb3b7ab802
- Diff:
-
Revision 2 (+309 -273)
-
Tool: Pyflakes Ignored Files: reviewboard/static/rb/js/resources/models/reviewGroupModel.js reviewboard/static/rb/js/resources/models/fileAttachmentModel.js reviewboard/static/rb/js/resources/models/reviewRequestModel.js reviewboard/static/rb/js/resources/models/diffCommentModel.js reviewboard/static/rb/js/resources/models/diffModel.js reviewboard/static/rb/js/resources/models/fileDiffModel.js reviewboard/static/rb/js/resources/models/reviewReplyModel.js reviewboard/static/rb/js/resources/models/screenshotCommentModel.js reviewboard/static/rb/js/resources/models/baseResourceModel.js reviewboard/static/rb/js/resources/models/baseCommentModel.js reviewboard/static/rb/js/resources/models/draftReviewRequestModel.js reviewboard/static/rb/js/resources/models/screenshotModel.js reviewboard/static/rb/js/resources/models/fileAttachmentCommentModel.js reviewboard/static/rb/js/resources/models/defaultReviewerModel.js reviewboard/static/rb/js/resources/models/baseCommentReplyModel.js reviewboard/static/rb/js/resources/models/validateDiffModel.js reviewboard/static/rb/js/resources/models/repositoryModel.js reviewboard/static/rb/js/resources/models/reviewModel.js Tool: PEP8 Style Checker Ignored Files: reviewboard/static/rb/js/resources/models/reviewGroupModel.js reviewboard/static/rb/js/resources/models/fileAttachmentModel.js reviewboard/static/rb/js/resources/models/reviewRequestModel.js reviewboard/static/rb/js/resources/models/diffCommentModel.js reviewboard/static/rb/js/resources/models/diffModel.js reviewboard/static/rb/js/resources/models/fileDiffModel.js reviewboard/static/rb/js/resources/models/reviewReplyModel.js reviewboard/static/rb/js/resources/models/screenshotCommentModel.js reviewboard/static/rb/js/resources/models/baseResourceModel.js reviewboard/static/rb/js/resources/models/baseCommentModel.js reviewboard/static/rb/js/resources/models/draftReviewRequestModel.js reviewboard/static/rb/js/resources/models/screenshotModel.js reviewboard/static/rb/js/resources/models/fileAttachmentCommentModel.js reviewboard/static/rb/js/resources/models/defaultReviewerModel.js reviewboard/static/rb/js/resources/models/baseCommentReplyModel.js reviewboard/static/rb/js/resources/models/validateDiffModel.js reviewboard/static/rb/js/resources/models/repositoryModel.js reviewboard/static/rb/js/resources/models/reviewModel.js
- Change Summary:
-
Addressed issues.
- Commit:
-
4c43fa7de12469bd23b6b7e913fadbfb3b7ab80229bc27b8d220abece46198adb562ce8651dcb084
- Diff:
-
Revision 3 (+311 -273)
-
Tool: Pyflakes Ignored Files: reviewboard/static/rb/js/resources/models/reviewGroupModel.js reviewboard/static/rb/js/resources/models/fileAttachmentModel.js reviewboard/static/rb/js/resources/models/reviewRequestModel.js reviewboard/static/rb/js/resources/models/diffCommentModel.js reviewboard/static/rb/js/resources/models/diffModel.js reviewboard/static/rb/js/resources/models/fileDiffModel.js reviewboard/static/rb/js/resources/models/reviewReplyModel.js reviewboard/static/rb/js/resources/models/screenshotCommentModel.js reviewboard/static/rb/js/resources/models/baseResourceModel.js reviewboard/static/rb/js/resources/models/baseCommentModel.js reviewboard/static/rb/js/resources/models/draftReviewRequestModel.js reviewboard/static/rb/js/resources/models/screenshotModel.js reviewboard/static/rb/js/resources/models/fileAttachmentCommentModel.js reviewboard/static/rb/js/resources/models/defaultReviewerModel.js reviewboard/static/rb/js/resources/models/baseCommentReplyModel.js reviewboard/static/rb/js/resources/models/validateDiffModel.js reviewboard/static/rb/js/resources/models/repositoryModel.js reviewboard/static/rb/js/resources/models/reviewModel.js Tool: PEP8 Style Checker Ignored Files: reviewboard/static/rb/js/resources/models/reviewGroupModel.js reviewboard/static/rb/js/resources/models/fileAttachmentModel.js reviewboard/static/rb/js/resources/models/reviewRequestModel.js reviewboard/static/rb/js/resources/models/diffCommentModel.js reviewboard/static/rb/js/resources/models/diffModel.js reviewboard/static/rb/js/resources/models/fileDiffModel.js reviewboard/static/rb/js/resources/models/reviewReplyModel.js reviewboard/static/rb/js/resources/models/screenshotCommentModel.js reviewboard/static/rb/js/resources/models/baseResourceModel.js reviewboard/static/rb/js/resources/models/baseCommentModel.js reviewboard/static/rb/js/resources/models/draftReviewRequestModel.js reviewboard/static/rb/js/resources/models/screenshotModel.js reviewboard/static/rb/js/resources/models/fileAttachmentCommentModel.js reviewboard/static/rb/js/resources/models/defaultReviewerModel.js reviewboard/static/rb/js/resources/models/baseCommentReplyModel.js reviewboard/static/rb/js/resources/models/validateDiffModel.js reviewboard/static/rb/js/resources/models/repositoryModel.js reviewboard/static/rb/js/resources/models/reviewModel.js
- Change Summary:
-
Fix some typos
- Commit:
-
29bc27b8d220abece46198adb562ce8651dcb08459ddf1d2f21a5e36f05880f53b29ac2bc1200fb0
- Diff:
-
Revision 4 (+311 -273)
-
Tool: PEP8 Style Checker Ignored Files: reviewboard/static/rb/js/resources/models/reviewGroupModel.js reviewboard/static/rb/js/resources/models/fileAttachmentModel.js reviewboard/static/rb/js/resources/models/reviewRequestModel.js reviewboard/static/rb/js/resources/models/diffCommentModel.js reviewboard/static/rb/js/resources/models/diffModel.js reviewboard/static/rb/js/resources/models/fileDiffModel.js reviewboard/static/rb/js/resources/models/reviewReplyModel.js reviewboard/static/rb/js/resources/models/screenshotCommentModel.js reviewboard/static/rb/js/resources/models/baseResourceModel.js reviewboard/static/rb/js/resources/models/baseCommentModel.js reviewboard/static/rb/js/resources/models/draftReviewRequestModel.js reviewboard/static/rb/js/resources/models/screenshotModel.js reviewboard/static/rb/js/resources/models/fileAttachmentCommentModel.js reviewboard/static/rb/js/resources/models/defaultReviewerModel.js reviewboard/static/rb/js/resources/models/baseCommentReplyModel.js reviewboard/static/rb/js/resources/models/validateDiffModel.js reviewboard/static/rb/js/resources/models/repositoryModel.js reviewboard/static/rb/js/resources/models/reviewModel.js Tool: Pyflakes Ignored Files: reviewboard/static/rb/js/resources/models/reviewGroupModel.js reviewboard/static/rb/js/resources/models/fileAttachmentModel.js reviewboard/static/rb/js/resources/models/reviewRequestModel.js reviewboard/static/rb/js/resources/models/diffCommentModel.js reviewboard/static/rb/js/resources/models/diffModel.js reviewboard/static/rb/js/resources/models/fileDiffModel.js reviewboard/static/rb/js/resources/models/reviewReplyModel.js reviewboard/static/rb/js/resources/models/screenshotCommentModel.js reviewboard/static/rb/js/resources/models/baseResourceModel.js reviewboard/static/rb/js/resources/models/baseCommentModel.js reviewboard/static/rb/js/resources/models/draftReviewRequestModel.js reviewboard/static/rb/js/resources/models/screenshotModel.js reviewboard/static/rb/js/resources/models/fileAttachmentCommentModel.js reviewboard/static/rb/js/resources/models/defaultReviewerModel.js reviewboard/static/rb/js/resources/models/baseCommentReplyModel.js reviewboard/static/rb/js/resources/models/validateDiffModel.js reviewboard/static/rb/js/resources/models/repositoryModel.js reviewboard/static/rb/js/resources/models/reviewModel.js
- Change Summary:
-
Fix typo
- Commit:
-
59ddf1d2f21a5e36f05880f53b29ac2bc1200fb011da7d241dd0dd4296f11312a47bc06302e44e41
- Diff:
-
Revision 5 (+311 -273)
-
Tool: PEP8 Style Checker Ignored Files: reviewboard/static/rb/js/resources/models/reviewGroupModel.js reviewboard/static/rb/js/resources/models/fileAttachmentModel.js reviewboard/static/rb/js/resources/models/reviewRequestModel.js reviewboard/static/rb/js/resources/models/diffCommentModel.js reviewboard/static/rb/js/resources/models/diffModel.js reviewboard/static/rb/js/resources/models/fileDiffModel.js reviewboard/static/rb/js/resources/models/reviewReplyModel.js reviewboard/static/rb/js/resources/models/screenshotCommentModel.js reviewboard/static/rb/js/resources/models/baseResourceModel.js reviewboard/static/rb/js/resources/models/baseCommentModel.js reviewboard/static/rb/js/resources/models/draftReviewRequestModel.js reviewboard/static/rb/js/resources/models/screenshotModel.js reviewboard/static/rb/js/resources/models/fileAttachmentCommentModel.js reviewboard/static/rb/js/resources/models/defaultReviewerModel.js reviewboard/static/rb/js/resources/models/baseCommentReplyModel.js reviewboard/static/rb/js/resources/models/validateDiffModel.js reviewboard/static/rb/js/resources/models/repositoryModel.js reviewboard/static/rb/js/resources/models/reviewModel.js Tool: Pyflakes Ignored Files: reviewboard/static/rb/js/resources/models/reviewGroupModel.js reviewboard/static/rb/js/resources/models/fileAttachmentModel.js reviewboard/static/rb/js/resources/models/reviewRequestModel.js reviewboard/static/rb/js/resources/models/diffCommentModel.js reviewboard/static/rb/js/resources/models/diffModel.js reviewboard/static/rb/js/resources/models/fileDiffModel.js reviewboard/static/rb/js/resources/models/reviewReplyModel.js reviewboard/static/rb/js/resources/models/screenshotCommentModel.js reviewboard/static/rb/js/resources/models/baseResourceModel.js reviewboard/static/rb/js/resources/models/baseCommentModel.js reviewboard/static/rb/js/resources/models/draftReviewRequestModel.js reviewboard/static/rb/js/resources/models/screenshotModel.js reviewboard/static/rb/js/resources/models/fileAttachmentCommentModel.js reviewboard/static/rb/js/resources/models/defaultReviewerModel.js reviewboard/static/rb/js/resources/models/baseCommentReplyModel.js reviewboard/static/rb/js/resources/models/validateDiffModel.js reviewboard/static/rb/js/resources/models/repositoryModel.js reviewboard/static/rb/js/resources/models/reviewModel.js