2
0

uglify-hangs2.js 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. jsworld.Locale = function(properties) {
  2. // LC_NUMERIC
  3. this.frac_digits = properties.frac_digits;
  4. // may be empty string/null for currencies with no fractional part
  5. if (properties.mon_decimal_point === null || properties.mon_decimal_point == "") {
  6. if (this.frac_digits > 0)
  7. throw "Error: Undefined mon_decimal_point property";
  8. else
  9. properties.mon_decimal_point = "";
  10. }
  11. if (typeof properties.mon_decimal_point != "string")
  12. throw "Error: Invalid/missing mon_decimal_point property";
  13. this.mon_decimal_point = properties.mon_decimal_point;
  14. if (typeof properties.mon_thousands_sep != "string")
  15. throw "Error: Invalid/missing mon_thousands_sep property";
  16. this.mon_thousands_sep = properties.mon_thousands_sep;
  17. if (typeof properties.mon_grouping != "string")
  18. throw "Error: Invalid/missing mon_grouping property";
  19. this.mon_grouping = properties.mon_grouping;
  20. if (typeof properties.positive_sign != "string")
  21. throw "Error: Invalid/missing positive_sign property";
  22. this.positive_sign = properties.positive_sign;
  23. if (typeof properties.negative_sign != "string")
  24. throw "Error: Invalid/missing negative_sign property";
  25. this.negative_sign = properties.negative_sign;
  26. if (properties.p_cs_precedes !== 0 && properties.p_cs_precedes !== 1)
  27. throw "Error: Invalid/missing p_cs_precedes property, must be 0 or 1";
  28. this.p_cs_precedes = properties.p_cs_precedes;
  29. if (properties.n_cs_precedes !== 0 && properties.n_cs_precedes !== 1)
  30. throw "Error: Invalid/missing n_cs_precedes, must be 0 or 1";
  31. this.n_cs_precedes = properties.n_cs_precedes;
  32. if (properties.p_sep_by_space !== 0 &&
  33. properties.p_sep_by_space !== 1 &&
  34. properties.p_sep_by_space !== 2)
  35. throw "Error: Invalid/missing p_sep_by_space property, must be 0, 1 or 2";
  36. this.p_sep_by_space = properties.p_sep_by_space;
  37. if (properties.n_sep_by_space !== 0 &&
  38. properties.n_sep_by_space !== 1 &&
  39. properties.n_sep_by_space !== 2)
  40. throw "Error: Invalid/missing n_sep_by_space property, must be 0, 1, or 2";
  41. this.n_sep_by_space = properties.n_sep_by_space;
  42. if (properties.p_sign_posn !== 0 &&
  43. properties.p_sign_posn !== 1 &&
  44. properties.p_sign_posn !== 2 &&
  45. properties.p_sign_posn !== 3 &&
  46. properties.p_sign_posn !== 4)
  47. throw "Error: Invalid/missing p_sign_posn property, must be 0, 1, 2, 3 or 4";
  48. this.p_sign_posn = properties.p_sign_posn;
  49. if (properties.n_sign_posn !== 0 &&
  50. properties.n_sign_posn !== 1 &&
  51. properties.n_sign_posn !== 2 &&
  52. properties.n_sign_posn !== 3 &&
  53. properties.n_sign_posn !== 4)
  54. throw "Error: Invalid/missing n_sign_posn property, must be 0, 1, 2, 3 or 4";
  55. this.n_sign_posn = properties.n_sign_posn;
  56. if (typeof properties.int_frac_digits != "number" && properties.int_frac_digits < 0)
  57. throw "Error: Invalid/missing int_frac_digits property";
  58. this.int_frac_digits = properties.int_frac_digits;
  59. if (properties.int_p_cs_precedes !== 0 && properties.int_p_cs_precedes !== 1)
  60. throw "Error: Invalid/missing int_p_cs_precedes property, must be 0 or 1";
  61. this.int_p_cs_precedes = properties.int_p_cs_precedes;
  62. if (properties.int_n_cs_precedes !== 0 && properties.int_n_cs_precedes !== 1)
  63. throw "Error: Invalid/missing int_n_cs_precedes property, must be 0 or 1";
  64. this.int_n_cs_precedes = properties.int_n_cs_precedes;
  65. if (properties.int_p_sep_by_space !== 0 &&
  66. properties.int_p_sep_by_space !== 1 &&
  67. properties.int_p_sep_by_space !== 2)
  68. throw "Error: Invalid/missing int_p_sep_by_spacev, must be 0, 1 or 2";
  69. this.int_p_sep_by_space = properties.int_p_sep_by_space;
  70. if (properties.int_n_sep_by_space !== 0 &&
  71. properties.int_n_sep_by_space !== 1 &&
  72. properties.int_n_sep_by_space !== 2)
  73. throw "Error: Invalid/missing int_n_sep_by_space property, must be 0, 1, or 2";
  74. this.int_n_sep_by_space = properties.int_n_sep_by_space;
  75. if (properties.int_p_sign_posn !== 0 &&
  76. properties.int_p_sign_posn !== 1 &&
  77. properties.int_p_sign_posn !== 2 &&
  78. properties.int_p_sign_posn !== 3 &&
  79. properties.int_p_sign_posn !== 4)
  80. throw "Error: Invalid/missing int_p_sign_posn property, must be 0, 1, 2, 3 or 4";
  81. this.int_p_sign_posn = properties.int_p_sign_posn;
  82. if (properties.int_n_sign_posn !== 0 &&
  83. properties.int_n_sign_posn !== 1 &&
  84. properties.int_n_sign_posn !== 2 &&
  85. properties.int_n_sign_posn !== 3 &&
  86. properties.int_n_sign_posn !== 4)
  87. throw "Error: Invalid/missing int_n_sign_posn property, must be 0, 1, 2, 3 or 4";
  88. this.int_n_sign_posn = properties.int_n_sign_posn;
  89. // LC_TIME
  90. if (properties == null || typeof properties != "object")
  91. throw "Error: Invalid/missing time locale properties";
  92. // parse the supported POSIX LC_TIME properties
  93. // abday
  94. try {
  95. this.abday = this._parseList(properties.abday, 7);
  96. }
  97. catch (error) {
  98. throw "Error: Invalid abday property: " + error;
  99. }
  100. }