Better name for the OpaqueRef regex constant.

This commit is contained in:
Julien Fontanet
2015-05-06 18:14:20 +02:00
parent 4272e8196a
commit 0512fac3aa

View File

@@ -105,6 +105,7 @@ notConnectedPromise.catch(noop)
// ===================================================================
const OPAQUE_REF_RE = /^OpaqueRef:/
const MAX_TRIES = 5
// -------------------------------------------------------------------
@@ -356,10 +357,9 @@ export class Xapi extends EventEmitter {
_normalizeObject (type, ref, object) {
const {_objectsByRefs: objectsByRefs} = this
const REF_RE = /^OpaqueRef:/
forEach(object, function resolveIfLink (value, key, object) {
if (typeof value === 'string' && REF_RE.test(value)) {
if (typeof value === 'string' && OPAQUE_REF_RE.test(value)) {
Object.defineProperty(object, key, {
enumerable: true,
get: () => objectsByRefs[value]