EcmaScript源码
1 /** 2 @type {Number} 3 @const 4 */ 5 NaN = 0; 6 /** 7 @type {Number} 8 */ 9 Infinity = 0; 10 undefined = 0; 11 /** 12 @param {*} x 13 @return {Object} 14 */ 15 eval = function(x) {}; 16 /** 17 @param {*} s 18 @param {Number} [radix] 19 @return {Number} 20 */ 21 parseInt = function(s,radix) {}; 22 /** 23 @param {*} x 24 @return {Number} 25 */ 26 parseFloat = function(x) {}; 27 /** 28 @param {Number} x 29 @return {boolean} 30 */ 31 isNaN = function(x) {}; 32 /** 33 @param {Number} x 34 @return {boolean} 35 */ 36 isFinite = function(x) {}; 37 /** 38 @param {string} encodedURI 39 @return {string} 40 */ 41 decodeURI = function(encodedURI) {}; 42 /** 43 @param {string} encodedURIComponent 44 @return {string} 45 */ 46 decodeURIComponent = function(encodedURIComponent) {}; 47 /** 48 @param {string} uri 49 @return {string} 50 */ 51 encodeURI = function(uri) {}; 52 /** 53 @param {string} uriComponent 54 @return {string} 55 */ 56 encodeURIComponent = function(uriComponent) {}; 57 58 /** 59 @type {function} 60 */ 61 Object.constructor = 0; 62 /** 63 @type {Number} 64 */ 65 Object.prototype.length = 0; 66 /** 67 @type {Object} 68 */ 69 Object.prototype.prototype = 0; 70 /** 71 @param {*} [value] 72 @constructor 73 */ 74 function Object(value) {} 75 /** 76 @return {string} 77 */ 78 Object.prototype.toLocaleString = function() {}; 79 /** 80 @param {string} propertyName 81 @return {boolean} 82 */ 83 Object.prototype.hasOwnProperty = function(propertyName) {}; 84 /** 85 @param {Object} o 86 @return {boolean} 87 */ 88 Object.prototype.isPrototypeOf = function(o) {}; 89 /** 90 @param {string} propertyName 91 @return {boolean} 92 */ 93 Object.prototype.propertyIsEnumerable = function(propertyName) {}; 94 /** 95 @return {string} 96 */ 97 Object.prototype.toString = function() {}; 98 /** 99 @return {*} 100 */ 101 Object.prototype.valueOf = function() {}; 102 103 /** 104 @param {...*} [args] 105 @constructor 106 @template T 107 */ 108 function Array(args) {} 109 /** 110 @param {...T|Array.<T>} [items] 111 @return {Array.<T>} 112 */ 113 Array.prototype.concat = function(items) {}; 114 /** 115 @param {string} [separator] 116 @return {string} 117 */ 118 Array.prototype.join = function(separator) {}; 119 /** 120 @return {T} 121 */ 122 Array.prototype.pop = function() {}; 123 /** 124 @param {...T} [items] 125 @return {Number} 126 */ 127 Array.prototype.push = function(items) {}; 128 /** 129 @return {Array.<T>} 130 */ 131 Array.prototype.reverse = function() {}; 132 /** 133 @return {T} 134 */ 135 Array.prototype.shift = function() {}; 136 /** 137 @param {Number} [start] 138 @param {Number} [end] 139 @return {Array.<T>} 140 */ 141 Array.prototype.slice = function(start,end) {}; 142 /** 143 @param {function} [compareFn] 144 @return {Array.<T>} 145 */ 146 Array.prototype.sort = function(compareFn) {}; 147 /** 148 @param {Number} [start] 149 @param {Number} [deleteCount] 150 @param {...T} [items] 151 @return {Array.<T>} 152 */ 153 Array.prototype.splice = function(start,deleteCount,items) {}; 154 /** 155 @param {...T} [items] 156 @return {Number} 157 */ 158 Array.prototype.unshift = function(items) {}; 159 /** 160 @return {Array} 161 */ 162 Array.prototype.valueOf = function() {}; 163 164 /** 165 @param [value] 166 @constructor 167 @return {boolean} 168 */ 169 function Boolean(value) {} 170 /** 171 @return {boolean} 172 */ 173 Boolean.prototype.valueOf = function() {}; 174 175 /** 176 @param {number} year 177 @param {number} month 178 @param {number} [date] 179 @param {number} [hours] 180 @param {number} [minutes] 181 @param {number} [seconds] 182 @param {number} [milliseconds] 183 @static 184 @return {number} 185 */ 186 Date.UTC = function(year,month,date,hours,minutes,seconds,milliseconds) {}; 187 /** 188 @param {string} dateString 189 @static 190 @return {number} 191 */ 192 Date.parse = function(dateString) {}; 193 /** 194 @param {...*} args 195 @constructor 196 */ 197 function Date(args) {} 198 /** 199 @return {number} 200 */ 201 Date.prototype.getDate = function() {}; 202 /** 203 @return {number} 204 */ 205 Date.prototype.getDay = function() {}; 206 /** 207 @return {number} 208 */ 209 Date.prototype.getMonth = function() {}; 210 /** 211 @return {number} 212 */ 213 Date.prototype.getFullYear = function() {}; 214 /** 215 @return {number} 216 */ 217 Date.prototype.getHours = function() {}; 218 /** 219 @return {number} 220 */ 221 Date.prototype.getMilliseconds = function() {}; 222 /** 223 @return {number} 224 */ 225 Date.prototype.getMinutes = function() {}; 226 /** 227 @return {number} 228 */ 229 Date.prototype.getSeconds = function() {}; 230 /** 231 @return {number} 232 */ 233 Date.prototype.getTime = function() {}; 234 /** 235 @return {number} 236 */ 237 Date.prototype.getTimezoneOffset = function() {}; 238 /** 239 @return {number} 240 */ 241 Date.prototype.getUTCDate = function() {}; 242 /** 243 @return {number} 244 */ 245 Date.prototype.getUTCDay = function() {}; 246 /** 247 @return {number} 248 */ 249 Date.prototype.getUTCFullYear = function() {}; 250 /** 251 @return {number} 252 */ 253 Date.prototype.getUTCHours = function() {}; 254 /** 255 @return {number} 256 */ 257 Date.prototype.getUTCMilliseconds = function() {}; 258 /** 259 @return {number} 260 */ 261 Date.prototype.getUTCMinutes = function() {}; 262 /** 263 @return {number} 264 */ 265 Date.prototype.getUTCMonth = function() {}; 266 /** 267 @return {number} 268 */ 269 Date.prototype.getUTCSeconds = function() {}; 270 /** 271 @return {number} 272 */ 273 Date.prototype.getYear = function() {}; 274 /** 275 @param {number} date 276 */ 277 Date.prototype.setDate = function(date) {}; 278 /** 279 @param {number} year 280 @param {number} [month] 281 @param {number} [day] 282 */ 283 Date.prototype.setFullYear = function(year,month,day) {}; 284 /** 285 @param {number} hour 286 @param {number} [min] 287 @param {number} [sec] 288 @param {number} [ms] 289 */ 290 Date.prototype.setHours = function(hour,min,sec,ms) {}; 291 /** 292 @param {number} ms 293 */ 294 Date.prototype.setMilliseconds = function(ms) {}; 295 /** 296 @param {number} min 297 @param {number} [sec] 298 @param {number} [ms] 299 */ 300 Date.prototype.setMinutes = function(min,sec,ms) {}; 301 /** 302 @param {number} month 303 @param {number} [day] 304 */ 305 Date.prototype.setMonth = function(month,day) {}; 306 /** 307 @param {number} sec 308 @param {number} [ms] 309 */ 310 Date.prototype.setSeconds = function(sec,ms) {}; 311 /** 312 @param {number} time 313 */ 314 Date.prototype.setTime = function(time) {}; 315 /** 316 @param {number} date 317 */ 318 Date.prototype.setUTCDate = function(date) {}; 319 /** 320 @param {number} year 321 @param {number} [month] 322 @param {number} [day] 323 */ 324 Date.prototype.setUTCFullYear = function(year,month,day) {}; 325 /** 326 @param {number} hour 327 @param {number} [min] 328 @param {number} [sec] 329 @param {number} [ms] 330 */ 331 Date.prototype.setUTCHours = function(hour,min,sec,ms) {}; 332 /** 333 @param {number} ms 334 */ 335 Date.prototype.setUTCMilliseconds = function(ms) {}; 336 /** 337 @param {number} min 338 @param {number} [sec] 339 @param {number} [ms] 340 */ 341 Date.prototype.setUTCMinutes = function(min,sec,ms) {}; 342 /** 343 @param {number} month 344 @param {number} [day] 345 */ 346 Date.prototype.setUTCMonth = function(month,day) {}; 347 /** 348 @param {number} sec 349 @param {number} [ms] 350 */ 351 Date.prototype.setUTCSeconds = function(sec,ms) {}; 352 /** 353 @param {number} value 354 */ 355 Date.prototype.setYear = function(value) {}; 356 /** 357 @return {string} 358 */ 359 Date.prototype.toDateString = function() {}; 360 /** 361 @return {string} 362 */ 363 Date.prototype.toISOString = function() {}; 364 /** 365 @return {string} 366 */ 367 Date.prototype.toLocaleDateString = function() {}; 368 /** 369 @return {string} 370 */ 371 Date.prototype.toLocaleString = function() {}; 372 /** 373 @return {string} 374 */ 375 Date.prototype.toLocaleTimeString = function() {}; 376 /** 377 @return {string} 378 */ 379 Date.prototype.toTimeString = function() {}; 380 /** 381 @return {string} 382 */ 383 Date.prototype.toUTCString = function() {}; 384 385 /** 386 @type {function} 387 */ 388 Arguments.prototype.callee = 0; 389 /** 390 @type {function} 391 @const 392 @deprecated 393 */ 394 Arguments.prototype.caller = 0; 395 Arguments.prototype = new Array(); 396 Arguments = {}; 397 398 /** 399 @type {Arguments} 400 @const 401 */ 402 Function.prototype.arguments = 0; 403 /** 404 @type {Number} 405 @const 406 */ 407 Function.prototype.arity = 0; 408 /** 409 @param {Object} [thisArg] 410 @param {Array} [argArray] 411 @return {*} 412 */ 413 Function.prototype.apply = function(thisArg,argArray) {}; 414 /** 415 @param {Object} [thisArg] 416 @param {...*} [args] 417 @return {*} 418 */ 419 Function.prototype.call = function(thisArg,args) {}; 420 Function = {}; 421 422 /** 423 @static 424 @type {number} 425 @const 426 */ 427 Math.E = 0; 428 /** 429 @static 430 @type {number} 431 @const 432 */ 433 Math.LN10 = 0; 434 /** 435 @static 436 @type {number} 437 @const 438 */ 439 Math.LN2 = 0; 440 /** 441 @static 442 @type {number} 443 @const 444 */ 445 Math.LOG10E = 0; 446 /** 447 @static 448 @type {number} 449 @const 450 */ 451 Math.LOG2E = 0; 452 /** 453 @static 454 @type {number} 455 @const 456 */ 457 Math.PI = 0; 458 /** 459 @static 460 @type {number} 461 @const 462 */ 463 Math.SQRT1_2 = 0; 464 /** 465 @static 466 @type {number} 467 @const 468 */ 469 Math.SQRT2 = 0; 470 /** 471 @param {number} x 472 @static 473 @return {number} 474 */ 475 Math.abs = function(x) {}; 476 /** 477 @param {number} x 478 @static 479 @return {number} 480 */ 481 Math.acos = function(x) {}; 482 /** 483 @param {number} x 484 @static 485 @return {number} 486 */ 487 Math.asin = function(x) {}; 488 /** 489 @param {number} x 490 @static 491 @return {number} 492 */ 493 Math.atan = function(x) {}; 494 /** 495 @param {number} x 496 @param {number} y 497 @static 498 @return {number} 499 */ 500 Math.atan2 = function(x,y) {}; 501 /** 502 @param {number} x 503 @static 504 @return {number} 505 */ 506 Math.ceil = function(x) {}; 507 /** 508 @param {number} x 509 @static 510 @return {number} 511 */ 512 Math.cos = function(x) {}; 513 /** 514 @param {number} x 515 @static 516 @return {number} 517 */ 518 Math.exp = function(x) {}; 519 /** 520 @param {number} x 521 @static 522 @return {number} 523 */ 524 Math.floor = function(x) {}; 525 /** 526 @param {number} x 527 @static 528 @return {number} 529 */ 530 Math.log = function(x) {}; 531 /** 532 @param {...number} x 533 @static 534 @return {number} 535 */ 536 Math.max = function(x) {}; 537 /** 538 @param {...number} x 539 @static 540 @return {number} 541 */ 542 Math.min = function(x) {}; 543 /** 544 @param {number} x 545 @param {number} y 546 @static 547 @return {number} 548 */ 549 Math.pow = function(x,y) {}; 550 /** 551 @static 552 @return {number} 553 */ 554 Math.random = function() {}; 555 /** 556 @param {number} x 557 @static 558 @return {number} 559 */ 560 Math.round = function(x) {}; 561 /** 562 @param {number} x 563 @static 564 @return {number} 565 */ 566 Math.sin = function(x) {}; 567 /** 568 @param {number} x 569 @static 570 @return {number} 571 */ 572 Math.sqrt = function(x) {}; 573 /** 574 @param {number} x 575 @static 576 @return {number} 577 */ 578 Math.tan = function(x) {}; 579 Math = {}; 580 581 /** 582 @static 583 @type {Number} 584 @const 585 */ 586 Number.MAX_VALUE = 0; 587 /** 588 @static 589 @type {Number} 590 @const 591 */ 592 Number.MIN_VALUE = 0; 593 /** 594 @static 595 @type {Number} 596 @const 597 */ 598 Number.NaN = 0; 599 /** 600 @static 601 @type {Number} 602 @const 603 */ 604 Number.NEGATIVE_INFINITY = 0; 605 /** 606 @static 607 @type {Number} 608 @const 609 */ 610 Number.POSITIVE_INFINITY = 0; 611 /** 612 @param [value] 613 @constructor 614 @return {number} 615 */ 616 function Number(value) {} 617 /** 618 @param {Number} [fractionalDigits] 619 @return {string} 620 */ 621 Number.prototype.toExponential = function(fractionalDigits) {}; 622 /** 623 @param {Number} [fractionalDigits] 624 @return {string} 625 */ 626 Number.prototype.toFixed = function(fractionalDigits) {}; 627 /** 628 @param {Number} [precision] 629 @return {string} 630 */ 631 Number.prototype.toPrecision = function(precision) {}; 632 /** 633 @param {Number} [radix] 634 @return {string} 635 */ 636 Number.prototype.toString = function(radix) {}; 637 /** 638 @return {Number} 639 */ 640 Number.prototype.valueOf = function() {}; 641 642 /** 643 @static 644 @type {string} 645 @const 646 */ 647 RegExp.leftContext = null; 648 /** 649 @static 650 @type {string} 651 @const 652 */ 653 RegExp.input = null; 654 /** 655 @static 656 @type {string} 657 @const 658 */ 659 RegExp.lastParen = null; 660 /** 661 @static 662 @type {string} 663 @const 664 */ 665 RegExp.lastMatch = null; 666 /** 667 @static 668 @type {string} 669 @const 670 */ 671 RegExp.rightContext = null; 672 /** 673 @static 674 @type {string} 675 @const 676 */ 677 RegExp.$1 = null; 678 /** 679 @static 680 @type {string} 681 @const 682 */ 683 RegExp.$2 = null; 684 /** 685 @static 686 @type {string} 687 @const 688 */ 689 RegExp.$3 = null; 690 /** 691 @static 692 @type {string} 693 @const 694 */ 695 RegExp.$4 = null; 696 /** 697 @static 698 @type {string} 699 @const 700 */ 701 RegExp.$5 = null; 702 /** 703 @type {boolean} 704 @const 705 */ 706 RegExp.prototype.global = 0; 707 /** 708 @type {boolean} 709 @const 710 */ 711 RegExp.prototype.ignoreCase = 0; 712 /** 713 @type {Number} 714 */ 715 RegExp.prototype.lastIndex = 0; 716 /** 717 @type {boolean} 718 */ 719 RegExp.prototype.multiline = 0; 720 /** 721 @type {string} 722 */ 723 RegExp.prototype.source = null; 724 /** 725 @param {string} [pattern] 726 @param {string} [options] 727 @constructor 728 */ 729 function RegExp(pattern,options) {} 730 /** 731 @param {string} [String] 732 @return {Array|{index:number, input:string}} 733 */ 734 RegExp.prototype.exec = function(String) {}; 735 /** 736 @param {string} [String] 737 @return {boolean} 738 */ 739 RegExp.prototype.test = function(String) {}; 740 741 /** 742 @param {...Number} [chars] 743 @static 744 @return {string} 745 */ 746 String.fromCharCode = function(chars) {}; 747 /** 748 @param [value] 749 @constructor 750 @return {string} 751 */ 752 function String(value) {} 753 /** 754 @param {string} [nameAttribute] 755 @return {string} 756 */ 757 String.prototype.anchor = function(nameAttribute) {}; 758 /** 759 @return {string} 760 */ 761 String.prototype.big = function() {}; 762 /** 763 @return {string} 764 */ 765 String.prototype.blink = function() {}; 766 /** 767 @return {string} 768 */ 769 String.prototype.bold = function() {}; 770 /** 771 @param {Number} pos 772 @return {string} 773 */ 774 String.prototype.charAt = function(pos) {}; 775 /** 776 @return {Number} 777 */ 778 String.prototype.charCodeAt = function(index) {}; 779 /** 780 @param {...string} [strings] 781 @return {string} 782 */ 783 String.prototype.concat = function(strings) {}; 784 /** 785 @return {string} 786 */ 787 String.prototype.fixed = function() {}; 788 /** 789 @param {string} color 790 @return {string} 791 */ 792 String.prototype.fontcolor = function(color) {}; 793 /** 794 @param {Number} size 795 @return {string} 796 */ 797 String.prototype.fontsize = function(size) {}; 798 /** 799 @param {string} searchString 800 @param {Number} [position] 801 @return {Number} 802 */ 803 String.prototype.indexOf = function(searchString,position) {}; 804 /** 805 @return {string} 806 */ 807 String.prototype.italics = function() {}; 808 /** 809 @param {string} searchString 810 @param {Number} [position] 811 @return {Number} 812 */ 813 String.prototype.lastIndexOf = function(searchString,position) {}; 814 /** 815 @param {string} href 816 @return {string} 817 */ 818 String.prototype.link = function(href) {}; 819 /** 820 @param {string} that 821 @return {boolean} 822 */ 823 String.prototype.localeCompare = function(that) {}; 824 /** 825 @param {RegExp} regexp 826 @return {Array|{index:number, input:string}} 827 */ 828 String.prototype.match = function(regexp) {}; 829 /** 830 @param {RegExp|string} searchValue 831 @param {string|function} replaceValue 832 @return {string} 833 */ 834 String.prototype.replace = function(searchValue,replaceValue) {}; 835 /** 836 @param {*} regexp 837 @return {Number} 838 */ 839 String.prototype.search = function(regexp) {}; 840 /** 841 @param {Number} start 842 @param {Number} [end] 843 @return {string} 844 */ 845 String.prototype.slice = function(start,end) {}; 846 /** 847 @return {string} 848 */ 849 String.prototype.small = function() {}; 850 /** 851 @param {*} separator 852 @param {Number} [limit] 853 @return {Array} 854 */ 855 String.prototype.split = function(separator,limit) {}; 856 /** 857 @return {string} 858 */ 859 String.prototype.strike = function() {}; 860 /** 861 @return {string} 862 */ 863 String.prototype.sub = function() {}; 864 /** 865 @param {Number} start 866 @param {Number} [length] 867 @return {string} 868 */ 869 String.prototype.substr = function(start,length) {}; 870 /** 871 @param {Number} start 872 @param {Number} [end] 873 @return {string} 874 */ 875 String.prototype.substring = function(start,end) {}; 876 /** 877 @return {string} 878 */ 879 String.prototype.sup = function() {}; 880 /** 881 @return {string} 882 */ 883 String.prototype.toLowerCase = function() {}; 884 /** 885 @return {string} 886 */ 887 String.prototype.toLocaleLowerCase = function() {}; 888 /** 889 @return {string} 890 */ 891 String.prototype.toLocaleUpperCase = function() {}; 892 /** 893 @return {string} 894 */ 895 String.prototype.toUpperCase = function() {}; 896 /** 897 @return {string} 898 */ 899 String.prototype.valueOf = function() {}; 900 901 /** 902 @type {string} 903 */ 904 Error.prototype.name = null; 905 /** 906 @type {string} 907 */ 908 Error.prototype.message = null; 909 /** 910 @param {*} [msg] 911 @param {*} [id] 912 @constructor 913 */ 914 function Error(msg,id) {} 915 916 EvalError.prototype = new Error(); 917 EvalError = {}; 918 919 RangeError.prototype = new Error(); 920 RangeError = {}; 921 922 ReferenceError.prototype = new Error(); 923 ReferenceError = {}; 924 925 SyntaxError.prototype = new Error(); 926 SyntaxError = {}; 927 928 TypeError.prototype = new Error(); 929 TypeError = {}; 930 931 URIError.prototype = new Error(); 932 URIError = {};