feat(Xapi#getObject): accept objects with _xapiId property
This commit is contained in:
parent
489e9fce27
commit
9991ef624c
@ -123,6 +123,15 @@ export default class Xapi extends XapiBase {
|
|||||||
constructor (...args) {
|
constructor (...args) {
|
||||||
super(...args)
|
super(...args)
|
||||||
|
|
||||||
|
// Patch getObject to resolve _xapiId property.
|
||||||
|
this.getObject = (getObject => (...args) => {
|
||||||
|
let tmp
|
||||||
|
if ((tmp = args[0]) != null && (tmp = tmp._xapiId) != null) {
|
||||||
|
args[0] = tmp
|
||||||
|
}
|
||||||
|
return getObject.apply(this, args)
|
||||||
|
})(this.getObject)
|
||||||
|
|
||||||
const genericWatchers = this._genericWatchers = createRawObject()
|
const genericWatchers = this._genericWatchers = createRawObject()
|
||||||
const objectsWatchers = this._objectWatchers = createRawObject()
|
const objectsWatchers = this._objectWatchers = createRawObject()
|
||||||
const taskWatchers = this._taskWatchers = createRawObject()
|
const taskWatchers = this._taskWatchers = createRawObject()
|
||||||
|
Loading…
Reference in New Issue
Block a user