Push into calls array in calendar and timeZone observers.

This commit is contained in:
James Wright 2023-02-07 18:48:28 -08:00 committed by Ms2ger
parent 408ecd0987
commit 01425696e6

View File

@ -1498,7 +1498,7 @@ var TemporalHelpers = {
// Automatically generate the other methods that don't need any custom code
["toString", "dateUntil", "era", "eraYear", "year", "month", "monthCode", "day", "daysInMonth", "fields", "mergeFields"].forEach((methodName) => {
trackingMethods[methodName] = function (...args) {
actual.push(`call ${formatPropertyName(methodName, objectName)}`);
calls.push(`call ${formatPropertyName(methodName, objectName)}`);
if (methodName in methodOverrides) {
const value = methodOverrides[methodName];
return typeof value === "function" ? value(...args) : value;
@ -1509,11 +1509,11 @@ var TemporalHelpers = {
return new Proxy(trackingMethods, {
get(target, key, receiver) {
const result = Reflect.get(target, key, receiver);
actual.push(`get ${formatPropertyName(key, objectName)}`);
calls.push(`get ${formatPropertyName(key, objectName)}`);
return result;
},
has(target, key) {
actual.push(`has ${formatPropertyName(key, objectName)}`);
calls.push(`has ${formatPropertyName(key, objectName)}`);
return Reflect.has(target, key);
},
});
@ -1794,7 +1794,7 @@ var TemporalHelpers = {
// Automatically generate the methods
["getOffsetNanosecondsFor", "getPossibleInstantsFor", "toString"].forEach((methodName) => {
trackingMethods[methodName] = function (...args) {
actual.push(`call ${formatPropertyName(methodName, objectName)}`);
calls.push(`call ${formatPropertyName(methodName, objectName)}`);
if (methodName in methodOverrides) {
const value = methodOverrides[methodName];
return typeof value === "function" ? value(...args) : value;
@ -1805,11 +1805,11 @@ var TemporalHelpers = {
return new Proxy(trackingMethods, {
get(target, key, receiver) {
const result = Reflect.get(target, key, receiver);
actual.push(`get ${formatPropertyName(key, objectName)}`);
calls.push(`get ${formatPropertyName(key, objectName)}`);
return result;
},
has(target, key) {
actual.push(`has ${formatPropertyName(key, objectName)}`);
calls.push(`has ${formatPropertyName(key, objectName)}`);
return Reflect.has(target, key);
},
});