Panel Plugins: Change array methods from read-only to writable (#71315)

This commit is contained in:
Oleg Yevik 2023-07-12 04:13:22 +12:00 committed by GitHub
parent b39c8aec6c
commit 864bf28a55
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -19,33 +19,33 @@ if (!Object.getOwnPropertyDescriptor(Array.prototype, 'toArray')) {
value: function (idx: number): any {
return (this as any)[idx];
},
writable: false,
writable: true,
enumerable: false,
configurable: false,
configurable: true,
},
set: {
value: function (idx: number, value: any) {
(this as any)[idx] = value;
},
writable: false,
writable: true,
enumerable: false,
configurable: false,
configurable: true,
},
add: {
value: function (value: any) {
(this as any).push(value);
},
writable: false,
writable: true,
enumerable: false,
configurable: false,
configurable: true,
},
toArray: {
value: function () {
return this;
},
writable: false,
writable: true,
enumerable: false,
configurable: false,
configurable: true,
},
});
}