OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // ECMAScript 402 API implementation. | 5 // ECMAScript 402 API implementation. |
6 | 6 |
7 /** | 7 /** |
8 * Intl object is a single object that has some named properties, | 8 * Intl object is a single object that has some named properties, |
9 * all of which are constructors. | 9 * all of which are constructors. |
10 */ | 10 */ |
11 (function(global, utils) { | 11 (function(global, utils) { |
12 | 12 |
13 "use strict"; | 13 "use strict"; |
14 | 14 |
15 %CheckIsBootstrapping(); | 15 %CheckIsBootstrapping(); |
16 | 16 |
17 // ------------------------------------------------------------------- | 17 // ------------------------------------------------------------------- |
18 // Imports | 18 // Imports |
19 | 19 |
20 var ArrayIndexOf; | 20 var ArrayIndexOf; |
21 var ArrayJoin; | 21 var ArrayJoin; |
22 var ArrayPush; | 22 var ArrayPush; |
| 23 var InstallFunctions = utils.InstallFunctions; |
| 24 var InstallGetter = utils.InstallGetter; |
23 var IsFinite; | 25 var IsFinite; |
24 var IsNaN; | 26 var IsNaN; |
25 var GlobalBoolean = global.Boolean; | 27 var GlobalBoolean = global.Boolean; |
26 var GlobalDate = global.Date; | 28 var GlobalDate = global.Date; |
27 var GlobalNumber = global.Number; | 29 var GlobalNumber = global.Number; |
28 var GlobalRegExp = global.RegExp; | 30 var GlobalRegExp = global.RegExp; |
29 var GlobalString = global.String; | 31 var GlobalString = global.String; |
30 var MakeError; | 32 var MakeError; |
31 var MakeRangeError; | 33 var MakeRangeError; |
32 var MakeTypeError; | 34 var MakeTypeError; |
33 var MathFloor; | 35 var MathFloor; |
34 var ObjectDefineProperties = utils.ImportNow("ObjectDefineProperties"); | 36 var ObjectDefineProperties = utils.ImportNow("ObjectDefineProperties"); |
35 var ObjectDefineProperty = utils.ImportNow("ObjectDefineProperty"); | 37 var ObjectDefineProperty = utils.ImportNow("ObjectDefineProperty"); |
36 var patternSymbol = utils.ImportNow("intl_pattern_symbol"); | 38 var patternSymbol = utils.ImportNow("intl_pattern_symbol"); |
37 var RegExpTest; | 39 var RegExpTest; |
38 var resolvedSymbol = utils.ImportNow("intl_resolved_symbol"); | 40 var resolvedSymbol = utils.ImportNow("intl_resolved_symbol"); |
| 41 var SetFunctionName = utils.SetFunctionName; |
39 var StringIndexOf; | 42 var StringIndexOf; |
40 var StringLastIndexOf; | 43 var StringLastIndexOf; |
41 var StringMatch; | 44 var StringMatch; |
42 var StringReplace; | 45 var StringReplace; |
43 var StringSplit; | 46 var StringSplit; |
44 var StringSubstr; | 47 var StringSubstr; |
45 var StringSubstring; | 48 var StringSubstring; |
46 | 49 |
47 utils.Import(function(from) { | 50 utils.Import(function(from) { |
48 ArrayIndexOf = from.ArrayIndexOf; | 51 ArrayIndexOf = from.ArrayIndexOf; |
49 ArrayJoin = from.ArrayJoin; | 52 ArrayJoin = from.ArrayJoin; |
50 ArrayPush = from.ArrayPush; | 53 ArrayPush = from.ArrayPush; |
51 IsFinite = from.IsFinite; | 54 IsFinite = from.IsFinite; |
52 IsNaN = from.IsNaN; | 55 IsNaN = from.IsNaN; |
53 MakeError = from.MakeError; | 56 MakeError = from.MakeError; |
54 MakeRangeError = from.MakeRangeError; | 57 MakeRangeError = from.MakeRangeError; |
55 MakeTypeError = from.MakeTypeError; | 58 MakeTypeError = from.MakeTypeError; |
56 MathFloor = from.MathFloor; | 59 MathFloor = from.MathFloor; |
57 RegExpTest = from.RegExpTest; | 60 RegExpTest = from.RegExpTest; |
58 StringIndexOf = from.StringIndexOf; | 61 StringIndexOf = from.StringIndexOf; |
59 StringLastIndexOf = from.StringLastIndexOf; | 62 StringLastIndexOf = from.StringLastIndexOf; |
60 StringMatch = from.StringMatch; | 63 StringMatch = from.StringMatch; |
61 StringReplace = from.StringReplace; | 64 StringReplace = from.StringReplace; |
62 StringSplit = from.StringSplit; | 65 StringSplit = from.StringSplit; |
63 StringSubstr = from.StringSubstr; | 66 StringSubstr = from.StringSubstr; |
64 StringSubstring = from.StringSubstring; | 67 StringSubstring = from.StringSubstring; |
65 }); | 68 }); |
66 | 69 |
| 70 // Utilities for definitions |
| 71 |
| 72 function OverrideFunction(object, name, f) { |
| 73 %CheckIsBootstrapping(); |
| 74 ObjectDefineProperty(object, name, { value: f, |
| 75 writeable: true, |
| 76 configurable: true, |
| 77 enumerable: false }); |
| 78 %FunctionSetName(f, name); |
| 79 %FunctionRemovePrototype(f); |
| 80 %SetNativeFlag(f); |
| 81 } |
| 82 |
| 83 function InstallFunction(object, name, func) { |
| 84 InstallFunctions(object, DONT_ENUM, [name, func]); |
| 85 } |
| 86 |
| 87 |
| 88 function InstallConstructor(object, name, func) { |
| 89 %CheckIsBootstrapping(); |
| 90 SetFunctionName(func, name); |
| 91 %AddNamedProperty(object, name, func, DONT_ENUM); |
| 92 %SetNativeFlag(func); |
| 93 %ToFastProperties(object); |
| 94 } |
| 95 |
| 96 /** |
| 97 * Adds bound method to the prototype of the given object. |
| 98 */ |
| 99 function AddBoundMethod(obj, methodName, implementation, length) { |
| 100 %CheckIsBootstrapping(); |
| 101 var internalName = %CreatePrivateSymbol(methodName); |
| 102 var getter = function() { |
| 103 if (!%IsInitializedIntlObject(this)) { |
| 104 throw MakeTypeError(kMethodCalledOnWrongObject, methodName); |
| 105 } |
| 106 if (IS_UNDEFINED(this[internalName])) { |
| 107 var boundMethod; |
| 108 if (IS_UNDEFINED(length) || length === 2) { |
| 109 boundMethod = (x, y) => implementation(this, x, y); |
| 110 } else if (length === 1) { |
| 111 boundMethod = x => implementation(this, x); |
| 112 } else { |
| 113 boundMethod = (...args) => { |
| 114 // DateTimeFormat.format needs to be 0 arg method, but can stil |
| 115 // receive optional dateValue param. If one was provided, pass it |
| 116 // along. |
| 117 if (args.length > 0) { |
| 118 return implementation(this, args[0]); |
| 119 } else { |
| 120 return implementation(this); |
| 121 } |
| 122 } |
| 123 } |
| 124 // TODO(littledan): Once function name reform is shipped, remove the |
| 125 // following line and wrap the boundMethod definition in an anonymous |
| 126 // function macro. |
| 127 %FunctionSetName(boundMethod, '__bound' + methodName + '__'); |
| 128 %FunctionRemovePrototype(boundMethod); |
| 129 %SetNativeFlag(boundMethod); |
| 130 this[internalName] = boundMethod; |
| 131 } |
| 132 return this[internalName]; |
| 133 }; |
| 134 |
| 135 InstallGetter(obj.prototype, methodName, getter, DONT_ENUM); |
| 136 } |
| 137 |
67 // ------------------------------------------------------------------- | 138 // ------------------------------------------------------------------- |
68 | 139 |
69 var Intl = {}; | 140 var Intl = {}; |
70 | 141 |
71 %AddNamedProperty(global, "Intl", Intl, DONT_ENUM); | 142 %AddNamedProperty(global, "Intl", Intl, DONT_ENUM); |
72 | 143 |
73 /** | 144 /** |
74 * Caches available locales for each service. | 145 * Caches available locales for each service. |
75 */ | 146 */ |
76 var AVAILABLE_LOCALES = { | 147 var AVAILABLE_LOCALES = { |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 var TIMEZONE_NAME_LOCATION_PART_RE = UNDEFINED; | 261 var TIMEZONE_NAME_LOCATION_PART_RE = UNDEFINED; |
191 | 262 |
192 function GetTimezoneNameLocationPartRE() { | 263 function GetTimezoneNameLocationPartRE() { |
193 if (IS_UNDEFINED(TIMEZONE_NAME_LOCATION_PART_RE)) { | 264 if (IS_UNDEFINED(TIMEZONE_NAME_LOCATION_PART_RE)) { |
194 TIMEZONE_NAME_LOCATION_PART_RE = | 265 TIMEZONE_NAME_LOCATION_PART_RE = |
195 new GlobalRegExp('^([A-Za-z]+)((?:[_-][A-Za-z]+)+)*$'); | 266 new GlobalRegExp('^([A-Za-z]+)((?:[_-][A-Za-z]+)+)*$'); |
196 } | 267 } |
197 return TIMEZONE_NAME_LOCATION_PART_RE; | 268 return TIMEZONE_NAME_LOCATION_PART_RE; |
198 } | 269 } |
199 | 270 |
200 /** | |
201 * Adds bound method to the prototype of the given object. | |
202 */ | |
203 function addBoundMethod(obj, methodName, implementation, length) { | |
204 %CheckIsBootstrapping(); | |
205 var internalName = %CreatePrivateSymbol(methodName); | |
206 function getter() { | |
207 if (!%IsInitializedIntlObject(this)) { | |
208 throw MakeTypeError(kMethodCalledOnWrongObject, methodName); | |
209 } | |
210 if (IS_UNDEFINED(this[internalName])) { | |
211 var boundMethod; | |
212 if (IS_UNDEFINED(length) || length === 2) { | |
213 boundMethod = (x, y) => implementation(this, x, y); | |
214 } else if (length === 1) { | |
215 boundMethod = x => implementation(this, x); | |
216 } else { | |
217 boundMethod = (...args) => { | |
218 // DateTimeFormat.format needs to be 0 arg method, but can stil | |
219 // receive optional dateValue param. If one was provided, pass it | |
220 // along. | |
221 if (args.length > 0) { | |
222 return implementation(this, args[0]); | |
223 } else { | |
224 return implementation(this); | |
225 } | |
226 } | |
227 } | |
228 // TODO(littledan): Once function name reform is shipped, remove the | |
229 // following line and wrap the boundMethod definition in an anonymous | |
230 // function macro. | |
231 %FunctionSetName(boundMethod, '__bound' + methodName + '__'); | |
232 %FunctionRemovePrototype(boundMethod); | |
233 %SetNativeFlag(boundMethod); | |
234 this[internalName] = boundMethod; | |
235 } | |
236 return this[internalName]; | |
237 } | |
238 | |
239 %FunctionSetName(getter, methodName); | |
240 %FunctionRemovePrototype(getter); | |
241 %SetNativeFlag(getter); | |
242 | |
243 ObjectDefineProperty(obj.prototype, methodName, { | |
244 get: getter, | |
245 enumerable: false, | |
246 configurable: true | |
247 }); | |
248 } | |
249 | |
250 | 271 |
251 /** | 272 /** |
252 * Returns an intersection of locales and service supported locales. | 273 * Returns an intersection of locales and service supported locales. |
253 * Parameter locales is treated as a priority list. | 274 * Parameter locales is treated as a priority list. |
254 */ | 275 */ |
255 function supportedLocalesOf(service, locales, options) { | 276 function supportedLocalesOf(service, locales, options) { |
256 if (IS_NULL(%_Call(StringMatch, service, GetServiceRE()))) { | 277 if (IS_NULL(%_Call(StringMatch, service, GetServiceRE()))) { |
257 throw MakeError(kWrongServiceType, service); | 278 throw MakeError(kWrongServiceType, service); |
258 } | 279 } |
259 | 280 |
(...skipping 723 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
983 return collator; | 1004 return collator; |
984 } | 1005 } |
985 | 1006 |
986 | 1007 |
987 /** | 1008 /** |
988 * Constructs Intl.Collator object given optional locales and options | 1009 * Constructs Intl.Collator object given optional locales and options |
989 * parameters. | 1010 * parameters. |
990 * | 1011 * |
991 * @constructor | 1012 * @constructor |
992 */ | 1013 */ |
993 %AddNamedProperty(Intl, 'Collator', function() { | 1014 InstallConstructor(Intl, 'Collator', function() { |
994 var locales = arguments[0]; | 1015 var locales = arguments[0]; |
995 var options = arguments[1]; | 1016 var options = arguments[1]; |
996 | 1017 |
997 if (!this || this === Intl) { | 1018 if (!this || this === Intl) { |
998 // Constructor is called as a function. | 1019 // Constructor is called as a function. |
999 return new Intl.Collator(locales, options); | 1020 return new Intl.Collator(locales, options); |
1000 } | 1021 } |
1001 | 1022 |
1002 return initializeCollator(TO_OBJECT(this), locales, options); | 1023 return initializeCollator(TO_OBJECT(this), locales, options); |
1003 }, | 1024 } |
1004 DONT_ENUM | |
1005 ); | 1025 ); |
1006 | 1026 |
1007 | 1027 |
1008 /** | 1028 /** |
1009 * Collator resolvedOptions method. | 1029 * Collator resolvedOptions method. |
1010 */ | 1030 */ |
1011 %AddNamedProperty(Intl.Collator.prototype, 'resolvedOptions', function() { | 1031 InstallFunction(Intl.Collator.prototype, 'resolvedOptions', function() { |
1012 if (!IS_UNDEFINED(new.target)) { | 1032 if (!IS_UNDEFINED(new.target)) { |
1013 throw MakeTypeError(kOrdinaryFunctionCalledAsConstructor); | 1033 throw MakeTypeError(kOrdinaryFunctionCalledAsConstructor); |
1014 } | 1034 } |
1015 | 1035 |
1016 if (!%IsInitializedIntlObjectOfType(this, 'collator')) { | 1036 if (!%IsInitializedIntlObjectOfType(this, 'collator')) { |
1017 throw MakeTypeError(kResolvedOptionsCalledOnNonObject, "Collator"); | 1037 throw MakeTypeError(kResolvedOptionsCalledOnNonObject, "Collator"); |
1018 } | 1038 } |
1019 | 1039 |
1020 var coll = this; | 1040 var coll = this; |
1021 var locale = getOptimalLanguageTag(coll[resolvedSymbol].requestedLocale, | 1041 var locale = getOptimalLanguageTag(coll[resolvedSymbol].requestedLocale, |
1022 coll[resolvedSymbol].locale); | 1042 coll[resolvedSymbol].locale); |
1023 | 1043 |
1024 return { | 1044 return { |
1025 locale: locale, | 1045 locale: locale, |
1026 usage: coll[resolvedSymbol].usage, | 1046 usage: coll[resolvedSymbol].usage, |
1027 sensitivity: coll[resolvedSymbol].sensitivity, | 1047 sensitivity: coll[resolvedSymbol].sensitivity, |
1028 ignorePunctuation: coll[resolvedSymbol].ignorePunctuation, | 1048 ignorePunctuation: coll[resolvedSymbol].ignorePunctuation, |
1029 numeric: coll[resolvedSymbol].numeric, | 1049 numeric: coll[resolvedSymbol].numeric, |
1030 caseFirst: coll[resolvedSymbol].caseFirst, | 1050 caseFirst: coll[resolvedSymbol].caseFirst, |
1031 collation: coll[resolvedSymbol].collation | 1051 collation: coll[resolvedSymbol].collation |
1032 }; | 1052 }; |
1033 }, | 1053 } |
1034 DONT_ENUM | |
1035 ); | 1054 ); |
1036 %FunctionSetName(Intl.Collator.prototype.resolvedOptions, 'resolvedOptions'); | |
1037 %FunctionRemovePrototype(Intl.Collator.prototype.resolvedOptions); | |
1038 %SetNativeFlag(Intl.Collator.prototype.resolvedOptions); | |
1039 | 1055 |
1040 | 1056 |
1041 /** | 1057 /** |
1042 * Returns the subset of the given locale list for which this locale list | 1058 * Returns the subset of the given locale list for which this locale list |
1043 * has a matching (possibly fallback) locale. Locales appear in the same | 1059 * has a matching (possibly fallback) locale. Locales appear in the same |
1044 * order in the returned list as in the input list. | 1060 * order in the returned list as in the input list. |
1045 * Options are optional parameter. | 1061 * Options are optional parameter. |
1046 */ | 1062 */ |
1047 %AddNamedProperty(Intl.Collator, 'supportedLocalesOf', function(locales) { | 1063 InstallFunction(Intl.Collator, 'supportedLocalesOf', function(locales) { |
1048 if (!IS_UNDEFINED(new.target)) { | 1064 if (!IS_UNDEFINED(new.target)) { |
1049 throw MakeTypeError(kOrdinaryFunctionCalledAsConstructor); | 1065 throw MakeTypeError(kOrdinaryFunctionCalledAsConstructor); |
1050 } | 1066 } |
1051 | 1067 |
1052 return supportedLocalesOf('collator', locales, arguments[1]); | 1068 return supportedLocalesOf('collator', locales, arguments[1]); |
1053 }, | 1069 } |
1054 DONT_ENUM | |
1055 ); | 1070 ); |
1056 %FunctionSetName(Intl.Collator.supportedLocalesOf, 'supportedLocalesOf'); | |
1057 %FunctionRemovePrototype(Intl.Collator.supportedLocalesOf); | |
1058 %SetNativeFlag(Intl.Collator.supportedLocalesOf); | |
1059 | 1071 |
1060 | 1072 |
1061 /** | 1073 /** |
1062 * When the compare method is called with two arguments x and y, it returns a | 1074 * When the compare method is called with two arguments x and y, it returns a |
1063 * Number other than NaN that represents the result of a locale-sensitive | 1075 * Number other than NaN that represents the result of a locale-sensitive |
1064 * String comparison of x with y. | 1076 * String comparison of x with y. |
1065 * The result is intended to order String values in the sort order specified | 1077 * The result is intended to order String values in the sort order specified |
1066 * by the effective locale and collation options computed during construction | 1078 * by the effective locale and collation options computed during construction |
1067 * of this Collator object, and will be negative, zero, or positive, depending | 1079 * of this Collator object, and will be negative, zero, or positive, depending |
1068 * on whether x comes before y in the sort order, the Strings are equal under | 1080 * on whether x comes before y in the sort order, the Strings are equal under |
1069 * the sort order, or x comes after y in the sort order, respectively. | 1081 * the sort order, or x comes after y in the sort order, respectively. |
1070 */ | 1082 */ |
1071 function compare(collator, x, y) { | 1083 function compare(collator, x, y) { |
1072 return %InternalCompare(%GetImplFromInitializedIntlObject(collator), | 1084 return %InternalCompare(%GetImplFromInitializedIntlObject(collator), |
1073 GlobalString(x), GlobalString(y)); | 1085 GlobalString(x), GlobalString(y)); |
1074 }; | 1086 }; |
1075 | 1087 |
1076 | 1088 |
1077 addBoundMethod(Intl.Collator, 'compare', compare, 2); | 1089 AddBoundMethod(Intl.Collator, 'compare', compare, 2); |
1078 | 1090 |
1079 /** | 1091 /** |
1080 * Verifies that the input is a well-formed ISO 4217 currency code. | 1092 * Verifies that the input is a well-formed ISO 4217 currency code. |
1081 * Don't uppercase to test. It could convert invalid code into a valid one. | 1093 * Don't uppercase to test. It could convert invalid code into a valid one. |
1082 * For example \u00DFP (Eszett+P) becomes SSP. | 1094 * For example \u00DFP (Eszett+P) becomes SSP. |
1083 */ | 1095 */ |
1084 function isWellFormedCurrencyCode(currency) { | 1096 function isWellFormedCurrencyCode(currency) { |
1085 return typeof currency == "string" && | 1097 return typeof currency == "string" && |
1086 currency.length == 3 && | 1098 currency.length == 3 && |
1087 %_Call(StringMatch, currency, /[^A-Za-z]/) == null; | 1099 %_Call(StringMatch, currency, /[^A-Za-z]/) == null; |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1236 return numberFormat; | 1248 return numberFormat; |
1237 } | 1249 } |
1238 | 1250 |
1239 | 1251 |
1240 /** | 1252 /** |
1241 * Constructs Intl.NumberFormat object given optional locales and options | 1253 * Constructs Intl.NumberFormat object given optional locales and options |
1242 * parameters. | 1254 * parameters. |
1243 * | 1255 * |
1244 * @constructor | 1256 * @constructor |
1245 */ | 1257 */ |
1246 %AddNamedProperty(Intl, 'NumberFormat', function() { | 1258 InstallConstructor(Intl, 'NumberFormat', function() { |
1247 var locales = arguments[0]; | 1259 var locales = arguments[0]; |
1248 var options = arguments[1]; | 1260 var options = arguments[1]; |
1249 | 1261 |
1250 if (!this || this === Intl) { | 1262 if (!this || this === Intl) { |
1251 // Constructor is called as a function. | 1263 // Constructor is called as a function. |
1252 return new Intl.NumberFormat(locales, options); | 1264 return new Intl.NumberFormat(locales, options); |
1253 } | 1265 } |
1254 | 1266 |
1255 return initializeNumberFormat(TO_OBJECT(this), locales, options); | 1267 return initializeNumberFormat(TO_OBJECT(this), locales, options); |
1256 }, | 1268 } |
1257 DONT_ENUM | |
1258 ); | 1269 ); |
1259 | 1270 |
1260 | 1271 |
1261 /** | 1272 /** |
1262 * NumberFormat resolvedOptions method. | 1273 * NumberFormat resolvedOptions method. |
1263 */ | 1274 */ |
1264 %AddNamedProperty(Intl.NumberFormat.prototype, 'resolvedOptions', function() { | 1275 InstallFunction(Intl.NumberFormat.prototype, 'resolvedOptions', function() { |
1265 if (!IS_UNDEFINED(new.target)) { | 1276 if (!IS_UNDEFINED(new.target)) { |
1266 throw MakeTypeError(kOrdinaryFunctionCalledAsConstructor); | 1277 throw MakeTypeError(kOrdinaryFunctionCalledAsConstructor); |
1267 } | 1278 } |
1268 | 1279 |
1269 if (!%IsInitializedIntlObjectOfType(this, 'numberformat')) { | 1280 if (!%IsInitializedIntlObjectOfType(this, 'numberformat')) { |
1270 throw MakeTypeError(kResolvedOptionsCalledOnNonObject, "NumberFormat"); | 1281 throw MakeTypeError(kResolvedOptionsCalledOnNonObject, "NumberFormat"); |
1271 } | 1282 } |
1272 | 1283 |
1273 var format = this; | 1284 var format = this; |
1274 var locale = getOptimalLanguageTag(format[resolvedSymbol].requestedLocale, | 1285 var locale = getOptimalLanguageTag(format[resolvedSymbol].requestedLocale, |
(...skipping 19 matching lines...) Expand all Loading... |
1294 defineWECProperty(result, 'minimumSignificantDigits', | 1305 defineWECProperty(result, 'minimumSignificantDigits', |
1295 format[resolvedSymbol].minimumSignificantDigits); | 1306 format[resolvedSymbol].minimumSignificantDigits); |
1296 } | 1307 } |
1297 | 1308 |
1298 if (%HasOwnProperty(format[resolvedSymbol], 'maximumSignificantDigits')) { | 1309 if (%HasOwnProperty(format[resolvedSymbol], 'maximumSignificantDigits')) { |
1299 defineWECProperty(result, 'maximumSignificantDigits', | 1310 defineWECProperty(result, 'maximumSignificantDigits', |
1300 format[resolvedSymbol].maximumSignificantDigits); | 1311 format[resolvedSymbol].maximumSignificantDigits); |
1301 } | 1312 } |
1302 | 1313 |
1303 return result; | 1314 return result; |
1304 }, | 1315 } |
1305 DONT_ENUM | |
1306 ); | 1316 ); |
1307 %FunctionSetName(Intl.NumberFormat.prototype.resolvedOptions, | |
1308 'resolvedOptions'); | |
1309 %FunctionRemovePrototype(Intl.NumberFormat.prototype.resolvedOptions); | |
1310 %SetNativeFlag(Intl.NumberFormat.prototype.resolvedOptions); | |
1311 | 1317 |
1312 | 1318 |
1313 /** | 1319 /** |
1314 * Returns the subset of the given locale list for which this locale list | 1320 * Returns the subset of the given locale list for which this locale list |
1315 * has a matching (possibly fallback) locale. Locales appear in the same | 1321 * has a matching (possibly fallback) locale. Locales appear in the same |
1316 * order in the returned list as in the input list. | 1322 * order in the returned list as in the input list. |
1317 * Options are optional parameter. | 1323 * Options are optional parameter. |
1318 */ | 1324 */ |
1319 %AddNamedProperty(Intl.NumberFormat, 'supportedLocalesOf', function(locales) { | 1325 InstallFunction(Intl.NumberFormat, 'supportedLocalesOf', function(locales) { |
1320 if (!IS_UNDEFINED(new.target)) { | 1326 if (!IS_UNDEFINED(new.target)) { |
1321 throw MakeTypeError(kOrdinaryFunctionCalledAsConstructor); | 1327 throw MakeTypeError(kOrdinaryFunctionCalledAsConstructor); |
1322 } | 1328 } |
1323 | 1329 |
1324 return supportedLocalesOf('numberformat', locales, arguments[1]); | 1330 return supportedLocalesOf('numberformat', locales, arguments[1]); |
1325 }, | 1331 } |
1326 DONT_ENUM | |
1327 ); | 1332 ); |
1328 %FunctionSetName(Intl.NumberFormat.supportedLocalesOf, 'supportedLocalesOf'); | |
1329 %FunctionRemovePrototype(Intl.NumberFormat.supportedLocalesOf); | |
1330 %SetNativeFlag(Intl.NumberFormat.supportedLocalesOf); | |
1331 | 1333 |
1332 | 1334 |
1333 /** | 1335 /** |
1334 * Returns a String value representing the result of calling ToNumber(value) | 1336 * Returns a String value representing the result of calling ToNumber(value) |
1335 * according to the effective locale and the formatting options of this | 1337 * according to the effective locale and the formatting options of this |
1336 * NumberFormat. | 1338 * NumberFormat. |
1337 */ | 1339 */ |
1338 function formatNumber(formatter, value) { | 1340 function formatNumber(formatter, value) { |
1339 // Spec treats -0 and +0 as 0. | 1341 // Spec treats -0 and +0 as 0. |
1340 var number = TO_NUMBER(value) + 0; | 1342 var number = TO_NUMBER(value) + 0; |
1341 | 1343 |
1342 return %InternalNumberFormat(%GetImplFromInitializedIntlObject(formatter), | 1344 return %InternalNumberFormat(%GetImplFromInitializedIntlObject(formatter), |
1343 number); | 1345 number); |
1344 } | 1346 } |
1345 | 1347 |
1346 | 1348 |
1347 /** | 1349 /** |
1348 * Returns a Number that represents string value that was passed in. | 1350 * Returns a Number that represents string value that was passed in. |
1349 */ | 1351 */ |
1350 function parseNumber(formatter, value) { | 1352 function parseNumber(formatter, value) { |
1351 return %InternalNumberParse(%GetImplFromInitializedIntlObject(formatter), | 1353 return %InternalNumberParse(%GetImplFromInitializedIntlObject(formatter), |
1352 GlobalString(value)); | 1354 GlobalString(value)); |
1353 } | 1355 } |
1354 | 1356 |
1355 | 1357 |
1356 addBoundMethod(Intl.NumberFormat, 'format', formatNumber, 1); | 1358 AddBoundMethod(Intl.NumberFormat, 'format', formatNumber, 1); |
1357 addBoundMethod(Intl.NumberFormat, 'v8Parse', parseNumber, 1); | 1359 AddBoundMethod(Intl.NumberFormat, 'v8Parse', parseNumber, 1); |
1358 | 1360 |
1359 /** | 1361 /** |
1360 * Returns a string that matches LDML representation of the options object. | 1362 * Returns a string that matches LDML representation of the options object. |
1361 */ | 1363 */ |
1362 function toLDMLString(options) { | 1364 function toLDMLString(options) { |
1363 var getOption = getGetOption(options, 'dateformat'); | 1365 var getOption = getGetOption(options, 'dateformat'); |
1364 | 1366 |
1365 var ldmlString = ''; | 1367 var ldmlString = ''; |
1366 | 1368 |
1367 var option = getOption('weekday', 'string', ['narrow', 'short', 'long']); | 1369 var option = getOption('weekday', 'string', ['narrow', 'short', 'long']); |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1640 return dateFormat; | 1642 return dateFormat; |
1641 } | 1643 } |
1642 | 1644 |
1643 | 1645 |
1644 /** | 1646 /** |
1645 * Constructs Intl.DateTimeFormat object given optional locales and options | 1647 * Constructs Intl.DateTimeFormat object given optional locales and options |
1646 * parameters. | 1648 * parameters. |
1647 * | 1649 * |
1648 * @constructor | 1650 * @constructor |
1649 */ | 1651 */ |
1650 %AddNamedProperty(Intl, 'DateTimeFormat', function() { | 1652 InstallConstructor(Intl, 'DateTimeFormat', function() { |
1651 var locales = arguments[0]; | 1653 var locales = arguments[0]; |
1652 var options = arguments[1]; | 1654 var options = arguments[1]; |
1653 | 1655 |
1654 if (!this || this === Intl) { | 1656 if (!this || this === Intl) { |
1655 // Constructor is called as a function. | 1657 // Constructor is called as a function. |
1656 return new Intl.DateTimeFormat(locales, options); | 1658 return new Intl.DateTimeFormat(locales, options); |
1657 } | 1659 } |
1658 | 1660 |
1659 return initializeDateTimeFormat(TO_OBJECT(this), locales, options); | 1661 return initializeDateTimeFormat(TO_OBJECT(this), locales, options); |
1660 }, | 1662 } |
1661 DONT_ENUM | |
1662 ); | 1663 ); |
1663 | 1664 |
1664 | 1665 |
1665 /** | 1666 /** |
1666 * DateTimeFormat resolvedOptions method. | 1667 * DateTimeFormat resolvedOptions method. |
1667 */ | 1668 */ |
1668 %AddNamedProperty(Intl.DateTimeFormat.prototype, 'resolvedOptions', function() { | 1669 InstallFunction(Intl.DateTimeFormat.prototype, 'resolvedOptions', function() { |
1669 if (!IS_UNDEFINED(new.target)) { | 1670 if (!IS_UNDEFINED(new.target)) { |
1670 throw MakeTypeError(kOrdinaryFunctionCalledAsConstructor); | 1671 throw MakeTypeError(kOrdinaryFunctionCalledAsConstructor); |
1671 } | 1672 } |
1672 | 1673 |
1673 if (!%IsInitializedIntlObjectOfType(this, 'dateformat')) { | 1674 if (!%IsInitializedIntlObjectOfType(this, 'dateformat')) { |
1674 throw MakeTypeError(kResolvedOptionsCalledOnNonObject, "DateTimeFormat"); | 1675 throw MakeTypeError(kResolvedOptionsCalledOnNonObject, "DateTimeFormat"); |
1675 } | 1676 } |
1676 | 1677 |
1677 /** | 1678 /** |
1678 * Maps ICU calendar names into LDML type. | 1679 * Maps ICU calendar names into LDML type. |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1717 addWECPropertyIfDefined(result, 'year', fromPattern.year); | 1718 addWECPropertyIfDefined(result, 'year', fromPattern.year); |
1718 addWECPropertyIfDefined(result, 'month', fromPattern.month); | 1719 addWECPropertyIfDefined(result, 'month', fromPattern.month); |
1719 addWECPropertyIfDefined(result, 'day', fromPattern.day); | 1720 addWECPropertyIfDefined(result, 'day', fromPattern.day); |
1720 addWECPropertyIfDefined(result, 'weekday', fromPattern.weekday); | 1721 addWECPropertyIfDefined(result, 'weekday', fromPattern.weekday); |
1721 addWECPropertyIfDefined(result, 'hour12', fromPattern.hour12); | 1722 addWECPropertyIfDefined(result, 'hour12', fromPattern.hour12); |
1722 addWECPropertyIfDefined(result, 'hour', fromPattern.hour); | 1723 addWECPropertyIfDefined(result, 'hour', fromPattern.hour); |
1723 addWECPropertyIfDefined(result, 'minute', fromPattern.minute); | 1724 addWECPropertyIfDefined(result, 'minute', fromPattern.minute); |
1724 addWECPropertyIfDefined(result, 'second', fromPattern.second); | 1725 addWECPropertyIfDefined(result, 'second', fromPattern.second); |
1725 | 1726 |
1726 return result; | 1727 return result; |
1727 }, | 1728 } |
1728 DONT_ENUM | |
1729 ); | 1729 ); |
1730 %FunctionSetName(Intl.DateTimeFormat.prototype.resolvedOptions, | |
1731 'resolvedOptions'); | |
1732 %FunctionRemovePrototype(Intl.DateTimeFormat.prototype.resolvedOptions); | |
1733 %SetNativeFlag(Intl.DateTimeFormat.prototype.resolvedOptions); | |
1734 | 1730 |
1735 | 1731 |
1736 /** | 1732 /** |
1737 * Returns the subset of the given locale list for which this locale list | 1733 * Returns the subset of the given locale list for which this locale list |
1738 * has a matching (possibly fallback) locale. Locales appear in the same | 1734 * has a matching (possibly fallback) locale. Locales appear in the same |
1739 * order in the returned list as in the input list. | 1735 * order in the returned list as in the input list. |
1740 * Options are optional parameter. | 1736 * Options are optional parameter. |
1741 */ | 1737 */ |
1742 %AddNamedProperty(Intl.DateTimeFormat, 'supportedLocalesOf', function(locales) { | 1738 InstallFunction(Intl.DateTimeFormat, 'supportedLocalesOf', function(locales) { |
1743 if (!IS_UNDEFINED(new.target)) { | 1739 if (!IS_UNDEFINED(new.target)) { |
1744 throw MakeTypeError(kOrdinaryFunctionCalledAsConstructor); | 1740 throw MakeTypeError(kOrdinaryFunctionCalledAsConstructor); |
1745 } | 1741 } |
1746 | 1742 |
1747 return supportedLocalesOf('dateformat', locales, arguments[1]); | 1743 return supportedLocalesOf('dateformat', locales, arguments[1]); |
1748 }, | 1744 } |
1749 DONT_ENUM | |
1750 ); | 1745 ); |
1751 %FunctionSetName(Intl.DateTimeFormat.supportedLocalesOf, 'supportedLocalesOf'); | |
1752 %FunctionRemovePrototype(Intl.DateTimeFormat.supportedLocalesOf); | |
1753 %SetNativeFlag(Intl.DateTimeFormat.supportedLocalesOf); | |
1754 | 1746 |
1755 | 1747 |
1756 /** | 1748 /** |
1757 * Returns a String value representing the result of calling ToNumber(date) | 1749 * Returns a String value representing the result of calling ToNumber(date) |
1758 * according to the effective locale and the formatting options of this | 1750 * according to the effective locale and the formatting options of this |
1759 * DateTimeFormat. | 1751 * DateTimeFormat. |
1760 */ | 1752 */ |
1761 function formatDate(formatter, dateValue) { | 1753 function formatDate(formatter, dateValue) { |
1762 var dateMs; | 1754 var dateMs; |
1763 if (IS_UNDEFINED(dateValue)) { | 1755 if (IS_UNDEFINED(dateValue)) { |
(...skipping 15 matching lines...) Expand all Loading... |
1779 * DateTimeFormat. | 1771 * DateTimeFormat. |
1780 * Returns undefined if date string cannot be parsed. | 1772 * Returns undefined if date string cannot be parsed. |
1781 */ | 1773 */ |
1782 function parseDate(formatter, value) { | 1774 function parseDate(formatter, value) { |
1783 return %InternalDateParse(%GetImplFromInitializedIntlObject(formatter), | 1775 return %InternalDateParse(%GetImplFromInitializedIntlObject(formatter), |
1784 GlobalString(value)); | 1776 GlobalString(value)); |
1785 } | 1777 } |
1786 | 1778 |
1787 | 1779 |
1788 // 0 because date is optional argument. | 1780 // 0 because date is optional argument. |
1789 addBoundMethod(Intl.DateTimeFormat, 'format', formatDate, 0); | 1781 AddBoundMethod(Intl.DateTimeFormat, 'format', formatDate, 0); |
1790 addBoundMethod(Intl.DateTimeFormat, 'v8Parse', parseDate, 1); | 1782 AddBoundMethod(Intl.DateTimeFormat, 'v8Parse', parseDate, 1); |
1791 | 1783 |
1792 | 1784 |
1793 /** | 1785 /** |
1794 * Returns canonical Area/Location(/Location) name, or throws an exception | 1786 * Returns canonical Area/Location(/Location) name, or throws an exception |
1795 * if the zone name is invalid IANA name. | 1787 * if the zone name is invalid IANA name. |
1796 */ | 1788 */ |
1797 function canonicalizeTimeZoneID(tzID) { | 1789 function canonicalizeTimeZoneID(tzID) { |
1798 // Skip undefined zones. | 1790 // Skip undefined zones. |
1799 if (IS_UNDEFINED(tzID)) { | 1791 if (IS_UNDEFINED(tzID)) { |
1800 return tzID; | 1792 return tzID; |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1867 return iterator; | 1859 return iterator; |
1868 } | 1860 } |
1869 | 1861 |
1870 | 1862 |
1871 /** | 1863 /** |
1872 * Constructs Intl.v8BreakIterator object given optional locales and options | 1864 * Constructs Intl.v8BreakIterator object given optional locales and options |
1873 * parameters. | 1865 * parameters. |
1874 * | 1866 * |
1875 * @constructor | 1867 * @constructor |
1876 */ | 1868 */ |
1877 %AddNamedProperty(Intl, 'v8BreakIterator', function() { | 1869 InstallConstructor(Intl, 'v8BreakIterator', function() { |
1878 var locales = arguments[0]; | 1870 var locales = arguments[0]; |
1879 var options = arguments[1]; | 1871 var options = arguments[1]; |
1880 | 1872 |
1881 if (!this || this === Intl) { | 1873 if (!this || this === Intl) { |
1882 // Constructor is called as a function. | 1874 // Constructor is called as a function. |
1883 return new Intl.v8BreakIterator(locales, options); | 1875 return new Intl.v8BreakIterator(locales, options); |
1884 } | 1876 } |
1885 | 1877 |
1886 return initializeBreakIterator(TO_OBJECT(this), locales, options); | 1878 return initializeBreakIterator(TO_OBJECT(this), locales, options); |
1887 }, | 1879 } |
1888 DONT_ENUM | |
1889 ); | 1880 ); |
1890 | 1881 |
1891 | 1882 |
1892 /** | 1883 /** |
1893 * BreakIterator resolvedOptions method. | 1884 * BreakIterator resolvedOptions method. |
1894 */ | 1885 */ |
1895 %AddNamedProperty(Intl.v8BreakIterator.prototype, 'resolvedOptions', | 1886 InstallFunction(Intl.v8BreakIterator.prototype, 'resolvedOptions', |
1896 function() { | 1887 function() { |
1897 if (!IS_UNDEFINED(new.target)) { | 1888 if (!IS_UNDEFINED(new.target)) { |
1898 throw MakeTypeError(kOrdinaryFunctionCalledAsConstructor); | 1889 throw MakeTypeError(kOrdinaryFunctionCalledAsConstructor); |
1899 } | 1890 } |
1900 | 1891 |
1901 if (!%IsInitializedIntlObjectOfType(this, 'breakiterator')) { | 1892 if (!%IsInitializedIntlObjectOfType(this, 'breakiterator')) { |
1902 throw MakeTypeError(kResolvedOptionsCalledOnNonObject, "v8BreakIterator"); | 1893 throw MakeTypeError(kResolvedOptionsCalledOnNonObject, "v8BreakIterator"); |
1903 } | 1894 } |
1904 | 1895 |
1905 var segmenter = this; | 1896 var segmenter = this; |
1906 var locale = | 1897 var locale = |
1907 getOptimalLanguageTag(segmenter[resolvedSymbol].requestedLocale, | 1898 getOptimalLanguageTag(segmenter[resolvedSymbol].requestedLocale, |
1908 segmenter[resolvedSymbol].locale); | 1899 segmenter[resolvedSymbol].locale); |
1909 | 1900 |
1910 return { | 1901 return { |
1911 locale: locale, | 1902 locale: locale, |
1912 type: segmenter[resolvedSymbol].type | 1903 type: segmenter[resolvedSymbol].type |
1913 }; | 1904 }; |
1914 }, | 1905 } |
1915 DONT_ENUM | |
1916 ); | 1906 ); |
1917 %FunctionSetName(Intl.v8BreakIterator.prototype.resolvedOptions, | |
1918 'resolvedOptions'); | |
1919 %FunctionRemovePrototype(Intl.v8BreakIterator.prototype.resolvedOptions); | |
1920 %SetNativeFlag(Intl.v8BreakIterator.prototype.resolvedOptions); | |
1921 | 1907 |
1922 | 1908 |
1923 /** | 1909 /** |
1924 * Returns the subset of the given locale list for which this locale list | 1910 * Returns the subset of the given locale list for which this locale list |
1925 * has a matching (possibly fallback) locale. Locales appear in the same | 1911 * has a matching (possibly fallback) locale. Locales appear in the same |
1926 * order in the returned list as in the input list. | 1912 * order in the returned list as in the input list. |
1927 * Options are optional parameter. | 1913 * Options are optional parameter. |
1928 */ | 1914 */ |
1929 %AddNamedProperty(Intl.v8BreakIterator, 'supportedLocalesOf', | 1915 InstallFunction(Intl.v8BreakIterator, 'supportedLocalesOf', |
1930 function(locales) { | 1916 function(locales) { |
1931 if (!IS_UNDEFINED(new.target)) { | 1917 if (!IS_UNDEFINED(new.target)) { |
1932 throw MakeTypeError(kOrdinaryFunctionCalledAsConstructor); | 1918 throw MakeTypeError(kOrdinaryFunctionCalledAsConstructor); |
1933 } | 1919 } |
1934 | 1920 |
1935 return supportedLocalesOf('breakiterator', locales, arguments[1]); | 1921 return supportedLocalesOf('breakiterator', locales, arguments[1]); |
1936 }, | 1922 } |
1937 DONT_ENUM | |
1938 ); | 1923 ); |
1939 %FunctionSetName(Intl.v8BreakIterator.supportedLocalesOf, 'supportedLocalesOf'); | |
1940 %FunctionRemovePrototype(Intl.v8BreakIterator.supportedLocalesOf); | |
1941 %SetNativeFlag(Intl.v8BreakIterator.supportedLocalesOf); | |
1942 | 1924 |
1943 | 1925 |
1944 /** | 1926 /** |
1945 * Adopts text to segment using the iterator. Old text, if present, | 1927 * Adopts text to segment using the iterator. Old text, if present, |
1946 * gets discarded. | 1928 * gets discarded. |
1947 */ | 1929 */ |
1948 function adoptText(iterator, text) { | 1930 function adoptText(iterator, text) { |
1949 %BreakIteratorAdoptText(%GetImplFromInitializedIntlObject(iterator), | 1931 %BreakIteratorAdoptText(%GetImplFromInitializedIntlObject(iterator), |
1950 GlobalString(text)); | 1932 GlobalString(text)); |
1951 } | 1933 } |
(...skipping 24 matching lines...) Expand all Loading... |
1976 | 1958 |
1977 | 1959 |
1978 /** | 1960 /** |
1979 * Returns type of the current break. | 1961 * Returns type of the current break. |
1980 */ | 1962 */ |
1981 function breakType(iterator) { | 1963 function breakType(iterator) { |
1982 return %BreakIteratorBreakType(%GetImplFromInitializedIntlObject(iterator)); | 1964 return %BreakIteratorBreakType(%GetImplFromInitializedIntlObject(iterator)); |
1983 } | 1965 } |
1984 | 1966 |
1985 | 1967 |
1986 addBoundMethod(Intl.v8BreakIterator, 'adoptText', adoptText, 1); | 1968 AddBoundMethod(Intl.v8BreakIterator, 'adoptText', adoptText, 1); |
1987 addBoundMethod(Intl.v8BreakIterator, 'first', first, 0); | 1969 AddBoundMethod(Intl.v8BreakIterator, 'first', first, 0); |
1988 addBoundMethod(Intl.v8BreakIterator, 'next', next, 0); | 1970 AddBoundMethod(Intl.v8BreakIterator, 'next', next, 0); |
1989 addBoundMethod(Intl.v8BreakIterator, 'current', current, 0); | 1971 AddBoundMethod(Intl.v8BreakIterator, 'current', current, 0); |
1990 addBoundMethod(Intl.v8BreakIterator, 'breakType', breakType, 0); | 1972 AddBoundMethod(Intl.v8BreakIterator, 'breakType', breakType, 0); |
1991 | 1973 |
1992 // Save references to Intl objects and methods we use, for added security. | 1974 // Save references to Intl objects and methods we use, for added security. |
1993 var savedObjects = { | 1975 var savedObjects = { |
1994 'collator': Intl.Collator, | 1976 'collator': Intl.Collator, |
1995 'numberformat': Intl.NumberFormat, | 1977 'numberformat': Intl.NumberFormat, |
1996 'dateformatall': Intl.DateTimeFormat, | 1978 'dateformatall': Intl.DateTimeFormat, |
1997 'dateformatdate': Intl.DateTimeFormat, | 1979 'dateformatdate': Intl.DateTimeFormat, |
1998 'dateformattime': Intl.DateTimeFormat | 1980 'dateformattime': Intl.DateTimeFormat |
1999 }; | 1981 }; |
2000 | 1982 |
(...skipping 17 matching lines...) Expand all Loading... |
2018 var useOptions = (IS_UNDEFINED(defaults)) ? options : defaults; | 2000 var useOptions = (IS_UNDEFINED(defaults)) ? options : defaults; |
2019 if (IS_UNDEFINED(locales) && IS_UNDEFINED(options)) { | 2001 if (IS_UNDEFINED(locales) && IS_UNDEFINED(options)) { |
2020 if (IS_UNDEFINED(defaultObjects[service])) { | 2002 if (IS_UNDEFINED(defaultObjects[service])) { |
2021 defaultObjects[service] = new savedObjects[service](locales, useOptions); | 2003 defaultObjects[service] = new savedObjects[service](locales, useOptions); |
2022 } | 2004 } |
2023 return defaultObjects[service]; | 2005 return defaultObjects[service]; |
2024 } | 2006 } |
2025 return new savedObjects[service](locales, useOptions); | 2007 return new savedObjects[service](locales, useOptions); |
2026 } | 2008 } |
2027 | 2009 |
2028 | |
2029 function OverrideFunction(object, name, f) { | |
2030 %CheckIsBootstrapping(); | |
2031 ObjectDefineProperty(object, name, { value: f, | |
2032 writeable: true, | |
2033 configurable: true, | |
2034 enumerable: false }); | |
2035 %FunctionSetName(f, name); | |
2036 %FunctionRemovePrototype(f); | |
2037 %SetNativeFlag(f); | |
2038 } | |
2039 | |
2040 /** | 2010 /** |
2041 * Compares this and that, and returns less than 0, 0 or greater than 0 value. | 2011 * Compares this and that, and returns less than 0, 0 or greater than 0 value. |
2042 * Overrides the built-in method. | 2012 * Overrides the built-in method. |
2043 */ | 2013 */ |
2044 OverrideFunction(GlobalString.prototype, 'localeCompare', function(that) { | 2014 OverrideFunction(GlobalString.prototype, 'localeCompare', function(that) { |
2045 if (!IS_UNDEFINED(new.target)) { | 2015 if (!IS_UNDEFINED(new.target)) { |
2046 throw MakeTypeError(kOrdinaryFunctionCalledAsConstructor); | 2016 throw MakeTypeError(kOrdinaryFunctionCalledAsConstructor); |
2047 } | 2017 } |
2048 | 2018 |
2049 if (IS_NULL_OR_UNDEFINED(this)) { | 2019 if (IS_NULL_OR_UNDEFINED(this)) { |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2177 } | 2147 } |
2178 | 2148 |
2179 var locales = arguments[0]; | 2149 var locales = arguments[0]; |
2180 var options = arguments[1]; | 2150 var options = arguments[1]; |
2181 return toLocaleDateTime( | 2151 return toLocaleDateTime( |
2182 this, locales, options, 'time', 'time', 'dateformattime'); | 2152 this, locales, options, 'time', 'time', 'dateformattime'); |
2183 } | 2153 } |
2184 ); | 2154 ); |
2185 | 2155 |
2186 }) | 2156 }) |
OLD | NEW |