fable 3.0.136 → 3.0.137
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/fable.compatible.js
CHANGED
|
@@ -919,10 +919,15 @@ if(!_typeof(pObject[_tmpFunctionAddress])=='function'){// The address suggests i
|
|
|
919
919
|
return false;}// Now see if the function has arguments.
|
|
920
920
|
// Implementation notes: * ARGUMENTS MUST SHARE THE SAME ROOT OBJECT CONTEXT *
|
|
921
921
|
var tmpFunctionArguments=_MockFable.DataFormat.stringGetSegments(_MockFable.DataFormat.stringGetEnclosureValueByIndex(tmpSubObjectName.substring(_tmpFunctionAddress.length),0),',');if(tmpFunctionArguments.length==0||tmpFunctionArguments[0]==''){// No arguments... just call the function (bound to the scope of the object it is contained withing)
|
|
922
|
-
return this.checkAddressExists(pObject[_tmpFunctionAddress].apply(pObject),tmpNewAddress,tmpRootObject);}
|
|
922
|
+
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
|
|
923
|
+
libSimpleLog.log("Error calling function ".concat(_tmpFunctionAddress," (address [").concat(pAddress,"]): ").concat(pError.message));return false;}}else{// The function doesn't exist, so the address doesn't exist
|
|
924
|
+
libSimpleLog.log("Function ".concat(_tmpFunctionAddress," does not exist (address [").concat(pAddress,"])"));return false;}}else{var tmpArgumentValues=[];var _tmpRootObject=typeof pRootObject=='undefined'?pObject:pRootObject;// Now get the value for each argument
|
|
923
925
|
for(var i=0;i<tmpFunctionArguments.length;i++){// Resolve the values for each subsequent entry
|
|
924
926
|
// NOTE: This is where the resolves get really tricky. Recursion within recursion. Programming gom jabbar, yo.
|
|
925
|
-
tmpArgumentValues.push(this.getObjectValueClass.getValueAtAddress(_tmpRootObject,tmpFunctionArguments[i]));}return this.checkAddressExists(pObject[
|
|
927
|
+
tmpArgumentValues.push(this.getObjectValueClass.getValueAtAddress(_tmpRootObject,tmpFunctionArguments[i]));}//return this.checkAddressExists(pObject[tmpFunctionAddress].apply(pObject, tmpArgumentValues), tmpNewAddress, tmpRootObject);
|
|
928
|
+
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
|
|
929
|
+
libSimpleLog.log("Error calling function ".concat(_tmpFunctionAddress," (address [").concat(pAddress,"]): ").concat(pError.message));return false;}}else{// The function doesn't exist, so the address doesn't exist
|
|
930
|
+
libSimpleLog.log("Function ".concat(_tmpFunctionAddress," does not exist (address [").concat(pAddress,"])"));return false;}}}// Boxed elements look like this:
|
|
926
931
|
// MyValues[42]
|
|
927
932
|
// MyValues['Color']
|
|
928
933
|
// MyValues["Weight"]
|
|
@@ -1147,12 +1152,16 @@ if(tmpFunctionStartIndex>0// 2) The end bracket is after the start bracket
|
|
|
1147
1152
|
return false;}// Now see if the function has arguments.
|
|
1148
1153
|
// Implementation notes: * ARGUMENTS MUST SHARE THE SAME ROOT OBJECT CONTEXT *
|
|
1149
1154
|
var tmpFunctionArguments=_MockFable.DataFormat.stringGetSegments(_MockFable.DataFormat.stringGetEnclosureValueByIndex(pAddress.substring(tmpFunctionAddress.length),0),',');if(tmpFunctionArguments.length==0||tmpFunctionArguments[0]==''){// No arguments... just call the function (bound to the scope of the object it is contained withing)
|
|
1150
|
-
return pObject[tmpFunctionAddress].apply(pObject);}
|
|
1155
|
+
if(tmpFunctionAddress in pObject){try{return pObject[tmpFunctionAddress].apply(pObject);}catch(pError){// The function call failed, so the address doesn't exist
|
|
1156
|
+
console.log("Error in getValueAtAddress calling function ".concat(tmpFunctionAddress," (address [").concat(pAddress,"]): ").concat(pError.message));return false;}}else{// The function doesn't exist, so the address doesn't exist
|
|
1157
|
+
console.log("Function ".concat(tmpFunctionAddress," does not exist (address [").concat(pAddress,"])"));return false;}}else{var tmpArgumentValues=[];var _tmpRootObject2=typeof pRootObject=='undefined'?pObject:pRootObject;// Now get the value for each argument
|
|
1151
1158
|
for(var _i4=0;_i4<tmpFunctionArguments.length;_i4++){// Resolve the values for each subsequent entry
|
|
1152
1159
|
// Check if the argument value is a string literal or a reference to an address
|
|
1153
1160
|
if(tmpFunctionArguments[_i4].length>=2&&(tmpFunctionArguments[_i4].charAt(0)=='"'||tmpFunctionArguments[_i4].charAt(0)=="'"||tmpFunctionArguments[_i4].charAt(0)=="`")&&(tmpFunctionArguments[_i4].charAt(tmpFunctionArguments[_i4].length-1)=='"'||tmpFunctionArguments[_i4].charAt(tmpFunctionArguments[_i4].length-1)=="'"||tmpFunctionArguments[_i4].charAt(tmpFunctionArguments[_i4].length-1)=="`")){// This is a string literal
|
|
1154
1161
|
tmpArgumentValues.push(tmpFunctionArguments[_i4].substring(1,tmpFunctionArguments[_i4].length-1));}else{// This is a hash address
|
|
1155
|
-
tmpArgumentValues.push(this.getValueAtAddress(_tmpRootObject2,tmpFunctionArguments[_i4]));}}return pObject[tmpFunctionAddress].apply(pObject,tmpArgumentValues);}
|
|
1162
|
+
tmpArgumentValues.push(this.getValueAtAddress(_tmpRootObject2,tmpFunctionArguments[_i4]));}}if(tmpFunctionAddress in pObject){try{return pObject[tmpFunctionAddress].apply(pObject,tmpArgumentValues);}catch(pError){// The function call failed, so the address doesn't exist
|
|
1163
|
+
console.log("Error in getValueAtAddress calling function ".concat(tmpFunctionAddress," (address [").concat(pAddress,"]): ").concat(pError.message));return false;}}else{// The function doesn't exist, so the address doesn't exist
|
|
1164
|
+
console.log("Function ".concat(tmpFunctionAddress," does not exist (address [").concat(pAddress,"])"));return false;}}}// Boxed elements look like this:
|
|
1156
1165
|
// MyValues[10]
|
|
1157
1166
|
// MyValues['Name']
|
|
1158
1167
|
// MyValues["Age"]
|
|
@@ -1210,12 +1219,16 @@ if(_tmpFunctionStartIndex2>0// 2) The end bracket is after the start bracket
|
|
|
1210
1219
|
return false;}// Now see if the function has arguments.
|
|
1211
1220
|
// Implementation notes: * ARGUMENTS MUST SHARE THE SAME ROOT OBJECT CONTEXT *
|
|
1212
1221
|
var _tmpFunctionArguments=_MockFable.DataFormat.stringGetSegments(_MockFable.DataFormat.stringGetEnclosureValueByIndex(tmpSubObjectName.substring(_tmpFunctionAddress2.length),0),',');if(_tmpFunctionArguments.length==0||_tmpFunctionArguments[0]==''){// No arguments... just call the function (bound to the scope of the object it is contained withing)
|
|
1213
|
-
return this.getValueAtAddress(pObject[_tmpFunctionAddress2].apply(pObject),tmpNewAddress,tmpParentAddress,tmpRootObject);}
|
|
1222
|
+
if(_tmpFunctionAddress2 in pObject){try{return this.getValueAtAddress(pObject[_tmpFunctionAddress2].apply(pObject),tmpNewAddress,tmpParentAddress,tmpRootObject);}catch(pError){// The function call failed, so the address doesn't exist
|
|
1223
|
+
console.log("Error in getValueAtAddress calling function ".concat(_tmpFunctionAddress2," (address [").concat(pAddress,"]): ").concat(pError.message));return false;}}else{// The function doesn't exist, so the address doesn't exist
|
|
1224
|
+
console.log("Function ".concat(_tmpFunctionAddress2," does not exist (address [").concat(pAddress,"])"));return false;}}else{var _tmpArgumentValues=[];var _tmpRootObject3=typeof pRootObject=='undefined'?pObject:pRootObject;// Now get the value for each argument
|
|
1214
1225
|
for(var _i6=0;_i6<_tmpFunctionArguments.length;_i6++){// Resolve the values for each subsequent entry
|
|
1215
1226
|
// Check if the argument value is a string literal or a reference to an address
|
|
1216
1227
|
if(_tmpFunctionArguments[_i6].length>=2&&(_tmpFunctionArguments[_i6].charAt(0)=='"'||_tmpFunctionArguments[_i6].charAt(0)=="'"||_tmpFunctionArguments[_i6].charAt(0)=="`")&&(_tmpFunctionArguments[_i6].charAt(_tmpFunctionArguments[_i6].length-1)=='"'||_tmpFunctionArguments[_i6].charAt(_tmpFunctionArguments[_i6].length-1)=="'"||_tmpFunctionArguments[_i6].charAt(_tmpFunctionArguments[_i6].length-1)=="`")){// This is a string literal
|
|
1217
1228
|
_tmpArgumentValues.push(_tmpFunctionArguments[_i6].substring(1,_tmpFunctionArguments[_i6].length-1));}else{// This is a hash address
|
|
1218
|
-
_tmpArgumentValues.push(this.getValueAtAddress(_tmpRootObject3,_tmpFunctionArguments[_i6]));}}return this.getValueAtAddress(pObject[_tmpFunctionAddress2].apply(pObject,_tmpArgumentValues),tmpNewAddress,tmpParentAddress,_tmpRootObject3);}
|
|
1229
|
+
_tmpArgumentValues.push(this.getValueAtAddress(_tmpRootObject3,_tmpFunctionArguments[_i6]));}}if(_tmpFunctionAddress2 in pObject){try{return this.getValueAtAddress(pObject[_tmpFunctionAddress2].apply(pObject,_tmpArgumentValues),tmpNewAddress,tmpParentAddress,_tmpRootObject3);}catch(pError){// The function call failed, so the address doesn't exist
|
|
1230
|
+
console.log("Error in getValueAtAddress calling function ".concat(_tmpFunctionAddress2," (address [").concat(pAddress,"]): ").concat(pError.message));return false;}}else{// The function doesn't exist, so the address doesn't exist
|
|
1231
|
+
console.log("Function ".concat(_tmpFunctionAddress2," does not exist (address [").concat(pAddress,"])"));return false;}}}// Boxed elements look like this:
|
|
1219
1232
|
// MyValues[42]
|
|
1220
1233
|
// MyValues['Color']
|
|
1221
1234
|
// MyValues["Weight"]
|