OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
370 addWECPropertyIfDefined(result, 'weekday', fromPattern.weekday); | 370 addWECPropertyIfDefined(result, 'weekday', fromPattern.weekday); |
371 addWECPropertyIfDefined(result, 'hour12', fromPattern.hour12); | 371 addWECPropertyIfDefined(result, 'hour12', fromPattern.hour12); |
372 addWECPropertyIfDefined(result, 'hour', fromPattern.hour); | 372 addWECPropertyIfDefined(result, 'hour', fromPattern.hour); |
373 addWECPropertyIfDefined(result, 'minute', fromPattern.minute); | 373 addWECPropertyIfDefined(result, 'minute', fromPattern.minute); |
374 addWECPropertyIfDefined(result, 'second', fromPattern.second); | 374 addWECPropertyIfDefined(result, 'second', fromPattern.second); |
375 | 375 |
376 return result; | 376 return result; |
377 }, | 377 }, |
378 ATTRIBUTES.DONT_ENUM | 378 ATTRIBUTES.DONT_ENUM |
379 ); | 379 ); |
| 380 %FunctionSetName(Intl.DateTimeFormat.prototype.resolvedOptions, |
| 381 'resolvedOptions'); |
380 %FunctionRemovePrototype(Intl.DateTimeFormat.prototype.resolvedOptions); | 382 %FunctionRemovePrototype(Intl.DateTimeFormat.prototype.resolvedOptions); |
| 383 %SetNativeFlag(Intl.DateTimeFormat.prototype.resolvedOptions); |
381 | 384 |
382 | 385 |
383 /** | 386 /** |
384 * Returns the subset of the given locale list for which this locale list | 387 * Returns the subset of the given locale list for which this locale list |
385 * has a matching (possibly fallback) locale. Locales appear in the same | 388 * has a matching (possibly fallback) locale. Locales appear in the same |
386 * order in the returned list as in the input list. | 389 * order in the returned list as in the input list. |
387 * Options are optional parameter. | 390 * Options are optional parameter. |
388 */ | 391 */ |
389 %SetProperty(Intl.DateTimeFormat, 'supportedLocalesOf', function(locales) { | 392 %SetProperty(Intl.DateTimeFormat, 'supportedLocalesOf', function(locales) { |
390 if (%_IsConstructCall()) { | 393 if (%_IsConstructCall()) { |
391 throw new TypeError(ORDINARY_FUNCTION_CALLED_AS_CONSTRUCTOR); | 394 throw new TypeError(ORDINARY_FUNCTION_CALLED_AS_CONSTRUCTOR); |
392 } | 395 } |
393 | 396 |
394 return supportedLocalesOf('dateformat', locales, arguments[1]); | 397 return supportedLocalesOf('dateformat', locales, arguments[1]); |
395 }, | 398 }, |
396 ATTRIBUTES.DONT_ENUM | 399 ATTRIBUTES.DONT_ENUM |
397 ); | 400 ); |
| 401 %FunctionSetName(Intl.DateTimeFormat.supportedLocalesOf, 'supportedLocalesOf'); |
398 %FunctionRemovePrototype(Intl.DateTimeFormat.supportedLocalesOf); | 402 %FunctionRemovePrototype(Intl.DateTimeFormat.supportedLocalesOf); |
| 403 %SetNativeFlag(Intl.DateTimeFormat.supportedLocalesOf); |
399 | 404 |
400 | 405 |
401 /** | 406 /** |
402 * Returns a String value representing the result of calling ToNumber(date) | 407 * Returns a String value representing the result of calling ToNumber(date) |
403 * according to the effective locale and the formatting options of this | 408 * according to the effective locale and the formatting options of this |
404 * DateTimeFormat. | 409 * DateTimeFormat. |
405 */ | 410 */ |
406 function formatDate(formatter, dateValue) { | 411 function formatDate(formatter, dateValue) { |
407 native function NativeJSInternalDateFormat(); | 412 native function NativeJSInternalDateFormat(); |
408 | 413 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
464 | 469 |
465 var result = toTitleCaseWord(match[1]) + '/' + toTitleCaseWord(match[2]); | 470 var result = toTitleCaseWord(match[1]) + '/' + toTitleCaseWord(match[2]); |
466 var i = 3; | 471 var i = 3; |
467 while (match[i] !== undefined && i < match.length) { | 472 while (match[i] !== undefined && i < match.length) { |
468 result = result + '_' + toTitleCaseWord(match[i]); | 473 result = result + '_' + toTitleCaseWord(match[i]); |
469 i++; | 474 i++; |
470 } | 475 } |
471 | 476 |
472 return result; | 477 return result; |
473 } | 478 } |
OLD | NEW |