mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
let setMessageProperty return success flag
so calling node can warn if operation tries to overwrite primitive type
This commit is contained in:
@@ -215,7 +215,9 @@ module.exports = function(RED) {
|
||||
if (rule.t === 'delete') {
|
||||
RED.util.setMessageProperty(msg,property,undefined);
|
||||
} else if (rule.t === 'set') {
|
||||
RED.util.setMessageProperty(msg,property,value);
|
||||
if (!RED.util.setMessageProperty(msg,property,value)) {
|
||||
node.warn(RED._("change.errors.no-override",{prop:property}));
|
||||
}
|
||||
} else if (rule.t === 'change') {
|
||||
current = RED.util.getMessageProperty(msg,property);
|
||||
if (typeof current === 'string') {
|
||||
|
@@ -657,7 +657,8 @@
|
||||
"errors": {
|
||||
"invalid-from": "Invalid 'from' property: __error__",
|
||||
"invalid-json": "Invalid 'to' JSON property",
|
||||
"invalid-expr": "Invalid JSONata expression: __error__"
|
||||
"invalid-expr": "Invalid JSONata expression: __error__",
|
||||
"no-override": "Can't overwrite primitive type with object __prop__."
|
||||
}
|
||||
},
|
||||
"range": {
|
||||
|
Reference in New Issue
Block a user