Merge ~twom/launchpad:fix-subscription-js-test into launchpad:master

Proposed by Tom Wardill
Status: Merged
Approved by: Tom Wardill
Approved revision: 82740768c74e3691728da7e0dbc33d240fa9deeb
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~twom/launchpad:fix-subscription-js-test
Merge into: launchpad:master
Diff against target: 20 lines (+2/-2)
1 file modified
lib/lp/bugs/javascript/subscription.js (+2/-2)
Reviewer Review Type Date Requested Status
Colin Watson (community) Approve
Review via email: mp+407018@code.launchpad.net

Commit message

Guard using the iterable, rather than Object

Description of the change

We have an Array here, so we need to use the iterable's hasOwnProperty, rather than Object.

Following the 'Difference between for..of and for..in' section of https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...of

To post a comment you must log in.
Revision history for this message
Colin Watson (cjwatson) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/lib/lp/bugs/javascript/subscription.js b/lib/lp/bugs/javascript/subscription.js
index 0ba049a..6faa0f5 100644
--- a/lib/lp/bugs/javascript/subscription.js
+++ b/lib/lp/bugs/javascript/subscription.js
@@ -849,13 +849,13 @@ function safely_render_description(subscription, additional_vars) {
849 var replacements = {};849 var replacements = {};
850 var property;850 var property;
851 for (property in subscription.vars) {851 for (property in subscription.vars) {
852 if (Object.prototype.hasOwnProperty(subscription.vars, property)) {852 if (subscription.vars.hasOwnProperty(property)) {
853 replacements[property] = var_replacer(853 replacements[property] = var_replacer(
854 undefined, subscription.vars[property]);854 undefined, subscription.vars[property]);
855 }855 }
856 }856 }
857 for (property in additional_vars) {857 for (property in additional_vars) {
858 if (Object.prototype.hasOwnProperty(additional_vars, property)) {858 if (additional_vars.hasOwnProperty(property)) {
859 replacements[property] = var_replacer(859 replacements[property] = var_replacer(
860 property, additional_vars[property]);860 property, additional_vars[property]);
861 }861 }

Subscribers

People subscribed via source and target branches

to status/vote changes: