mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Add _module to Node object to provide module info
This commit is contained in:
parent
f8c47f59bc
commit
ea43729063
@ -83,6 +83,7 @@ function createNode(flow,config) {
|
||||
}
|
||||
}
|
||||
try {
|
||||
Object.defineProperty(conf,'_module', {value: typeRegistry.getNodeInfo(type), enumerable: false, writable: true })
|
||||
Object.defineProperty(conf,'_flow', {value: flow, enumerable: false, writable: true })
|
||||
newNode = new nodeTypeConstructor(conf);
|
||||
} catch (err) {
|
||||
|
@ -59,6 +59,9 @@ function Node(n) {
|
||||
// which we can tolerate as they are the same object.
|
||||
Object.defineProperty(this,'_flow', {value: n._flow, enumerable: false, writable: true })
|
||||
}
|
||||
if (n._module) {
|
||||
Object.defineProperty(this,'_module', {value: n._module, enumerable: false, writable: true })
|
||||
}
|
||||
this.updateWires(n.wires);
|
||||
}
|
||||
|
||||
@ -484,6 +487,7 @@ function log_helper(self, level, msg) {
|
||||
level: level,
|
||||
id: self.id,
|
||||
type: self.type,
|
||||
module: self._module,
|
||||
msg: msg
|
||||
};
|
||||
if (self._alias) {
|
||||
|
Loading…
Reference in New Issue
Block a user