summaryrefslogtreecommitdiffstats
path: root/chromium/third_party/catapult/third_party/polymer2/bower_components/moment/src/lib/locale/set.js
diff options
context:
space:
mode:
authorMichael BrĂ¼ning <michael.bruning@qt.io>2023-11-17 14:09:21 +0100
committerMichael BrĂ¼ning <michael.bruning@qt.io>2024-03-22 11:57:56 +0000
commit68302c9ea158fbc83cd28570a0560e5a892b45e8 (patch)
tree08c0039e3f33730a05ca4ef2340641a67419c009 /chromium/third_party/catapult/third_party/polymer2/bower_components/moment/src/lib/locale/set.js
parent38655f07d8ef13eb067e3a29bb3a0c2dc0b19716 (diff)
Enable building with Python 3
Port and fix up the patch used by the Debian project, see https://salsa.debian.org/qt-kde-team/qt/qtwebengine/-/blob/0db62e47f0e2f5e4e00193b65da912fe0083088c/debian/patches/chromium-python3.patch which in turn was largely based on a patch from ArchLinux: https://github.com/archlinux/svntogit-packages/blob/packages/qt5-webengine/trunk/qt5-webengine-chromium-python3.patch Also contains upgrades of six and catapult to build with Python 3.11 and 3.12, plus some other additional fixes, e.g. for macOS builds. Change-Id: I6b999505150495caabdcf05f6e4c7af588eff7ee Reviewed-on: https://codereview.qt-project.org/c/qt/qtwebengine-chromium/+/542809 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/third_party/catapult/third_party/polymer2/bower_components/moment/src/lib/locale/set.js')
-rw-r--r--chromium/third_party/catapult/third_party/polymer2/bower_components/moment/src/lib/locale/set.js46
1 files changed, 46 insertions, 0 deletions
diff --git a/chromium/third_party/catapult/third_party/polymer2/bower_components/moment/src/lib/locale/set.js b/chromium/third_party/catapult/third_party/polymer2/bower_components/moment/src/lib/locale/set.js
new file mode 100644
index 00000000000..45a2f46e12f
--- /dev/null
+++ b/chromium/third_party/catapult/third_party/polymer2/bower_components/moment/src/lib/locale/set.js
@@ -0,0 +1,46 @@
+import isFunction from '../utils/is-function';
+import extend from '../utils/extend';
+import isObject from '../utils/is-object';
+import hasOwnProp from '../utils/has-own-prop';
+
+export function set (config) {
+ var prop, i;
+ for (i in config) {
+ prop = config[i];
+ if (isFunction(prop)) {
+ this[i] = prop;
+ } else {
+ this['_' + i] = prop;
+ }
+ }
+ this._config = config;
+ // Lenient ordinal parsing accepts just a number in addition to
+ // number + (possibly) stuff coming from _ordinalParseLenient.
+ this._ordinalParseLenient = new RegExp(this._ordinalParse.source + '|' + (/\d{1,2}/).source);
+}
+
+export function mergeConfigs(parentConfig, childConfig) {
+ var res = extend({}, parentConfig), prop;
+ for (prop in childConfig) {
+ if (hasOwnProp(childConfig, prop)) {
+ if (isObject(parentConfig[prop]) && isObject(childConfig[prop])) {
+ res[prop] = {};
+ extend(res[prop], parentConfig[prop]);
+ extend(res[prop], childConfig[prop]);
+ } else if (childConfig[prop] != null) {
+ res[prop] = childConfig[prop];
+ } else {
+ delete res[prop];
+ }
+ }
+ }
+ for (prop in parentConfig) {
+ if (hasOwnProp(parentConfig, prop) &&
+ !hasOwnProp(childConfig, prop) &&
+ isObject(parentConfig[prop])) {
+ // make sure changes to properties don't modify parent config
+ res[prop] = extend({}, res[prop]);
+ }
+ }
+ return res;
+}