mirror of
https://github.com/tc39/test262.git
synced 2025-07-27 07:54:41 +02:00
Push into calls array in calendar and timeZone observers.
This commit is contained in:
parent
408ecd0987
commit
01425696e6
@ -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);
|
||||
},
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user