Class JSDate
java.lang.Object
com.oracle.truffle.js.runtime.builtins.JSClass
com.oracle.truffle.js.runtime.builtins.JSNonProxy
com.oracle.truffle.js.runtime.builtins.JSDate
- All Implemented Interfaces:
JSConstructorFactory,JSConstructorFactory.WithFunctions,PrototypeSupplier
public final class JSDate
extends JSNonProxy
implements JSConstructorFactory.WithFunctions, PrototypeSupplier
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.oracle.truffle.js.runtime.builtins.JSConstructorFactory
JSConstructorFactory.Default, JSConstructorFactory.WithFunctions, JSConstructorFactory.WithFunctionsAndSpecies -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.oracle.truffle.api.strings.TruffleStringstatic final JSDatestatic final com.oracle.truffle.api.strings.TruffleStringstatic final doublestatic final doublestatic final doublestatic final intstatic final intstatic final intstatic final intstatic final com.oracle.truffle.api.strings.TruffleStringFields inherited from class com.oracle.truffle.js.runtime.builtins.JSNonProxy
GET_SYMBOL_SPECIES_NAME -
Method Summary
Modifier and TypeMethodDescriptionstatic InstantasInstant(JSDateObject date) static LocalDateasLocalDate(JSDateObject date, JSRealm realm) static LocalTimeasLocalTime(JSDateObject date, JSRealm realm) static JSDateObjectstatic JSDateObjectcreate(JSContext context, JSRealm realm, JSDynamicObject proto, double timeMillis) static JSConstructorcreateConstructor(JSRealm realm) createPrototype(JSRealm realm, JSFunctionObject ctor) static intdateFromDayInYear(int year, int day) static intdateFromTime(double dt) static doubleday(double t) static intdayFromYear(int y) static doubleexecuteConstructor(double[] argsEvaluated, boolean inputIsUTC) static com.oracle.truffle.api.strings.TruffleStringformat(org.graalvm.shadowed.com.ibm.icu.text.DateFormat format, double time) com.oracle.truffle.api.strings.TruffleStringstatic doublegetDateValueFromInstant(Object receiver, com.oracle.truffle.api.interop.InteropLibrary interop) getIntrinsicDefaultProto(JSRealm realm) Allows invokevirtual of this method instead of invokeinterface.static doublestatic inthourFromTime(double t) static booleanstatic booleanisLeapYear(int year) static longisoDateToEpochDays(int year, int month, int date) static booleanisTimeValid(double time) static booleanisValidDate(JSDateObject date) static doublelocalTime(double t, com.oracle.truffle.api.nodes.Node node) static longlocalTZA(double t, boolean isUTC, com.oracle.truffle.api.nodes.Node node) static intlocalTZA(double t, boolean isUTC, org.graalvm.shadowed.com.ibm.icu.util.TimeZone timeZone) static doublemakeDate(double day, double time) static doublemakeDate(double y, double m, double d, double h, double min, double sec, double ms, Integer timezone) static doublemakeDay(double year, double month, double date) com.oracle.truffle.api.object.ShapemakeInitialShape(JSContext ctx, JSDynamicObject prototype) static doublemakeTime(double hour, double min, double sec, double ms) static intminFromTime(double t) static intmonthFromTime(double dt) static intmsFromTime(double t) static intsecFromTime(double t) static doublesetDate(double tParam, double date, boolean isUTC, com.oracle.truffle.api.nodes.Node node) static doublesetFullYear(double tParam, double year, double month, boolean monthSpecified, double date, boolean dateSpecified, boolean isUTC, com.oracle.truffle.api.nodes.Node node) static doublesetHours(double tParam, double h, double m, boolean mSpecified, double s, boolean sSpecified, double ms, boolean msSpecified, boolean isUTC, com.oracle.truffle.api.nodes.Node node) static doublesetMilliseconds(double tParam, double ms, boolean isUTC, com.oracle.truffle.api.nodes.Node node) static doublesetMinutes(double tParam, double m, double s, boolean sSpecified, double ms, boolean msSpecified, boolean isUTC, com.oracle.truffle.api.nodes.Node node) static doublesetMonth(double tParam, double month, double date, boolean dateSpecified, boolean isUTC, com.oracle.truffle.api.nodes.Node node) static doublesetSeconds(double tParam, double s, double ms, boolean msSpecified, boolean isUTC, com.oracle.truffle.api.nodes.Node node) static doublesetTime(JSDateObject thisDate, double time) static voidsetTimeMillisField(JSDateObject obj, double timeMillis) static doublesetYear(double tParam, double year, com.oracle.truffle.api.nodes.Node node) static doubletimeClip(double time) Implementation of ECMAScript 5.1 15.9.1.14 TimeClip.static com.oracle.truffle.api.strings.TruffleStringtoISOStringIntl(double time, JSRealm realm) static com.oracle.truffle.api.strings.TruffleStringstatic doubleweekDay(double t) static intyearFromDays(int daysAfter1970) static intyearFromTime(long t) Methods inherited from class com.oracle.truffle.js.runtime.builtins.JSNonProxy
checkProtoCycle, createSymbolSpeciesGetterFunction, defineOwnProperty, delete, delete, deletePropertyDefault, getHelper, getHelper, getMethodHelper, getOwnHelper, getOwnHelper, getOwnProperty, getOwnPropertyKeys, getPrototypeOf, hasOnlyShapeProperties, hasOwnProperty, hasOwnProperty, hasProperty, hasProperty, invokeAccessorPropertySetter, isExtensible, ordinaryGetOwnProperty, ordinaryGetOwnPropertyIntl, ordinaryIsExtensible, ordinaryOwnPropertyKeys, ordinaryOwnPropertyKeys, ordinaryOwnPropertyKeysSlow, ordinaryPreventExtensions, ordinarySet, ordinarySetIndex, ordinarySetWithReceiver, performOrdinarySetWithOwnDescriptor, preventExtensions, putConstructorSpeciesGetter, set, set, setIntegrityLevelFast, setPropertySlow, setPrototypeOf, testIntegrityLevelFast, usesOrdinaryGetOwnProperty, usesOrdinaryIsExtensibleMethods inherited from class com.oracle.truffle.js.runtime.builtins.JSClass
filterOwnPropertyKeys, get, get, isInstance, isInstance, isInstance, isInstance, ownPropertyKeys, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.oracle.truffle.js.runtime.builtins.JSConstructorFactory
createConstructorObject, fillConstructorMethods inherited from interface com.oracle.truffle.js.runtime.builtins.JSConstructorFactory.WithFunctions
createConstructorAndPrototype
-
Field Details
-
CLASS_NAME
public static final com.oracle.truffle.api.strings.TruffleString CLASS_NAME -
PROTOTYPE_NAME
public static final com.oracle.truffle.api.strings.TruffleString PROTOTYPE_NAME -
INSTANCE
-
MS_PER_SECOND
public static final int MS_PER_SECOND- See Also:
-
MS_PER_MINUTE
public static final int MS_PER_MINUTE- See Also:
-
MS_PER_HOUR
public static final int MS_PER_HOUR- See Also:
-
MS_PER_DAY
public static final int MS_PER_DAY- See Also:
-
MAX_DATE
public static final double MAX_DATE- See Also:
-
MAX_YEAR_VALUE
public static final double MAX_YEAR_VALUE- See Also:
-
MIN_YEAR_VALUE
public static final double MIN_YEAR_VALUE- See Also:
-
INVALID_DATE_STRING
public static final com.oracle.truffle.api.strings.TruffleString INVALID_DATE_STRING
-
-
Method Details
-
setTimeMillisField
-
getTimeMillisField
-
isJSDate
-
getClassName
public com.oracle.truffle.api.strings.TruffleString getClassName()- Specified by:
getClassNamein interfaceJSConstructorFactory
-
createPrototype
- Specified by:
createPrototypein interfaceJSConstructorFactory
-
makeInitialShape
public com.oracle.truffle.api.object.Shape makeInitialShape(JSContext ctx, JSDynamicObject prototype) - Overrides:
makeInitialShapein classJSClass
-
createConstructor
-
executeConstructor
public static double executeConstructor(double[] argsEvaluated, boolean inputIsUTC) -
day
public static double day(double t) -
dayFromYear
public static int dayFromYear(int y) -
yearFromTime
public static int yearFromTime(long t) -
yearFromDays
public static int yearFromDays(int daysAfter1970) -
isLeapYear
public static boolean isLeapYear(int year) -
monthFromTime
public static int monthFromTime(double dt) -
dateFromTime
public static int dateFromTime(double dt) -
dateFromDayInYear
public static int dateFromDayInYear(int year, int day) -
weekDay
public static double weekDay(double t) -
localTime
public static double localTime(double t, com.oracle.truffle.api.nodes.Node node) -
localTZA
public static long localTZA(double t, boolean isUTC, com.oracle.truffle.api.nodes.Node node) -
localTZA
public static int localTZA(double t, boolean isUTC, org.graalvm.shadowed.com.ibm.icu.util.TimeZone timeZone) -
hourFromTime
public static int hourFromTime(double t) -
minFromTime
public static int minFromTime(double t) -
secFromTime
public static int secFromTime(double t) -
msFromTime
public static int msFromTime(double t) -
makeTime
public static double makeTime(double hour, double min, double sec, double ms) -
makeDay
public static double makeDay(double year, double month, double date) -
isoDateToEpochDays
public static long isoDateToEpochDays(int year, int month, int date) -
makeDate
public static double makeDate(double day, double time) -
makeDate
public static double makeDate(double y, double m, double d, double h, double min, double sec, double ms, Integer timezone) -
timeClip
public static double timeClip(double time) Implementation of ECMAScript 5.1 15.9.1.14 TimeClip. -
create
-
create
public static JSDateObject create(JSContext context, JSRealm realm, JSDynamicObject proto, double timeMillis) -
setTime
-
setMilliseconds
public static double setMilliseconds(double tParam, double ms, boolean isUTC, com.oracle.truffle.api.nodes.Node node) -
setSeconds
public static double setSeconds(double tParam, double s, double ms, boolean msSpecified, boolean isUTC, com.oracle.truffle.api.nodes.Node node) -
setMinutes
public static double setMinutes(double tParam, double m, double s, boolean sSpecified, double ms, boolean msSpecified, boolean isUTC, com.oracle.truffle.api.nodes.Node node) -
setHours
public static double setHours(double tParam, double h, double m, boolean mSpecified, double s, boolean sSpecified, double ms, boolean msSpecified, boolean isUTC, com.oracle.truffle.api.nodes.Node node) -
setDate
public static double setDate(double tParam, double date, boolean isUTC, com.oracle.truffle.api.nodes.Node node) -
setMonth
public static double setMonth(double tParam, double month, double date, boolean dateSpecified, boolean isUTC, com.oracle.truffle.api.nodes.Node node) -
setFullYear
public static double setFullYear(double tParam, double year, double month, boolean monthSpecified, double date, boolean dateSpecified, boolean isUTC, com.oracle.truffle.api.nodes.Node node) -
setYear
public static double setYear(double tParam, double year, com.oracle.truffle.api.nodes.Node node) -
format
public static com.oracle.truffle.api.strings.TruffleString format(org.graalvm.shadowed.com.ibm.icu.text.DateFormat format, double time) -
toString
-
toISOStringIntl
public static com.oracle.truffle.api.strings.TruffleString toISOStringIntl(double time, JSRealm realm) -
isTimeValid
public static boolean isTimeValid(double time) -
isValidDate
-
asInstant
-
asLocalDate
-
asLocalTime
-
getDateValueFromInstant
public static double getDateValueFromInstant(Object receiver, com.oracle.truffle.api.interop.InteropLibrary interop) -
getIntrinsicDefaultProto
Description copied from class:JSClassAllows invokevirtual of this method instead of invokeinterface. Classes overriding this method should implementPrototypeSupplier.- Specified by:
getIntrinsicDefaultProtoin interfacePrototypeSupplier- Overrides:
getIntrinsicDefaultProtoin classJSClass- See Also:
-