Comparing version
{ | ||
"name": "manyfest", | ||
"version": "1.0.35", | ||
"version": "1.0.36", | ||
"description": "JSON Object Manifest for Data Description and Parsing", | ||
@@ -50,3 +50,3 @@ "main": "source/Manyfest.js", | ||
"devDependencies": { | ||
"quackage": "^1.0.29" | ||
"quackage": "^1.0.30" | ||
}, | ||
@@ -53,0 +53,0 @@ "author": "steven velozo <steven@velozo.com>", |
@@ -204,3 +204,21 @@ /** | ||
// No arguments... just call the function (bound to the scope of the object it is contained withing) | ||
return this.checkAddressExists(pObject[tmpFunctionAddress].apply(pObject), tmpNewAddress, tmpRootObject); | ||
if (tmpFunctionAddress in pObject) | ||
{ | ||
try | ||
{ | ||
return this.checkAddressExists(pObject[tmpFunctionAddress].apply(pObject), tmpNewAddress, tmpRootObject); | ||
} | ||
catch(pError) | ||
{ | ||
// The function call failed, so the address doesn't exist | ||
libSimpleLog.log(`Error calling function ${tmpFunctionAddress} (address [${pAddress}]): ${pError.message}`); | ||
return false; | ||
} | ||
} | ||
else | ||
{ | ||
// The function doesn't exist, so the address doesn't exist | ||
libSimpleLog.log(`Function ${tmpFunctionAddress} does not exist (address [${pAddress}])`); | ||
return false; | ||
} | ||
} | ||
@@ -221,3 +239,22 @@ else | ||
return this.checkAddressExists(pObject[tmpFunctionAddress].apply(pObject, tmpArgumentValues), tmpNewAddress, tmpRootObject); | ||
//return this.checkAddressExists(pObject[tmpFunctionAddress].apply(pObject, tmpArgumentValues), tmpNewAddress, tmpRootObject); | ||
if (tmpFunctionAddress in pObject) | ||
{ | ||
try | ||
{ | ||
return this.checkAddressExists(pObject[tmpFunctionAddress].apply(pObject, tmpArgumentValues), tmpNewAddress, tmpRootObject); | ||
} | ||
catch(pError) | ||
{ | ||
// The function call failed, so the address doesn't exist | ||
libSimpleLog.log(`Error calling function ${tmpFunctionAddress} (address [${pAddress}]): ${pError.message}`); | ||
return false; | ||
} | ||
} | ||
else | ||
{ | ||
// The function doesn't exist, so the address doesn't exist | ||
libSimpleLog.log(`Function ${tmpFunctionAddress} does not exist (address [${pAddress}])`); | ||
return false; | ||
} | ||
} | ||
@@ -224,0 +261,0 @@ } |
@@ -155,3 +155,21 @@ /** | ||
// No arguments... just call the function (bound to the scope of the object it is contained withing) | ||
return pObject[tmpFunctionAddress].apply(pObject); | ||
if (tmpFunctionAddress in pObject) | ||
{ | ||
try | ||
{ | ||
return pObject[tmpFunctionAddress].apply(pObject); | ||
} | ||
catch(pError) | ||
{ | ||
// The function call failed, so the address doesn't exist | ||
console.log(`Error in getValueAtAddress calling function ${tmpFunctionAddress} (address [${pAddress}]): ${pError.message}`); | ||
return false; | ||
} | ||
} | ||
else | ||
{ | ||
// The function doesn't exist, so the address doesn't exist | ||
console.log(`Function ${tmpFunctionAddress} does not exist (address [${pAddress}])`); | ||
return false; | ||
} | ||
} | ||
@@ -189,3 +207,21 @@ else | ||
return pObject[tmpFunctionAddress].apply(pObject, tmpArgumentValues); | ||
if (tmpFunctionAddress in pObject) | ||
{ | ||
try | ||
{ | ||
return pObject[tmpFunctionAddress].apply(pObject, tmpArgumentValues); | ||
} | ||
catch(pError) | ||
{ | ||
// The function call failed, so the address doesn't exist | ||
console.log(`Error in getValueAtAddress calling function ${tmpFunctionAddress} (address [${pAddress}]): ${pError.message}`); | ||
return false; | ||
} | ||
} | ||
else | ||
{ | ||
// The function doesn't exist, so the address doesn't exist | ||
console.log(`Function ${tmpFunctionAddress} does not exist (address [${pAddress}])`); | ||
return false; | ||
} | ||
} | ||
@@ -355,3 +391,21 @@ } | ||
// No arguments... just call the function (bound to the scope of the object it is contained withing) | ||
return this.getValueAtAddress(pObject[tmpFunctionAddress].apply(pObject), tmpNewAddress, tmpParentAddress, tmpRootObject); | ||
if (tmpFunctionAddress in pObject) | ||
{ | ||
try | ||
{ | ||
return this.getValueAtAddress(pObject[tmpFunctionAddress].apply(pObject), tmpNewAddress, tmpParentAddress, tmpRootObject); | ||
} | ||
catch(pError) | ||
{ | ||
// The function call failed, so the address doesn't exist | ||
console.log(`Error in getValueAtAddress calling function ${tmpFunctionAddress} (address [${pAddress}]): ${pError.message}`); | ||
return false; | ||
} | ||
} | ||
else | ||
{ | ||
// The function doesn't exist, so the address doesn't exist | ||
console.log(`Function ${tmpFunctionAddress} does not exist (address [${pAddress}])`); | ||
return false; | ||
} | ||
} | ||
@@ -389,3 +443,21 @@ else | ||
return this.getValueAtAddress(pObject[tmpFunctionAddress].apply(pObject, tmpArgumentValues), tmpNewAddress, tmpParentAddress, tmpRootObject); | ||
if (tmpFunctionAddress in pObject) | ||
{ | ||
try | ||
{ | ||
return this.getValueAtAddress(pObject[tmpFunctionAddress].apply(pObject, tmpArgumentValues), tmpNewAddress, tmpParentAddress, tmpRootObject); | ||
} | ||
catch(pError) | ||
{ | ||
// The function call failed, so the address doesn't exist | ||
console.log(`Error in getValueAtAddress calling function ${tmpFunctionAddress} (address [${pAddress}]): ${pError.message}`); | ||
return false; | ||
} | ||
} | ||
else | ||
{ | ||
// The function doesn't exist, so the address doesn't exist | ||
console.log(`Function ${tmpFunctionAddress} does not exist (address [${pAddress}])`); | ||
return false; | ||
} | ||
} | ||
@@ -392,0 +464,0 @@ } |
@@ -243,2 +243,3 @@ /** | ||
}, | ||
"BrokenObject": function() { throw new Error('This is a thrown error message!'); }, | ||
"FormatOutput": function () { return `My magic value is: ${this.Value}`; } | ||
@@ -283,2 +284,4 @@ }, | ||
Expect(_Manyfest.getValueAtAddress(_MockObject, 'Behaviors.SillyObject().Stores[0]')).to.equal('Aberdeen'); | ||
Expect(_Manyfest.getValueAtAddress(_MockObject, 'Behaviors.SillyFUNCTIONNOTFOUND().Stores[0]')).to.equal(false); | ||
Expect(_Manyfest.getValueAtAddress(_MockObject, 'Behaviors.BrokenObject().Stores[0]')).to.equal(false); | ||
@@ -285,0 +288,0 @@ fTestComplete(); |
@@ -47,2 +47,4 @@ /** | ||
let tmpFileSizes = _Manyfest.getValueByHash(_SampleDataArchiveOrgFrankenberry, 'FileSizes'); | ||
Expect(Object.keys(tmpFileSizes).length).to.equal(17); | ||
let tmpQuantities = _Manyfest.getValueByHash({cores:[100,300,45,10,1]}, 'cores[]'); | ||
fTestComplete(); | ||
@@ -49,0 +51,0 @@ } |
1190902
0.32%11293
1.02%