mirror of
https://github.com/Ylianst/MeshAgent
synced 2025-12-15 15:53:55 +00:00
Updated so if getParameter() is already defined, it will ignore redefinition
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -15,8 +15,9 @@ See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
Object.defineProperty(Array.prototype, 'getParameterEx',
|
||||
try
|
||||
{
|
||||
Object.defineProperty(Array.prototype, 'getParameterEx',
|
||||
{
|
||||
value: function (name, defaultValue)
|
||||
{
|
||||
@@ -33,14 +34,19 @@ Object.defineProperty(Array.prototype, 'getParameterEx',
|
||||
return (defaultValue);
|
||||
}
|
||||
});
|
||||
Object.defineProperty(Array.prototype, 'getParameter',
|
||||
Object.defineProperty(Array.prototype, 'getParameter',
|
||||
{
|
||||
value: function (name, defaultValue)
|
||||
{
|
||||
return (this.getParameterEx('--' + name, defaultValue));
|
||||
}
|
||||
});
|
||||
Object.defineProperty(Array.prototype, 'getParameterIndex',
|
||||
}
|
||||
catch(x)
|
||||
{ }
|
||||
try
|
||||
{
|
||||
Object.defineProperty(Array.prototype, 'getParameterIndex',
|
||||
{
|
||||
value: function (name)
|
||||
{
|
||||
@@ -55,7 +61,12 @@ Object.defineProperty(Array.prototype, 'getParameterIndex',
|
||||
return (-1);
|
||||
}
|
||||
});
|
||||
Object.defineProperty(Array.prototype, 'deleteParameter',
|
||||
}
|
||||
catch(x)
|
||||
{ }
|
||||
try
|
||||
{
|
||||
Object.defineProperty(Array.prototype, 'deleteParameter',
|
||||
{
|
||||
value: function (name)
|
||||
{
|
||||
@@ -66,7 +77,12 @@ Object.defineProperty(Array.prototype, 'deleteParameter',
|
||||
}
|
||||
}
|
||||
});
|
||||
Object.defineProperty(Array.prototype, 'getParameterValue',
|
||||
}
|
||||
catch(x)
|
||||
{ }
|
||||
try
|
||||
{
|
||||
Object.defineProperty(Array.prototype, 'getParameterValue',
|
||||
{
|
||||
value: function (i)
|
||||
{
|
||||
@@ -75,6 +91,9 @@ Object.defineProperty(Array.prototype, 'getParameterValue',
|
||||
return (ret);
|
||||
}
|
||||
});
|
||||
}
|
||||
catch(x)
|
||||
{ }
|
||||
|
||||
function checkParameters(parms)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user