1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00
node-red/packages/node_modules/@node-red/nodes/core/common
Alexandre Alapetite e55cbb3e3d
Fix bug in debug node due to msg.hasOwnProperty construct
`msg.hasOwnProperty("status")` might make the debug node crash/produce an error if the payload was created with `Object.create(null)`.
This is the case e.g. for `ini` (to parse INI files), an official NPM node:
4f289946b3/lib/ini.js (L63)

My Node-RED node `node-red-contrib-parser-ini`, which is using that library, was hit by this bug and I had to ship a workaround
fe6b1eb4b1/parser-ini.js (L14)

The `msg.hasOwnProperty("xxx")` construct should not be used since ECMAScript 5.1.

ESLint advises in the same direction https://eslint.org/docs/rules/no-prototype-builtins

This patch was produced using the following regex:
Search: `\b([\w.]+).hasOwnProperty\(`
Replace: `Object.prototype.hasOwnProperty.call($1, `

This could be applied more gobally if desired.
2022-02-03 02:01:22 +01:00
..
lib/debug Overhaul Debug sidebar filter and clear button options 2021-10-12 17:24:51 +01:00
20-inject.html fix JSON propety validation of inject node 2022-01-13 21:42:50 +09:00
20-inject.js remove debug msg from inject close 2022-01-10 20:22:20 +00:00
21-debug.html Overhaul Debug sidebar filter and clear button options 2021-10-12 17:24:51 +01:00
21-debug.js Fix bug in debug node due to msg.hasOwnProperty construct 2022-02-03 02:01:22 +01:00
24-complete.html Implement node property typing 2021-01-08 14:19:12 +00:00
24-complete.js new-style callback function (complete node) 2020-07-14 18:50:03 +09:00
25-catch.html Implement node property typing 2021-01-08 14:19:12 +00:00
25-catch.js new-style callback function (catch node) 2020-07-14 18:53:21 +09:00
25-status.html Implement node property typing 2021-01-08 14:19:12 +00:00
25-status.js new-style callback function (status node) 2020-07-14 18:56:16 +09:00
60-link.html Fix saving link out node links 2021-10-18 09:32:00 +01:00
60-link.js Add timeout option to link-call node 2021-09-29 14:28:12 +01:00
90-comment.html Change types from text/x-red to text/html in node html files 2020-01-15 11:40:48 +09:00
90-comment.js Reorganise nodes into new categories 2019-08-21 14:23:23 +01:00
98-unknown.html Change types from text/x-red to text/html in node html files 2020-01-15 11:40:48 +09:00
98-unknown.js Reorganise nodes into new categories 2019-08-21 14:23:23 +01:00