Commit 09090221 authored by Frank Tang's avatar Frank Tang Committed by Commit Bot

[Intl] remove dead code toDateTimeOptions in src/js/intl.js

Bug: v8:7961
Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng
Change-Id: I1d7f0a9e6e44cb34799f074ffa9fe8ca39bcef2b
Reviewed-on: https://chromium-review.googlesource.com/1198766Reviewed-by: 's avatarSathya Gunasekaran <gsathya@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55561}
parent bc1872d9
......@@ -830,65 +830,6 @@ function appendToLDMLString(option, pairs) {
}
}
/**
* Returns options with at least default values in it.
*/
function toDateTimeOptions(options, required, defaults) {
if (IS_UNDEFINED(options)) {
options = {__proto__: null};
} else {
options = TO_OBJECT(options);
}
options = %object_create(options);
var needsDefault = true;
if ((required === 'date' || required === 'any') &&
(!IS_UNDEFINED(options.weekday) || !IS_UNDEFINED(options.year) ||
!IS_UNDEFINED(options.month) || !IS_UNDEFINED(options.day))) {
needsDefault = false;
}
if ((required === 'time' || required === 'any') &&
(!IS_UNDEFINED(options.hour) || !IS_UNDEFINED(options.minute) ||
!IS_UNDEFINED(options.second))) {
needsDefault = false;
}
if (needsDefault && (defaults === 'date' || defaults === 'all')) {
%object_define_property(options, 'year', {value: 'numeric',
writable: true,
enumerable: true,
configurable: true});
%object_define_property(options, 'month', {value: 'numeric',
writable: true,
enumerable: true,
configurable: true});
%object_define_property(options, 'day', {value: 'numeric',
writable: true,
enumerable: true,
configurable: true});
}
if (needsDefault && (defaults === 'time' || defaults === 'all')) {
%object_define_property(options, 'hour', {value: 'numeric',
writable: true,
enumerable: true,
configurable: true});
%object_define_property(options, 'minute', {value: 'numeric',
writable: true,
enumerable: true,
configurable: true});
%object_define_property(options, 'second', {value: 'numeric',
writable: true,
enumerable: true,
configurable: true});
}
return options;
}
/**
* Initializes the given object so it's a valid DateTimeFormat instance.
* Useful for subclassing.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment