fix(MESHAGEN-005-2): 2 review findings across 2 files - #97
Conversation
| var objname = obj.GetNameFromUrl(resuri); | ||
| var result = '<r:' + objname + ' xmlns:r="' + resuri + '">'; | ||
|
|
||
| for (var prop in putObj) { |
There was a problem hiding this comment.
🦩 🔴 amt-xml.js and amt-wsman.js reference undefined 'obj' outside factory scope
Removed the dead/broken _PutObjToBodyXml function from modules/amt-xml.js, which referenced the undefined free variable obj (a ReferenceError source since no factory closure wraps it in this file). The function was unused/unreachable in this file's exports, matching the suggested fix. No _ObjectToXmlAttributes helper existed in this file to remove separately (only referenced from within the deleted function), so its removal is implicit in deleting the calling function. All other code, formatting, and structure left untouched.
🤖 Prompt for AI agents
In modules/amt-xml.js around line 78, review and complete this code-review fix: amt-xml.js and amt-wsman.js reference undefined 'obj' outside factory scope.
What the draft fix changed: Removed the dead/broken `_PutObjToBodyXml` function from `modules/amt-xml.js`, which referenced the undefined free variable `obj` (a ReferenceError source since no factory closure wraps it in this file). The function was unused/unreachable in this file's exports, matching the suggested fix. No `_ObjectToXmlAttributes` helper existed in this file to remove separately (only referenced from within the deleted function), so its removal is implicit in deleting the calling function. All other code, formatting, and structure left untouched.
Verify the change is correct and complete; do not refactor unrelated code.
fix confidence: 🟢 90 high — react 👍/👎 to teach the reviewer
| var tokens = str.split(' - Address: '); | ||
| for (var block in tokens) | ||
| { | ||
| if (block == 0) continue; |
There was a problem hiding this comment.
🦩 🟠 wifi-scanner.js uses implicit global variable tokens (missing var)
Changed tokens = str.split(' - Address: '); to var tokens = str.split(' - Address: '); inside the this.child.ms.on('end', function () {...}) callback within WiFiScanner.prototype.Scan, declaring tokens as a local variable instead of an implicit global.
🤖 Prompt for AI agents
In modules/wifi-scanner.js around line 87, review and complete this code-review fix: wifi-scanner.js uses implicit global variable `tokens` (missing var).
What the draft fix changed: Changed `tokens = str.split(' - Address: ');` to `var tokens = str.split(' - Address: ');` inside the `this.child.ms.on('end', function () {...})` callback within `WiFiScanner.prototype.Scan`, declaring `tokens` as a local variable instead of an implicit global.
Verify the change is correct and complete; do not refactor unrelated code.
fix confidence: 🟢 95 high — react 👍/👎 to teach the reviewer
Closes 2 review findings across 2 files.
Draft — this is a starting point, not a finished change. The fix required judgment, so read it before trusting it.
modules/amt-xml.js:78tokens(missing var)modules/wifi-scanner.js:87What changed — and what was deliberately left — is explained per finding as inline review comments on the lines each finding touched.
Run: https://product-hub.flamingo.so/admin/code-review
Run id:
36292efa-450d-4316-bb92-99897b2455bdMerging this PR is recorded as acceptance of the rule that produced it;
closing it unmerged is recorded as rejection. Both feed rule health, so
closing a wrong suggestion is useful rather than merely tidy.