/MvcMusicStore/Scripts/MicrosoftAjax.debug.js
JavaScript | 1591 lines | 1352 code | 17 blank | 222 comment | 346 complexity | ac857904e524358569946a8d92bbf63e MD5 | raw file
Large files files are truncated, but you can click here to view the full file
1// Name: MicrosoftAjax.debug.js 2// Assembly: System.Web.Extensions 3// Version: 4.0.0.0 4// FileVersion: 4.0.20526.0 5//----------------------------------------------------------------------- 6// Copyright (C) Microsoft Corporation. All rights reserved. 7//----------------------------------------------------------------------- 8// MicrosoftAjax.js 9// Microsoft AJAX Framework. 10 11Function.__typeName = 'Function'; 12Function.__class = true; 13Function.createCallback = function Function$createCallback(method, context) { 14 /// <summary locid="M:J#Function.createCallback" /> 15 /// <param name="method" type="Function"></param> 16 /// <param name="context" mayBeNull="true"></param> 17 /// <returns type="Function"></returns> 18 var e = Function._validateParams(arguments, [ 19 {name: "method", type: Function}, 20 {name: "context", mayBeNull: true} 21 ]); 22 if (e) throw e; 23 return function() { 24 var l = arguments.length; 25 if (l > 0) { 26 var args = []; 27 for (var i = 0; i < l; i++) { 28 args[i] = arguments[i]; 29 } 30 args[l] = context; 31 return method.apply(this, args); 32 } 33 return method.call(this, context); 34 } 35} 36Function.createDelegate = function Function$createDelegate(instance, method) { 37 /// <summary locid="M:J#Function.createDelegate" /> 38 /// <param name="instance" mayBeNull="true"></param> 39 /// <param name="method" type="Function"></param> 40 /// <returns type="Function"></returns> 41 var e = Function._validateParams(arguments, [ 42 {name: "instance", mayBeNull: true}, 43 {name: "method", type: Function} 44 ]); 45 if (e) throw e; 46 return function() { 47 return method.apply(instance, arguments); 48 } 49} 50Function.emptyFunction = Function.emptyMethod = function Function$emptyMethod() { 51 /// <summary locid="M:J#Function.emptyMethod" /> 52} 53Function.validateParameters = function Function$validateParameters(parameters, expectedParameters, validateParameterCount) { 54 /// <summary locid="M:J#Function.validateParameters" /> 55 /// <param name="parameters"></param> 56 /// <param name="expectedParameters"></param> 57 /// <param name="validateParameterCount" type="Boolean" optional="true"></param> 58 /// <returns type="Error" mayBeNull="true"></returns> 59 var e = Function._validateParams(arguments, [ 60 {name: "parameters"}, 61 {name: "expectedParameters"}, 62 {name: "validateParameterCount", type: Boolean, optional: true} 63 ]); 64 if (e) throw e; 65 return Function._validateParams(parameters, expectedParameters, validateParameterCount); 66} 67Function._validateParams = function Function$_validateParams(params, expectedParams, validateParameterCount) { 68 var e, expectedLength = expectedParams.length; 69 validateParameterCount = validateParameterCount || (typeof(validateParameterCount) === "undefined"); 70 e = Function._validateParameterCount(params, expectedParams, validateParameterCount); 71 if (e) { 72 e.popStackFrame(); 73 return e; 74 } 75 for (var i = 0, l = params.length; i < l; i++) { 76 var expectedParam = expectedParams[Math.min(i, expectedLength - 1)], 77 paramName = expectedParam.name; 78 if (expectedParam.parameterArray) { 79 paramName += "[" + (i - expectedLength + 1) + "]"; 80 } 81 else if (!validateParameterCount && (i >= expectedLength)) { 82 break; 83 } 84 e = Function._validateParameter(params[i], expectedParam, paramName); 85 if (e) { 86 e.popStackFrame(); 87 return e; 88 } 89 } 90 return null; 91} 92Function._validateParameterCount = function Function$_validateParameterCount(params, expectedParams, validateParameterCount) { 93 var i, error, 94 expectedLen = expectedParams.length, 95 actualLen = params.length; 96 if (actualLen < expectedLen) { 97 var minParams = expectedLen; 98 for (i = 0; i < expectedLen; i++) { 99 var param = expectedParams[i]; 100 if (param.optional || param.parameterArray) { 101 minParams--; 102 } 103 } 104 if (actualLen < minParams) { 105 error = true; 106 } 107 } 108 else if (validateParameterCount && (actualLen > expectedLen)) { 109 error = true; 110 for (i = 0; i < expectedLen; i++) { 111 if (expectedParams[i].parameterArray) { 112 error = false; 113 break; 114 } 115 } 116 } 117 if (error) { 118 var e = Error.parameterCount(); 119 e.popStackFrame(); 120 return e; 121 } 122 return null; 123} 124Function._validateParameter = function Function$_validateParameter(param, expectedParam, paramName) { 125 var e, 126 expectedType = expectedParam.type, 127 expectedInteger = !!expectedParam.integer, 128 expectedDomElement = !!expectedParam.domElement, 129 mayBeNull = !!expectedParam.mayBeNull; 130 e = Function._validateParameterType(param, expectedType, expectedInteger, expectedDomElement, mayBeNull, paramName); 131 if (e) { 132 e.popStackFrame(); 133 return e; 134 } 135 var expectedElementType = expectedParam.elementType, 136 elementMayBeNull = !!expectedParam.elementMayBeNull; 137 if (expectedType === Array && typeof(param) !== "undefined" && param !== null && 138 (expectedElementType || !elementMayBeNull)) { 139 var expectedElementInteger = !!expectedParam.elementInteger, 140 expectedElementDomElement = !!expectedParam.elementDomElement; 141 for (var i=0; i < param.length; i++) { 142 var elem = param[i]; 143 e = Function._validateParameterType(elem, expectedElementType, 144 expectedElementInteger, expectedElementDomElement, elementMayBeNull, 145 paramName + "[" + i + "]"); 146 if (e) { 147 e.popStackFrame(); 148 return e; 149 } 150 } 151 } 152 return null; 153} 154Function._validateParameterType = function Function$_validateParameterType(param, expectedType, expectedInteger, expectedDomElement, mayBeNull, paramName) { 155 var e, i; 156 if (typeof(param) === "undefined") { 157 if (mayBeNull) { 158 return null; 159 } 160 else { 161 e = Error.argumentUndefined(paramName); 162 e.popStackFrame(); 163 return e; 164 } 165 } 166 if (param === null) { 167 if (mayBeNull) { 168 return null; 169 } 170 else { 171 e = Error.argumentNull(paramName); 172 e.popStackFrame(); 173 return e; 174 } 175 } 176 if (expectedType && expectedType.__enum) { 177 if (typeof(param) !== 'number') { 178 e = Error.argumentType(paramName, Object.getType(param), expectedType); 179 e.popStackFrame(); 180 return e; 181 } 182 if ((param % 1) === 0) { 183 var values = expectedType.prototype; 184 if (!expectedType.__flags || (param === 0)) { 185 for (i in values) { 186 if (values[i] === param) return null; 187 } 188 } 189 else { 190 var v = param; 191 for (i in values) { 192 var vali = values[i]; 193 if (vali === 0) continue; 194 if ((vali & param) === vali) { 195 v -= vali; 196 } 197 if (v === 0) return null; 198 } 199 } 200 } 201 e = Error.argumentOutOfRange(paramName, param, String.format(Sys.Res.enumInvalidValue, param, expectedType.getName())); 202 e.popStackFrame(); 203 return e; 204 } 205 if (expectedDomElement && (!Sys._isDomElement(param) || (param.nodeType === 3))) { 206 e = Error.argument(paramName, Sys.Res.argumentDomElement); 207 e.popStackFrame(); 208 return e; 209 } 210 if (expectedType && !Sys._isInstanceOfType(expectedType, param)) { 211 e = Error.argumentType(paramName, Object.getType(param), expectedType); 212 e.popStackFrame(); 213 return e; 214 } 215 if (expectedType === Number && expectedInteger) { 216 if ((param % 1) !== 0) { 217 e = Error.argumentOutOfRange(paramName, param, Sys.Res.argumentInteger); 218 e.popStackFrame(); 219 return e; 220 } 221 } 222 return null; 223} 224 225Error.__typeName = 'Error'; 226Error.__class = true; 227Error.create = function Error$create(message, errorInfo) { 228 /// <summary locid="M:J#Error.create" /> 229 /// <param name="message" type="String" optional="true" mayBeNull="true"></param> 230 /// <param name="errorInfo" optional="true" mayBeNull="true"></param> 231 /// <returns type="Error"></returns> 232 var e = Function._validateParams(arguments, [ 233 {name: "message", type: String, mayBeNull: true, optional: true}, 234 {name: "errorInfo", mayBeNull: true, optional: true} 235 ]); 236 if (e) throw e; 237 var err = new Error(message); 238 err.message = message; 239 if (errorInfo) { 240 for (var v in errorInfo) { 241 err[v] = errorInfo[v]; 242 } 243 } 244 err.popStackFrame(); 245 return err; 246} 247Error.argument = function Error$argument(paramName, message) { 248 /// <summary locid="M:J#Error.argument" /> 249 /// <param name="paramName" type="String" optional="true" mayBeNull="true"></param> 250 /// <param name="message" type="String" optional="true" mayBeNull="true"></param> 251 /// <returns></returns> 252 var e = Function._validateParams(arguments, [ 253 {name: "paramName", type: String, mayBeNull: true, optional: true}, 254 {name: "message", type: String, mayBeNull: true, optional: true} 255 ]); 256 if (e) throw e; 257 var displayMessage = "Sys.ArgumentException: " + (message ? message : Sys.Res.argument); 258 if (paramName) { 259 displayMessage += "\n" + String.format(Sys.Res.paramName, paramName); 260 } 261 var err = Error.create(displayMessage, { name: "Sys.ArgumentException", paramName: paramName }); 262 err.popStackFrame(); 263 return err; 264} 265Error.argumentNull = function Error$argumentNull(paramName, message) { 266 /// <summary locid="M:J#Error.argumentNull" /> 267 /// <param name="paramName" type="String" optional="true" mayBeNull="true"></param> 268 /// <param name="message" type="String" optional="true" mayBeNull="true"></param> 269 /// <returns></returns> 270 var e = Function._validateParams(arguments, [ 271 {name: "paramName", type: String, mayBeNull: true, optional: true}, 272 {name: "message", type: String, mayBeNull: true, optional: true} 273 ]); 274 if (e) throw e; 275 var displayMessage = "Sys.ArgumentNullException: " + (message ? message : Sys.Res.argumentNull); 276 if (paramName) { 277 displayMessage += "\n" + String.format(Sys.Res.paramName, paramName); 278 } 279 var err = Error.create(displayMessage, { name: "Sys.ArgumentNullException", paramName: paramName }); 280 err.popStackFrame(); 281 return err; 282} 283Error.argumentOutOfRange = function Error$argumentOutOfRange(paramName, actualValue, message) { 284 /// <summary locid="M:J#Error.argumentOutOfRange" /> 285 /// <param name="paramName" type="String" optional="true" mayBeNull="true"></param> 286 /// <param name="actualValue" optional="true" mayBeNull="true"></param> 287 /// <param name="message" type="String" optional="true" mayBeNull="true"></param> 288 /// <returns></returns> 289 var e = Function._validateParams(arguments, [ 290 {name: "paramName", type: String, mayBeNull: true, optional: true}, 291 {name: "actualValue", mayBeNull: true, optional: true}, 292 {name: "message", type: String, mayBeNull: true, optional: true} 293 ]); 294 if (e) throw e; 295 var displayMessage = "Sys.ArgumentOutOfRangeException: " + (message ? message : Sys.Res.argumentOutOfRange); 296 if (paramName) { 297 displayMessage += "\n" + String.format(Sys.Res.paramName, paramName); 298 } 299 if (typeof(actualValue) !== "undefined" && actualValue !== null) { 300 displayMessage += "\n" + String.format(Sys.Res.actualValue, actualValue); 301 } 302 var err = Error.create(displayMessage, { 303 name: "Sys.ArgumentOutOfRangeException", 304 paramName: paramName, 305 actualValue: actualValue 306 }); 307 err.popStackFrame(); 308 return err; 309} 310Error.argumentType = function Error$argumentType(paramName, actualType, expectedType, message) { 311 /// <summary locid="M:J#Error.argumentType" /> 312 /// <param name="paramName" type="String" optional="true" mayBeNull="true"></param> 313 /// <param name="actualType" type="Type" optional="true" mayBeNull="true"></param> 314 /// <param name="expectedType" type="Type" optional="true" mayBeNull="true"></param> 315 /// <param name="message" type="String" optional="true" mayBeNull="true"></param> 316 /// <returns></returns> 317 var e = Function._validateParams(arguments, [ 318 {name: "paramName", type: String, mayBeNull: true, optional: true}, 319 {name: "actualType", type: Type, mayBeNull: true, optional: true}, 320 {name: "expectedType", type: Type, mayBeNull: true, optional: true}, 321 {name: "message", type: String, mayBeNull: true, optional: true} 322 ]); 323 if (e) throw e; 324 var displayMessage = "Sys.ArgumentTypeException: "; 325 if (message) { 326 displayMessage += message; 327 } 328 else if (actualType && expectedType) { 329 displayMessage += 330 String.format(Sys.Res.argumentTypeWithTypes, actualType.getName(), expectedType.getName()); 331 } 332 else { 333 displayMessage += Sys.Res.argumentType; 334 } 335 if (paramName) { 336 displayMessage += "\n" + String.format(Sys.Res.paramName, paramName); 337 } 338 var err = Error.create(displayMessage, { 339 name: "Sys.ArgumentTypeException", 340 paramName: paramName, 341 actualType: actualType, 342 expectedType: expectedType 343 }); 344 err.popStackFrame(); 345 return err; 346} 347Error.argumentUndefined = function Error$argumentUndefined(paramName, message) { 348 /// <summary locid="M:J#Error.argumentUndefined" /> 349 /// <param name="paramName" type="String" optional="true" mayBeNull="true"></param> 350 /// <param name="message" type="String" optional="true" mayBeNull="true"></param> 351 /// <returns></returns> 352 var e = Function._validateParams(arguments, [ 353 {name: "paramName", type: String, mayBeNull: true, optional: true}, 354 {name: "message", type: String, mayBeNull: true, optional: true} 355 ]); 356 if (e) throw e; 357 var displayMessage = "Sys.ArgumentUndefinedException: " + (message ? message : Sys.Res.argumentUndefined); 358 if (paramName) { 359 displayMessage += "\n" + String.format(Sys.Res.paramName, paramName); 360 } 361 var err = Error.create(displayMessage, { name: "Sys.ArgumentUndefinedException", paramName: paramName }); 362 err.popStackFrame(); 363 return err; 364} 365Error.format = function Error$format(message) { 366 /// <summary locid="M:J#Error.format" /> 367 /// <param name="message" type="String" optional="true" mayBeNull="true"></param> 368 /// <returns></returns> 369 var e = Function._validateParams(arguments, [ 370 {name: "message", type: String, mayBeNull: true, optional: true} 371 ]); 372 if (e) throw e; 373 var displayMessage = "Sys.FormatException: " + (message ? message : Sys.Res.format); 374 var err = Error.create(displayMessage, {name: 'Sys.FormatException'}); 375 err.popStackFrame(); 376 return err; 377} 378Error.invalidOperation = function Error$invalidOperation(message) { 379 /// <summary locid="M:J#Error.invalidOperation" /> 380 /// <param name="message" type="String" optional="true" mayBeNull="true"></param> 381 /// <returns></returns> 382 var e = Function._validateParams(arguments, [ 383 {name: "message", type: String, mayBeNull: true, optional: true} 384 ]); 385 if (e) throw e; 386 var displayMessage = "Sys.InvalidOperationException: " + (message ? message : Sys.Res.invalidOperation); 387 var err = Error.create(displayMessage, {name: 'Sys.InvalidOperationException'}); 388 err.popStackFrame(); 389 return err; 390} 391Error.notImplemented = function Error$notImplemented(message) { 392 /// <summary locid="M:J#Error.notImplemented" /> 393 /// <param name="message" type="String" optional="true" mayBeNull="true"></param> 394 /// <returns></returns> 395 var e = Function._validateParams(arguments, [ 396 {name: "message", type: String, mayBeNull: true, optional: true} 397 ]); 398 if (e) throw e; 399 var displayMessage = "Sys.NotImplementedException: " + (message ? message : Sys.Res.notImplemented); 400 var err = Error.create(displayMessage, {name: 'Sys.NotImplementedException'}); 401 err.popStackFrame(); 402 return err; 403} 404Error.parameterCount = function Error$parameterCount(message) { 405 /// <summary locid="M:J#Error.parameterCount" /> 406 /// <param name="message" type="String" optional="true" mayBeNull="true"></param> 407 /// <returns></returns> 408 var e = Function._validateParams(arguments, [ 409 {name: "message", type: String, mayBeNull: true, optional: true} 410 ]); 411 if (e) throw e; 412 var displayMessage = "Sys.ParameterCountException: " + (message ? message : Sys.Res.parameterCount); 413 var err = Error.create(displayMessage, {name: 'Sys.ParameterCountException'}); 414 err.popStackFrame(); 415 return err; 416} 417Error.prototype.popStackFrame = function Error$popStackFrame() { 418 /// <summary locid="M:J#checkParam" /> 419 if (arguments.length !== 0) throw Error.parameterCount(); 420 if (typeof(this.stack) === "undefined" || this.stack === null || 421 typeof(this.fileName) === "undefined" || this.fileName === null || 422 typeof(this.lineNumber) === "undefined" || this.lineNumber === null) { 423 return; 424 } 425 var stackFrames = this.stack.split("\n"); 426 var currentFrame = stackFrames[0]; 427 var pattern = this.fileName + ":" + this.lineNumber; 428 while(typeof(currentFrame) !== "undefined" && 429 currentFrame !== null && 430 currentFrame.indexOf(pattern) === -1) { 431 stackFrames.shift(); 432 currentFrame = stackFrames[0]; 433 } 434 var nextFrame = stackFrames[1]; 435 if (typeof(nextFrame) === "undefined" || nextFrame === null) { 436 return; 437 } 438 var nextFrameParts = nextFrame.match(/@(.*):(\d+)$/); 439 if (typeof(nextFrameParts) === "undefined" || nextFrameParts === null) { 440 return; 441 } 442 this.fileName = nextFrameParts[1]; 443 this.lineNumber = parseInt(nextFrameParts[2]); 444 stackFrames.shift(); 445 this.stack = stackFrames.join("\n"); 446} 447 448Object.__typeName = 'Object'; 449Object.__class = true; 450Object.getType = function Object$getType(instance) { 451 /// <summary locid="M:J#Object.getType" /> 452 /// <param name="instance"></param> 453 /// <returns type="Type"></returns> 454 var e = Function._validateParams(arguments, [ 455 {name: "instance"} 456 ]); 457 if (e) throw e; 458 var ctor = instance.constructor; 459 if (!ctor || (typeof(ctor) !== "function") || !ctor.__typeName || (ctor.__typeName === 'Object')) { 460 return Object; 461 } 462 return ctor; 463} 464Object.getTypeName = function Object$getTypeName(instance) { 465 /// <summary locid="M:J#Object.getTypeName" /> 466 /// <param name="instance"></param> 467 /// <returns type="String"></returns> 468 var e = Function._validateParams(arguments, [ 469 {name: "instance"} 470 ]); 471 if (e) throw e; 472 return Object.getType(instance).getName(); 473} 474 475String.__typeName = 'String'; 476String.__class = true; 477String.prototype.endsWith = function String$endsWith(suffix) { 478 /// <summary locid="M:J#String.endsWith" /> 479 /// <param name="suffix" type="String"></param> 480 /// <returns type="Boolean"></returns> 481 var e = Function._validateParams(arguments, [ 482 {name: "suffix", type: String} 483 ]); 484 if (e) throw e; 485 return (this.substr(this.length - suffix.length) === suffix); 486} 487String.prototype.startsWith = function String$startsWith(prefix) { 488 /// <summary locid="M:J#String.startsWith" /> 489 /// <param name="prefix" type="String"></param> 490 /// <returns type="Boolean"></returns> 491 var e = Function._validateParams(arguments, [ 492 {name: "prefix", type: String} 493 ]); 494 if (e) throw e; 495 return (this.substr(0, prefix.length) === prefix); 496} 497String.prototype.trim = function String$trim() { 498 /// <summary locid="M:J#String.trim" /> 499 /// <returns type="String"></returns> 500 if (arguments.length !== 0) throw Error.parameterCount(); 501 return this.replace(/^\s+|\s+$/g, ''); 502} 503String.prototype.trimEnd = function String$trimEnd() { 504 /// <summary locid="M:J#String.trimEnd" /> 505 /// <returns type="String"></returns> 506 if (arguments.length !== 0) throw Error.parameterCount(); 507 return this.replace(/\s+$/, ''); 508} 509String.prototype.trimStart = function String$trimStart() { 510 /// <summary locid="M:J#String.trimStart" /> 511 /// <returns type="String"></returns> 512 if (arguments.length !== 0) throw Error.parameterCount(); 513 return this.replace(/^\s+/, ''); 514} 515String.format = function String$format(format, args) { 516 /// <summary locid="M:J#String.format" /> 517 /// <param name="format" type="String"></param> 518 /// <param name="args" parameterArray="true" mayBeNull="true"></param> 519 /// <returns type="String"></returns> 520 var e = Function._validateParams(arguments, [ 521 {name: "format", type: String}, 522 {name: "args", mayBeNull: true, parameterArray: true} 523 ]); 524 if (e) throw e; 525 return String._toFormattedString(false, arguments); 526} 527String._toFormattedString = function String$_toFormattedString(useLocale, args) { 528 var result = ''; 529 var format = args[0]; 530 for (var i=0;;) { 531 var open = format.indexOf('{', i); 532 var close = format.indexOf('}', i); 533 if ((open < 0) && (close < 0)) { 534 result += format.slice(i); 535 break; 536 } 537 if ((close > 0) && ((close < open) || (open < 0))) { 538 if (format.charAt(close + 1) !== '}') { 539 throw Error.argument('format', Sys.Res.stringFormatBraceMismatch); 540 } 541 result += format.slice(i, close + 1); 542 i = close + 2; 543 continue; 544 } 545 result += format.slice(i, open); 546 i = open + 1; 547 if (format.charAt(i) === '{') { 548 result += '{'; 549 i++; 550 continue; 551 } 552 if (close < 0) throw Error.argument('format', Sys.Res.stringFormatBraceMismatch); 553 var brace = format.substring(i, close); 554 var colonIndex = brace.indexOf(':'); 555 var argNumber = parseInt((colonIndex < 0)? brace : brace.substring(0, colonIndex), 10) + 1; 556 if (isNaN(argNumber)) throw Error.argument('format', Sys.Res.stringFormatInvalid); 557 var argFormat = (colonIndex < 0)? '' : brace.substring(colonIndex + 1); 558 var arg = args[argNumber]; 559 if (typeof(arg) === "undefined" || arg === null) { 560 arg = ''; 561 } 562 if (arg.toFormattedString) { 563 result += arg.toFormattedString(argFormat); 564 } 565 else if (useLocale && arg.localeFormat) { 566 result += arg.localeFormat(argFormat); 567 } 568 else if (arg.format) { 569 result += arg.format(argFormat); 570 } 571 else 572 result += arg.toString(); 573 i = close + 1; 574 } 575 return result; 576} 577 578Boolean.__typeName = 'Boolean'; 579Boolean.__class = true; 580Boolean.parse = function Boolean$parse(value) { 581 /// <summary locid="M:J#Boolean.parse" /> 582 /// <param name="value" type="String"></param> 583 /// <returns type="Boolean"></returns> 584 var e = Function._validateParams(arguments, [ 585 {name: "value", type: String} 586 ], false); 587 if (e) throw e; 588 var v = value.trim().toLowerCase(); 589 if (v === 'false') return false; 590 if (v === 'true') return true; 591 throw Error.argumentOutOfRange('value', value, Sys.Res.boolTrueOrFalse); 592} 593 594Date.__typeName = 'Date'; 595Date.__class = true; 596 597Number.__typeName = 'Number'; 598Number.__class = true; 599 600RegExp.__typeName = 'RegExp'; 601RegExp.__class = true; 602 603if (!window) this.window = this; 604window.Type = Function; 605Type.__fullyQualifiedIdentifierRegExp = new RegExp("^[^.0-9 \\s|,;:&*=+\\-()\\[\\]{}^%#@!~\\n\\r\\t\\f\\\\]([^ \\s|,;:&*=+\\-()\\[\\]{}^%#@!~\\n\\r\\t\\f\\\\]*[^. \\s|,;:&*=+\\-()\\[\\]{}^%#@!~\\n\\r\\t\\f\\\\])?$", "i"); 606Type.__identifierRegExp = new RegExp("^[^.0-9 \\s|,;:&*=+\\-()\\[\\]{}^%#@!~\\n\\r\\t\\f\\\\][^. \\s|,;:&*=+\\-()\\[\\]{}^%#@!~\\n\\r\\t\\f\\\\]*$", "i"); 607Type.prototype.callBaseMethod = function Type$callBaseMethod(instance, name, baseArguments) { 608 /// <summary locid="M:J#Type.callBaseMethod" /> 609 /// <param name="instance"></param> 610 /// <param name="name" type="String"></param> 611 /// <param name="baseArguments" type="Array" optional="true" mayBeNull="true" elementMayBeNull="true"></param> 612 /// <returns></returns> 613 var e = Function._validateParams(arguments, [ 614 {name: "instance"}, 615 {name: "name", type: String}, 616 {name: "baseArguments", type: Array, mayBeNull: true, optional: true, elementMayBeNull: true} 617 ]); 618 if (e) throw e; 619 var baseMethod = Sys._getBaseMethod(this, instance, name); 620 if (!baseMethod) throw Error.invalidOperation(String.format(Sys.Res.methodNotFound, name)); 621 if (!baseArguments) { 622 return baseMethod.apply(instance); 623 } 624 else { 625 return baseMethod.apply(instance, baseArguments); 626 } 627} 628Type.prototype.getBaseMethod = function Type$getBaseMethod(instance, name) { 629 /// <summary locid="M:J#Type.getBaseMethod" /> 630 /// <param name="instance"></param> 631 /// <param name="name" type="String"></param> 632 /// <returns type="Function" mayBeNull="true"></returns> 633 var e = Function._validateParams(arguments, [ 634 {name: "instance"}, 635 {name: "name", type: String} 636 ]); 637 if (e) throw e; 638 return Sys._getBaseMethod(this, instance, name); 639} 640Type.prototype.getBaseType = function Type$getBaseType() { 641 /// <summary locid="M:J#Type.getBaseType" /> 642 /// <returns type="Type" mayBeNull="true"></returns> 643 if (arguments.length !== 0) throw Error.parameterCount(); 644 return (typeof(this.__baseType) === "undefined") ? null : this.__baseType; 645} 646Type.prototype.getInterfaces = function Type$getInterfaces() { 647 /// <summary locid="M:J#Type.getInterfaces" /> 648 /// <returns type="Array" elementType="Type" mayBeNull="false" elementMayBeNull="false"></returns> 649 if (arguments.length !== 0) throw Error.parameterCount(); 650 var result = []; 651 var type = this; 652 while(type) { 653 var interfaces = type.__interfaces; 654 if (interfaces) { 655 for (var i = 0, l = interfaces.length; i < l; i++) { 656 var interfaceType = interfaces[i]; 657 if (!Array.contains(result, interfaceType)) { 658 result[result.length] = interfaceType; 659 } 660 } 661 } 662 type = type.__baseType; 663 } 664 return result; 665} 666Type.prototype.getName = function Type$getName() { 667 /// <summary locid="M:J#Type.getName" /> 668 /// <returns type="String"></returns> 669 if (arguments.length !== 0) throw Error.parameterCount(); 670 return (typeof(this.__typeName) === "undefined") ? "" : this.__typeName; 671} 672Type.prototype.implementsInterface = function Type$implementsInterface(interfaceType) { 673 /// <summary locid="M:J#Type.implementsInterface" /> 674 /// <param name="interfaceType" type="Type"></param> 675 /// <returns type="Boolean"></returns> 676 var e = Function._validateParams(arguments, [ 677 {name: "interfaceType", type: Type} 678 ]); 679 if (e) throw e; 680 this.resolveInheritance(); 681 var interfaceName = interfaceType.getName(); 682 var cache = this.__interfaceCache; 683 if (cache) { 684 var cacheEntry = cache[interfaceName]; 685 if (typeof(cacheEntry) !== 'undefined') return cacheEntry; 686 } 687 else { 688 cache = this.__interfaceCache = {}; 689 } 690 var baseType = this; 691 while (baseType) { 692 var interfaces = baseType.__interfaces; 693 if (interfaces) { 694 if (Array.indexOf(interfaces, interfaceType) !== -1) { 695 return cache[interfaceName] = true; 696 } 697 } 698 baseType = baseType.__baseType; 699 } 700 return cache[interfaceName] = false; 701} 702Type.prototype.inheritsFrom = function Type$inheritsFrom(parentType) { 703 /// <summary locid="M:J#Type.inheritsFrom" /> 704 /// <param name="parentType" type="Type"></param> 705 /// <returns type="Boolean"></returns> 706 var e = Function._validateParams(arguments, [ 707 {name: "parentType", type: Type} 708 ]); 709 if (e) throw e; 710 this.resolveInheritance(); 711 var baseType = this.__baseType; 712 while (baseType) { 713 if (baseType === parentType) { 714 return true; 715 } 716 baseType = baseType.__baseType; 717 } 718 return false; 719} 720Type.prototype.initializeBase = function Type$initializeBase(instance, baseArguments) { 721 /// <summary locid="M:J#Type.initializeBase" /> 722 /// <param name="instance"></param> 723 /// <param name="baseArguments" type="Array" optional="true" mayBeNull="true" elementMayBeNull="true"></param> 724 /// <returns></returns> 725 var e = Function._validateParams(arguments, [ 726 {name: "instance"}, 727 {name: "baseArguments", type: Array, mayBeNull: true, optional: true, elementMayBeNull: true} 728 ]); 729 if (e) throw e; 730 if (!Sys._isInstanceOfType(this, instance)) throw Error.argumentType('instance', Object.getType(instance), this); 731 this.resolveInheritance(); 732 if (this.__baseType) { 733 if (!baseArguments) { 734 this.__baseType.apply(instance); 735 } 736 else { 737 this.__baseType.apply(instance, baseArguments); 738 } 739 } 740 return instance; 741} 742Type.prototype.isImplementedBy = function Type$isImplementedBy(instance) { 743 /// <summary locid="M:J#Type.isImplementedBy" /> 744 /// <param name="instance" mayBeNull="true"></param> 745 /// <returns type="Boolean"></returns> 746 var e = Function._validateParams(arguments, [ 747 {name: "instance", mayBeNull: true} 748 ]); 749 if (e) throw e; 750 if (typeof(instance) === "undefined" || instance === null) return false; 751 var instanceType = Object.getType(instance); 752 return !!(instanceType.implementsInterface && instanceType.implementsInterface(this)); 753} 754Type.prototype.isInstanceOfType = function Type$isInstanceOfType(instance) { 755 /// <summary locid="M:J#Type.isInstanceOfType" /> 756 /// <param name="instance" mayBeNull="true"></param> 757 /// <returns type="Boolean"></returns> 758 var e = Function._validateParams(arguments, [ 759 {name: "instance", mayBeNull: true} 760 ]); 761 if (e) throw e; 762 return Sys._isInstanceOfType(this, instance); 763} 764Type.prototype.registerClass = function Type$registerClass(typeName, baseType, interfaceTypes) { 765 /// <summary locid="M:J#Type.registerClass" /> 766 /// <param name="typeName" type="String"></param> 767 /// <param name="baseType" type="Type" optional="true" mayBeNull="true"></param> 768 /// <param name="interfaceTypes" parameterArray="true" type="Type"></param> 769 /// <returns type="Type"></returns> 770 var e = Function._validateParams(arguments, [ 771 {name: "typeName", type: String}, 772 {name: "baseType", type: Type, mayBeNull: true, optional: true}, 773 {name: "interfaceTypes", type: Type, parameterArray: true} 774 ]); 775 if (e) throw e; 776 if (!Type.__fullyQualifiedIdentifierRegExp.test(typeName)) throw Error.argument('typeName', Sys.Res.notATypeName); 777 var parsedName; 778 try { 779 parsedName = eval(typeName); 780 } 781 catch(e) { 782 throw Error.argument('typeName', Sys.Res.argumentTypeName); 783 } 784 if (parsedName !== this) throw Error.argument('typeName', Sys.Res.badTypeName); 785 if (Sys.__registeredTypes[typeName]) throw Error.invalidOperation(String.format(Sys.Res.typeRegisteredTwice, typeName)); 786 if ((arguments.length > 1) && (typeof(baseType) === 'undefined')) throw Error.argumentUndefined('baseType'); 787 if (baseType && !baseType.__class) throw Error.argument('baseType', Sys.Res.baseNotAClass); 788 this.prototype.constructor = this; 789 this.__typeName = typeName; 790 this.__class = true; 791 if (baseType) { 792 this.__baseType = baseType; 793 this.__basePrototypePending = true; 794 } 795 Sys.__upperCaseTypes[typeName.toUpperCase()] = this; 796 if (interfaceTypes) { 797 this.__interfaces = []; 798 this.resolveInheritance(); 799 for (var i = 2, l = arguments.length; i < l; i++) { 800 var interfaceType = arguments[i]; 801 if (!interfaceType.__interface) throw Error.argument('interfaceTypes[' + (i - 2) + ']', Sys.Res.notAnInterface); 802 for (var methodName in interfaceType.prototype) { 803 var method = interfaceType.prototype[methodName]; 804 if (!this.prototype[methodName]) { 805 this.prototype[methodName] = method; 806 } 807 } 808 this.__interfaces.push(interfaceType); 809 } 810 } 811 Sys.__registeredTypes[typeName] = true; 812 return this; 813} 814Type.prototype.registerInterface = function Type$registerInterface(typeName) { 815 /// <summary locid="M:J#Type.registerInterface" /> 816 /// <param name="typeName" type="String"></param> 817 /// <returns type="Type"></returns> 818 var e = Function._validateParams(arguments, [ 819 {name: "typeName", type: String} 820 ]); 821 if (e) throw e; 822 if (!Type.__fullyQualifiedIdentifierRegExp.test(typeName)) throw Error.argument('typeName', Sys.Res.notATypeName); 823 var parsedName; 824 try { 825 parsedName = eval(typeName); 826 } 827 catch(e) { 828 throw Error.argument('typeName', Sys.Res.argumentTypeName); 829 } 830 if (parsedName !== this) throw Error.argument('typeName', Sys.Res.badTypeName); 831 if (Sys.__registeredTypes[typeName]) throw Error.invalidOperation(String.format(Sys.Res.typeRegisteredTwice, typeName)); 832 Sys.__upperCaseTypes[typeName.toUpperCase()] = this; 833 this.prototype.constructor = this; 834 this.__typeName = typeName; 835 this.__interface = true; 836 Sys.__registeredTypes[typeName] = true; 837 return this; 838} 839Type.prototype.resolveInheritance = function Type$resolveInheritance() { 840 /// <summary locid="M:J#Type.resolveInheritance" /> 841 if (arguments.length !== 0) throw Error.parameterCount(); 842 if (this.__basePrototypePending) { 843 var baseType = this.__baseType; 844 baseType.resolveInheritance(); 845 for (var memberName in baseType.prototype) { 846 var memberValue = baseType.prototype[memberName]; 847 if (!this.prototype[memberName]) { 848 this.prototype[memberName] = memberValue; 849 } 850 } 851 delete this.__basePrototypePending; 852 } 853} 854Type.getRootNamespaces = function Type$getRootNamespaces() { 855 /// <summary locid="M:J#Type.getRootNamespaces" /> 856 /// <returns type="Array"></returns> 857 if (arguments.length !== 0) throw Error.parameterCount(); 858 return Array.clone(Sys.__rootNamespaces); 859} 860Type.isClass = function Type$isClass(type) { 861 /// <summary locid="M:J#Type.isClass" /> 862 /// <param name="type" mayBeNull="true"></param> 863 /// <returns type="Boolean"></returns> 864 var e = Function._validateParams(arguments, [ 865 {name: "type", mayBeNull: true} 866 ]); 867 if (e) throw e; 868 if ((typeof(type) === 'undefined') || (type === null)) return false; 869 return !!type.__class; 870} 871Type.isInterface = function Type$isInterface(type) { 872 /// <summary locid="M:J#Type.isInterface" /> 873 /// <param name="type" mayBeNull="true"></param> 874 /// <returns type="Boolean"></returns> 875 var e = Function._validateParams(arguments, [ 876 {name: "type", mayBeNull: true} 877 ]); 878 if (e) throw e; 879 if ((typeof(type) === 'undefined') || (type === null)) return false; 880 return !!type.__interface; 881} 882Type.isNamespace = function Type$isNamespace(object) { 883 /// <summary locid="M:J#Type.isNamespace" /> 884 /// <param name="object" mayBeNull="true"></param> 885 /// <returns type="Boolean"></returns> 886 var e = Function._validateParams(arguments, [ 887 {name: "object", mayBeNull: true} 888 ]); 889 if (e) throw e; 890 if ((typeof(object) === 'undefined') || (object === null)) return false; 891 return !!object.__namespace; 892} 893Type.parse = function Type$parse(typeName, ns) { 894 /// <summary locid="M:J#Type.parse" /> 895 /// <param name="typeName" type="String" mayBeNull="true"></param> 896 /// <param name="ns" optional="true" mayBeNull="true"></param> 897 /// <returns type="Type" mayBeNull="true"></returns> 898 var e = Function._validateParams(arguments, [ 899 {name: "typeName", type: String, mayBeNull: true}, 900 {name: "ns", mayBeNull: true, optional: true} 901 ]); 902 if (e) throw e; 903 var fn; 904 if (ns) { 905 fn = Sys.__upperCaseTypes[ns.getName().toUpperCase() + '.' + typeName.toUpperCase()]; 906 return fn || null; 907 } 908 if (!typeName) return null; 909 if (!Type.__htClasses) { 910 Type.__htClasses = {}; 911 } 912 fn = Type.__htClasses[typeName]; 913 if (!fn) { 914 fn = eval(typeName); 915 if (typeof(fn) !== 'function') throw Error.argument('typeName', Sys.Res.notATypeName); 916 Type.__htClasses[typeName] = fn; 917 } 918 return fn; 919} 920Type.registerNamespace = function Type$registerNamespace(namespacePath) { 921 /// <summary locid="M:J#Type.registerNamespace" /> 922 /// <param name="namespacePath" type="String"></param> 923 var e = Function._validateParams(arguments, [ 924 {name: "namespacePath", type: String} 925 ]); 926 if (e) throw e; 927 Type._registerNamespace(namespacePath); 928} 929Type._registerNamespace = function Type$_registerNamespace(namespacePath) { 930 if (!Type.__fullyQualifiedIdentifierRegExp.test(namespacePath)) throw Error.argument('namespacePath', Sys.Res.invalidNameSpace); 931 var rootObject = window; 932 var namespaceParts = namespacePath.split('.'); 933 for (var i = 0; i < namespaceParts.length; i++) { 934 var currentPart = namespaceParts[i]; 935 var ns = rootObject[currentPart]; 936 var nsType = typeof(ns); 937 if ((nsType !== "undefined") && (ns !== null)) { 938 if (nsType === "function") { 939 throw Error.invalidOperation(String.format(Sys.Res.namespaceContainsClass, namespaceParts.splice(0, i + 1).join('.'))); 940 } 941 if ((typeof(ns) !== "object") || (ns instanceof Array)) { 942 throw Error.invalidOperation(String.format(Sys.Res.namespaceContainsNonObject, namespaceParts.splice(0, i + 1).join('.'))); 943 } 944 } 945 if (!ns) { 946 ns = rootObject[currentPart] = {}; 947 } 948 if (!ns.__namespace) { 949 if ((i === 0) && (namespacePath !== "Sys")) { 950 Sys.__rootNamespaces[Sys.__rootNamespaces.length] = ns; 951 } 952 ns.__namespace = true; 953 ns.__typeName = namespaceParts.slice(0, i + 1).join('.'); 954 var parsedName; 955 try { 956 parsedName = eval(ns.__typeName); 957 } 958 catch(e) { 959 parsedName = null; 960 } 961 if (parsedName !== ns) { 962 delete rootObject[currentPart]; 963 throw Error.argument('namespacePath', Sys.Res.invalidNameSpace); 964 } 965 ns.getName = function ns$getName() {return this.__typeName;} 966 } 967 rootObject = ns; 968 } 969} 970Type._checkDependency = function Type$_checkDependency(dependency, featureName) { 971 var scripts = Type._registerScript._scripts, isDependent = (scripts ? (!!scripts[dependency]) : false); 972 if ((typeof(featureName) !== 'undefined') && !isDependent) { 973 throw Error.invalidOperation(String.format(Sys.Res.requiredScriptReferenceNotIncluded, 974 featureName, dependency)); 975 } 976 return isDependent; 977} 978Type._registerScript = function Type$_registerScript(scriptName, dependencies) { 979 var scripts = Type._registerScript._scripts; 980 if (!scripts) { 981 Type._registerScript._scripts = scripts = {}; 982 } 983 if (scripts[scriptName]) { 984 throw Error.invalidOperation(String.format(Sys.Res.scriptAlreadyLoaded, scriptName)); 985 } 986 scripts[scriptName] = true; 987 if (dependencies) { 988 for (var i = 0, l = dependencies.length; i < l; i++) { 989 var dependency = dependencies[i]; 990 if (!Type._checkDependency(dependency)) { 991 throw Error.invalidOperation(String.format(Sys.Res.scriptDependencyNotFound, scriptName, dependency)); 992 } 993 } 994 } 995} 996Type._registerNamespace("Sys"); 997Sys.__upperCaseTypes = {}; 998Sys.__rootNamespaces = [Sys]; 999Sys.__registeredTypes = {}; 1000Sys._isInstanceOfType = function Sys$_isInstanceOfType(type, instance) { 1001 if (typeof(instance) === "undefined" || instance === null) return false; 1002 if (instance instanceof type) return true; 1003 var instanceType = Object.getType(instance); 1004 return !!(instanceType === type) || 1005 (instanceType.inheritsFrom && instanceType.inheritsFrom(type)) || 1006 (instanceType.implementsInterface && instanceType.implementsInterface(type)); 1007} 1008Sys._getBaseMethod = function Sys$_getBaseMethod(type, instance, name) { 1009 if (!Sys._isInstanceOfType(type, instance)) throw Error.argumentType('instance', Object.getType(instance), type); 1010 var baseType = type.getBaseType(); 1011 if (baseType) { 1012 var baseMethod = baseType.prototype[name]; 1013 return (baseMethod instanceof Function) ? baseMethod : null; 1014 } 1015 return null; 1016} 1017Sys._isDomElement = function Sys$_isDomElement(obj) { 1018 var val = false; 1019 if (typeof (obj.nodeType) !== 'number') { 1020 var doc = obj.ownerDocument || obj.document || obj; 1021 if (doc != obj) { 1022 var w = doc.defaultView || doc.parentWindow; 1023 val = (w != obj); 1024 } 1025 else { 1026 val = (typeof (doc.body) === 'undefined'); 1027 } 1028 } 1029 return !val; 1030} 1031 1032Array.__typeName = 'Array'; 1033Array.__class = true; 1034Array.add = Array.enqueue = function Array$enqueue(array, item) { 1035 /// <summary locid="M:J#Array.enqueue" /> 1036 /// <param name="array" type="Array" elementMayBeNull="true"></param> 1037 /// <param name="item" mayBeNull="true"></param> 1038 var e = Function._validateParams(arguments, [ 1039 {name: "array", type: Array, elementMayBeNull: true}, 1040 {name: "item", mayBeNull: true} 1041 ]); 1042 if (e) throw e; 1043 array[array.length] = item; 1044} 1045Array.addRange = function Array$addRange(array, items) { 1046 /// <summary locid="M:J#Array.addRange" /> 1047 /// <param name="array" type="Array" elementMayBeNull="true"></param> 1048 /// <param name="items" type="Array" elementMayBeNull="true"></param> 1049 var e = Function._validateParams(arguments, [ 1050 {name: "array", type: Array, elementMayBeNull: true}, 1051 {name: "items", type: Array, elementMayBeNull: true} 1052 ]); 1053 if (e) throw e; 1054 array.push.apply(array, items); 1055} 1056Array.clear = function Array$clear(array) { 1057 /// <summary locid="M:J#Array.clear" /> 1058 /// <param name="array" type="Array" elementMayBeNull="true"></param> 1059 var e = Function._validateParams(arguments, [ 1060 {name: "array", type: Array, elementMayBeNull: true} 1061 ]); 1062 if (e) throw e; 1063 array.length = 0; 1064} 1065Array.clone = function Array$clone(array) { 1066 /// <summary locid="M:J#Array.clone" /> 1067 /// <param name="array" type="Array" elementMayBeNull="true"></param> 1068 /// <returns type="Array" elementMayBeNull="true"></returns> 1069 var e = Function._validateParams(arguments, [ 1070 {name: "array", type: Array, elementMayBeNull: true} 1071 ]); 1072 if (e) throw e; 1073 if (array.length === 1) { 1074 return [array[0]]; 1075 } 1076 else { 1077 return Array.apply(null, array); 1078 } 1079} 1080Array.contains = function Array$contains(array, item) { 1081 /// <summary locid="M:J#Array.contains" /> 1082 /// <param name="array" type="Array" elementMayBeNull="true"></param> 1083 /// <param name="item" mayBeNull="true"></param> 1084 /// <returns type="Boolean"></returns> 1085 var e = Function._validateParams(arguments, [ 1086 {name: "array", type: Array, elementMayBeNull: true}, 1087 {name: "item", mayBeNull: true} 1088 ]); 1089 if (e) throw e; 1090 return (Sys._indexOf(array, item) >= 0); 1091} 1092Array.dequeue = function Array$dequeue(array) { 1093 /// <summary locid="M:J#Array.dequeue" /> 1094 /// <param name="array" type="Array" elementMayBeNull="true"></param> 1095 /// <returns mayBeNull="true"></returns> 1096 var e = Function._validateParams(arguments, [ 1097 {name: "array", type: Array, elementMayBeNull: true} 1098 ]); 1099 if (e) throw e; 1100 return array.shift(); 1101} 1102Array.forEach = function Array$forEach(array, method, instance) { 1103 /// <summary locid="M:J#Array.forEach" /> 1104 /// <param name="array" type="Array" elementMayBeNull="true"></param> 1105 /// <param name="method" type="Function"></param> 1106 /// <param name="instance" optional="true" mayBeNull="true"></param> 1107 var e = Function._validateParams(arguments, [ 1108 {name: "array", type: Array, elementMayBeNull: true}, 1109 {name: "method", type: Function}, 1110 {name: "instance", mayBeNull: true, optional: true} 1111 ]); 1112 if (e) throw e; 1113 for (var i = 0, l = array.length; i < l; i++) { 1114 var elt = array[i]; 1115 if (typeof(elt) !== 'undefined') method.call(instance, elt, i, array); 1116 } 1117} 1118Array.indexOf = function Array$indexOf(array, item, start) { 1119 /// <summary locid="M:J#Array.indexOf" /> 1120 /// <param name="array" type="Array" elementMayBeNull="true"></param> 1121 /// <param name="item" optional="true" mayBeNull="true"></param> 1122 /// <param name="start" optional="true" mayBeNull="true"></param> 1123 /// <returns type="Number"></returns> 1124 var e = Function._validateParams(arguments, [ 1125 {name: "array", type: Array, elementMayBeNull: true}, 1126 {name: "item", mayBeNull: true, optional: true}, 1127 {name: "start", mayBeNull: true, optional: true} 1128 ]); 1129 if (e) throw e; 1130 return Sys._indexOf(array, item, start); 1131} 1132Array.insert = function Array$insert(array, index, item) { 1133 /// <summary locid="M:J#Array.insert" /> 1134 /// <param name="array" type="Array" elementMayBeNull="true"></param> 1135 /// <param name="index" mayBeNull="true"></param> 1136 /// <param name="item" mayBeNull="true"></param> 1137 var e = Function._validateParams(arguments, [ 1138 {name: "array", type: Array, elementMayBeNull: true}, 1139 {name: "index", mayBeNull: true}, 1140 {name: "item", mayBeNull: true} 1141 ]); 1142 if (e) throw e; 1143 array.splice(index, 0, item); 1144} 1145Array.parse = function Array$parse(value) { 1146 /// <summary locid="M:J#Array.parse" /> 1147 /// <param name="value" type="String" mayBeNull="true"></param> 1148 /// <returns type="Array" elementMayBeNull="true"></returns> 1149 var e = Function._validateParams(arguments, [ 1150 {name: "value", type: String, mayBeNull: true} 1151 ]); 1152 if (e) throw e; 1153 if (!value) return []; 1154 var v = eval(value); 1155 if (!Array.isInstanceOfType(v)) throw Error.argument('value', Sys.Res.arrayParseBadFormat); 1156 return v; 1157} 1158Array.remove = function Array$remove(array, item) { 1159 /// <summary locid="M:J#Array.remove" /> 1160 /// <param name="array" type="Array" elementMayBeNull="true"></param> 1161 /// <param name="item" mayBeNull="true"></param> 1162 /// <returns type="Boolean"></returns> 1163 var e = Function._validateParams(arguments, [ 1164 {name: "array", type: Array, elementMayBeNull: true}, 1165 {name: "item", mayBeNull: true} 1166 ]); 1167 if (e) throw e; 1168 var index = Sys._indexOf(array, item); 1169 if (index >= 0) { 1170 array.splice(index, 1); 1171 } 1172 return (index >= 0); 1173} 1174Array.removeAt = function Array$removeAt(array, index) { 1175 /// <summary locid="M:J#Array.removeAt" /> 1176 /// <param name="array" type="Array" elementMayBeNull="true"></param> 1177 /// <param name="index" mayBeNull="true"></param> 1178 var e = Function._validateParams(arguments, [ 1179 {name: "array", type: Array, elementMayBeNull: true}, 1180 {name: "index", mayBeNull: true} 1181 ]); 1182 if (e) throw e; 1183 array.splice(index, 1); 1184} 1185Sys._indexOf = function Sys$_indexOf(array, item, start) { 1186 if (typeof(item) === "undefined") return -1; 1187 var length = array.length; 1188 if (length !== 0) { 1189 start = start - 0; 1190 if (isNaN(start)) { 1191 start = 0; 1192 } 1193 else { 1194 if (isFinite(start)) { 1195 start = start - (start % 1); 1196 } 1197 if (start < 0) { 1198 start = Math.max(0, length + start); 1199 } 1200 } 1201 for (var i = start; i < length; i++) { 1202 if ((typeof(array[i]) !== "undefined") && (array[i] === item)) { 1203 return i; 1204 } 1205 } 1206 } 1207 return -1; 1208} 1209Type._registerScript._scripts = { 1210 "MicrosoftAjaxCore.js": true, 1211 "MicrosoftAjaxGlobalization.js": true, 1212 "MicrosoftAjaxSerialization.js": true, 1213 "MicrosoftAjaxComponentModel.js": true, 1214 "MicrosoftAjaxHistory.js": true, 1215 "MicrosoftAjaxNetwork.js" : true, 1216 "MicrosoftAjaxWebServices.js": true }; 1217 1218Sys.IDisposable = function Sys$IDi…
Large files files are truncated, but you can click here to view the full file