| /arkcompiler/runtime_core/static_core/plugins/ets/tests/ets_func_tests/std/time/ |
| D | DateChangeTest.ets | 19 failures += test(testDateChangeYear(), "Try to change date's year"); 20 failures += test(testDateChangeMonth(), "Try to change date's month"); 21 failures += test(testDateChangeDay(), "Try to set date's new day"); 44 let d = new Date(2024, 11, 31, 11, 59) 51 let d = new Date(2023, 11, 31, 11, 59) 59 let date: Date = new Date(); 60 let year = date.getFullYear(); 61 date.setFullYear(year - 1); 63 if(date.getFullYear() == (year - 1)) return 0; 69 let tmp = new Date(year, month + 1, 0); [all …]
|
| D | DateConstructorTest.ets | 17 const suite = new ArkTestsuite("Date") 36 suite.addTest("Test constructor with Date object", testDateConstructor) 70 let cd = new Date(longYears[i]); 77 let cd = new Date(longYears[i], longMonths[i]); 78 let utc = Date.UTC(longYears[i], longMonths[i]); 88 let cd = new Date(longYears[i], longMonths[i], day); 89 let utc = Date.UTC(longYears[i], longMonths[i], day); 99 let cd = new Date(longYears[i], longMonths[i], day, longHours[i]); 100 let utc = Date.UTC(longYears[i], longMonths[i], day, longHours[i]); 110 let cd = new Date(longYears[i], longMonths[i], day, longHours[i], longMinutes[i]); [all …]
|
| /arkcompiler/ets_runtime/ecmascript/builtins/ |
| D | builtins_date.h | 22 // List of functions in Date, excluding the '@@' properties. 24 // where BuiltinsDate::func refers to the native implementation of Date[name]. 27 … /* Date.now ( ) */ \ 29 … /* Date.parse ( string ) */ \ 31 … /* Date.UTC ( year [ , month [ , date [ , hours [ , minutes [ , seconds [ , ms ] ] ] ] ] ] ) */ \ 34 // List of functions in Date.prototype, excluding the constructor and '@@' properties. 36 // where BuiltinsDate::func refers to the native implementation of Date.prototype[name]. 38 /* Date.prototype.getDate ( ) */ \ 40 /* Date.prototype.getDay ( ) */ \ 42 /* Date.prototype.getFullYear ( ) */ \ [all …]
|
| /arkcompiler/ets_frontend/test262/ |
| D | ignored-test262-other-release-qemu-aot-pgo-litecg.txt | 2 test262/data/other_tests/built-ins/Date/UTC/fp-evaluation-order.js 5 test262/data/other_tests/built-ins/Date/prototype/setDate/arg-coercion-order.js 6 test262/data/other_tests/built-ins/Date/prototype/setHours/arg-coercion-order.js 7 test262/data/other_tests/built-ins/Date/prototype/setMilliseconds/arg-coercion-order.js 8 test262/data/other_tests/built-ins/Date/prototype/setMilliseconds/this-value-invalid-date.js 9 test262/data/other_tests/built-ins/Date/prototype/setMinutes/arg-coercion-order.js 10 test262/data/other_tests/built-ins/Date/prototype/setMonth/arg-coercion-order.js 11 test262/data/other_tests/built-ins/Date/prototype/setSeconds/arg-coercion-order.js 12 test262/data/other_tests/built-ins/Date/prototype/setSeconds/this-value-invalid-date.js 13 test262/data/other_tests/built-ins/Date/prototype/setUTCDate/arg-coercion-order.js [all …]
|
| D | ignored-test262-other-release-qemu-aot-pgo.txt | 2 test262/data/other_tests/built-ins/Date/UTC/fp-evaluation-order.js 5 test262/data/other_tests/built-ins/Date/prototype/setDate/this-value-invalid-date.js 6 test262/data/other_tests/built-ins/Date/prototype/setHours/this-value-invalid-date.js 7 test262/data/other_tests/built-ins/Date/prototype/setMilliseconds/this-value-invalid-date.js 8 test262/data/other_tests/built-ins/Date/prototype/setMinutes/arg-coercion-order.js 9 test262/data/other_tests/built-ins/Date/prototype/setMinutes/this-value-invalid-date.js 10 test262/data/other_tests/built-ins/Date/prototype/setMonth/arg-coercion-order.js 11 test262/data/other_tests/built-ins/Date/prototype/setMonth/this-value-invalid-date.js 12 test262/data/other_tests/built-ins/Date/prototype/setSeconds/this-value-invalid-date.js 16 test262/data/other_tests/built-ins/Date/prototype/setDate/arg-coercion-order.js [all …]
|
| D | ignored-test262-other-fastverify-qemu-aot-pgo.txt | 29 test262/data/other_tests/built-ins/Date/UTC/fp-evaluation-order.js 32 test262/data/other_tests/built-ins/Date/prototype/setDate/arg-coercion-order.js 33 test262/data/other_tests/built-ins/Date/prototype/setHours/arg-coercion-order.js 34 test262/data/other_tests/built-ins/Date/prototype/setMilliseconds/arg-coercion-order.js 35 test262/data/other_tests/built-ins/Date/prototype/setMinutes/arg-coercion-order.js 36 test262/data/other_tests/built-ins/Date/prototype/setMinutes/this-value-invalid-date.js 37 test262/data/other_tests/built-ins/Date/prototype/setMonth/this-value-invalid-date.js 38 test262/data/other_tests/built-ins/Date/prototype/setSeconds/arg-coercion-order.js 39 test262/data/other_tests/built-ins/Date/prototype/setSeconds/this-value-invalid-date.js 40 test262/data/other_tests/built-ins/Date/prototype/setUTCDate/arg-coercion-order.js [all …]
|
| D | ignored-test262-other-fastverify-qemu-int.txt | 27 test262/data/other_tests/built-ins/Date/UTC/fp-evaluation-order.js 30 test262/data/other_tests/built-ins/Date/prototype/setDate/arg-coercion-order.js 31 test262/data/other_tests/built-ins/Date/prototype/setHours/arg-coercion-order.js 32 test262/data/other_tests/built-ins/Date/prototype/setMilliseconds/arg-coercion-order.js 33 test262/data/other_tests/built-ins/Date/prototype/setMinutes/arg-coercion-order.js 34 test262/data/other_tests/built-ins/Date/prototype/setMonth/arg-coercion-order.js 35 test262/data/other_tests/built-ins/Date/prototype/setMonth/this-value-invalid-date.js 36 test262/data/other_tests/built-ins/Date/prototype/setSeconds/arg-coercion-order.js 37 test262/data/other_tests/built-ins/Date/prototype/setSeconds/this-value-invalid-date.js 38 test262/data/other_tests/built-ins/Date/prototype/setUTCDate/arg-coercion-order.js [all …]
|
| D | ignored-test262-other-fastverify-qemu-aot-pgo-litecg.txt | 40 test262/data/other_tests/built-ins/Date/UTC/fp-evaluation-order.js 43 test262/data/other_tests/built-ins/Date/prototype/setDate/arg-coercion-order.js 44 test262/data/other_tests/built-ins/Date/prototype/setHours/arg-coercion-order.js 45 test262/data/other_tests/built-ins/Date/prototype/setMilliseconds/arg-coercion-order.js 46 test262/data/other_tests/built-ins/Date/prototype/setMinutes/arg-coercion-order.js 47 test262/data/other_tests/built-ins/Date/prototype/setMonth/arg-coercion-order.js 48 test262/data/other_tests/built-ins/Date/prototype/setMonth/this-value-invalid-date.js 49 test262/data/other_tests/built-ins/Date/prototype/setSeconds/arg-coercion-order.js 50 test262/data/other_tests/built-ins/Date/prototype/setUTCDate/arg-coercion-order.js 51 test262/data/other_tests/built-ins/Date/prototype/setUTCHours/arg-coercion-order.js [all …]
|
| /arkcompiler/runtime_core/static_core/plugins/ets/tests/interop_js/tests/date/ts_to_ets/ |
| D | test_date.ets | 16 package date.test; 22 return val instanceof Date; 25 function funDateInstanceOf(val: Date) { 26 return val instanceof Date; 29 function funDateTypeOf(val: Date) { 33 function funDateGetFullYear(val: Date) { 37 function funDateGetMonth(val: Date) { 41 function funDateGetDate(val: Date) { 45 function funDateGetDay(val: Date) { 49 function funDateGetHours(val: Date) { [all …]
|
| /arkcompiler/runtime_core/static_core/plugins/ets/tests/ets_func_tests/std/core/tolocalestr/ |
| D | DateLocaleStringTest.ets | 17 const date = new Date(2024, 1, 19, 10, 0, 0) 22 assertEQ(date.toLocaleString(langTag), "2024/2/19 10:00:00") 23 assertEQ(date.toLocaleString(locale), "2024/2/19 10:00:00") 24 assertEQ(date.toLocaleString(), date.toLocaleString(undefined)) 27 assertEQ(date.toLocaleString(locale, options), "10:00:00") 31 const date = new Date(2024, 1, 19, 10, 0, 0) 36 assertEQ(date.toLocaleTimeString(langTag), "10:00:00") 37 assertEQ(date.toLocaleTimeString(locale), "10:00:00") 47 assertEQ(date.toLocaleTimeString(langTag, options), "24/02/19 10:00") 48 assertEQ(date.toLocaleTimeString(locale, options), "24/02/19 10:00") [all …]
|
| /arkcompiler/ets_runtime/test/aottest/builtin_inlining/date/Now/ |
| D | builtinDateNow.ts | 27 return Date.now(x); 31 return Date.now(); 49 //aot: [trace] aot inline builtin: Date.now, caller function name:func_main_0@builtinDateNow 50 print(Date.now()); //: __INT__ 58 //aot: [trace] aot inline builtin: Date.now, caller function name:func_main_0@builtinDateNow 59 print(Date.now()); //: __INT_MORE_PREV__ 65 //aot: [trace] aot inline builtin: Date.now, caller function name:func_main_0@builtinDateNow 66 print(Date.now(0)); //: __INT__ 67 //aot: [trace] aot inline builtin: Date.now, caller function name:func_main_0@builtinDateNow 68 print(Date.now(1, 2)); //: __INT__ [all …]
|
| /arkcompiler/ets_runtime/test/perform/string/ |
| D | string.js | 18 const time1 = Date.now() 22 const time2 = Date.now() 31 const time1 = Date.now() 35 const time2 = Date.now() 44 const time1 = Date.now() 48 const time2 = Date.now() 55 const time1 = Date.now() 59 const time2 = Date.now() 66 const time1 = Date.now() 70 const time2 = Date.now() [all …]
|
| /arkcompiler/runtime_core/static_core/plugins/ets/tests/ets_func_tests/std/core/dateformat/ |
| D | DateTimeFormatTest.ets | 16 const FORMAT_RESULTS = new Array<[Date, string | undefined, Intl.DateTimeFormatOptions | undefined,… 17 function addDateFormatResult(date: Date, locale: string | undefined, options: Intl.DateTimeFormatOp… 18 …const formatResult: [Date, string | undefined, Intl.DateTimeFormatOptions | undefined, string] = [… 29 const testDate = new Date("2023-10-05T15:10:20.300Z") 43 …FORMAT_RESULTS.forEach((formatResult: [Date, string | undefined, Intl.DateTimeFormatOptions | unde… 49 const date = formatResult[0] 52 assertEQ(formattedDate, dateFormat.format(date), `failed result index: ${index}`) 58 const date = new Date("2020-03-03") 60 const dateStr = defaultLocaleFormat.format(date) 66 assertEQ(dateStr, undefLocaleFormat.format(date)) [all …]
|
| /arkcompiler/runtime_core/static_core/plugins/ets/tests/ets_sdk/api/@ohos/util/types/ |
| D | IsDateTest.ets | 21 suite.addTest("Verify Date is identified as Date", testIsDate001) 22 suite.addTest("Verify Int8Array is not identified as Date", testIsDate002) 23 suite.addTest("Verify Boolean is not identified as Date", testIsDate003) 24 suite.addTest("Verify Int16Array is not identified as Date", testIsDate004) 25 suite.addTest("Verify Float64Array is not identified as Date", testIsDate005) 33 * @tc.desc: Verify Date is identified as Date 40 let result = proc.isDate(new Date()); 41 assertTrue(result, "The Date should be of the same type as the Date"); 46 * @tc.desc: Verify Int8Array is not identified as Date 54 assertTrue(result == false, "The Int8Array should not be of the same type as the Date"); [all …]
|
| /arkcompiler/runtime_core/static_core/plugins/ets/tests/ets_es_checked/ |
| D | date.yaml | 14 category: Date 16 - expr: new Date(pars).getTimezoneOffset() 24 - expr: new Date(pars).valueOf() 32 - expr: new Date(pars).getFullYear() 35 - expr: new Date(pars).getMonth() 38 - expr: new Date(pars).getDate() 41 - expr: new Date(pars).getDay() 44 - expr: new Date(pars).getHours() 47 - expr: new Date(pars).getMinutes() 50 - expr: new Date(pars).getSeconds() [all …]
|
| /arkcompiler/runtime_core/static_core/plugins/ets/tests/ets-templates/10.interfaces/07.interface_inheritance/superinterfaces_and_subinterfaces/verify_constant_values_subinterface_class/ |
| D | constants_genericclass_in_subclass_interface_04.ets | 17 desc: Verify whether the constant values genericclass<Date[]> remain consistent in the subclass int… 29 readonly CONSTANT_VALUE: GenericClass<Date[]>; 32 const date = new Date(2023, 10, 1); 33 const temp_value: Date[] = [date, date]; 38 readonly CONSTANT_VALUE: GenericClass<Date[]> = new GenericClass<Date[]>(temp_value); 45 assertEQ(sub.CONSTANT_VALUE.value[0], date);
|
| D | constants_genericclass_in_subclass_interface_24.ets | 17 desc: Verify whether the constant values genericclass<Date[]> remain consistent in the subclass int… 30 const CONSTANT_VALUE: GenericClass<Date[]>; 33 const date = new Date(2023, 10, 1); 34 const temp_value: Date[] = [date, date]; 39 const CONSTANT_VALUE: GenericClass<Date[]> = new GenericClass<Date[]>(temp_value);
|
| D | constants_array_date_in_subclass_interface_01.ets | 17 desc: Verify whether the constant values Date[] remain consistent in the subclass interface. 20 const date = new Date(2023, 10, 1); 23 readonly CONSTANT_VALUE: Date[]; 29 readonly CONSTANT_VALUE: Date[] = [date, date]; 36 assertEQ(sub.CONSTANT_VALUE[0], date);
|
| /arkcompiler/runtime_core/static_core/plugins/ets/tests/ets-templates/10.interfaces/07.interface_inheritance/Interface_inheritance_class_implementation/child_interface_constants_inheritance_verification/ |
| D | child_interface_constants_inheritance_verification_23.ets | 17 desc: Verify that a child class can access an array of Date constants from an interface. 21 readonly CONST: [Date, Date]; 25 readonly CONST: [Date, Date] = [new Date('2023-01-01'), new Date('2023-02-02')]; 30 assertTrue(instance.CONST[0] instanceof Date); 31 assertTrue(instance.CONST[1] instanceof Date);
|
| /arkcompiler/runtime_core/static_core/plugins/ets/stdlib/escompat/ |
| D | Date.ets | 18 // TODO To offer protection against timing attacks and fingerprinting, the precision of `Date.getTi… 19 // `Date.now()` might get rounded depending on browser (target) settings. 161 * @returns Date number (within month). 318 * @param date 322 function ecmaMakeDay(year: long, month: long, date: long): long { 330 …FromYear(ym).toLong() + (getFirstDayInMonth(ecmaInLeapYear(ym), mn)).toLong() + (date as long) - 1; 420 * Date JS API-compatible class 422 export class Date { 444 /** Stored value of Date, milliseconds */ 447 return Date.getLocalTimezoneOffset(this.ms as long); [all …]
|
| /arkcompiler/ets_runtime/test/aottest/builtin_inlining/date/GetTime/ |
| D | builtinDateGetTime.ts | 48 let time = new Date('July 20, 99 20:17:40 GMT+00:00') 49 //aot: [trace] aot inline builtin: Date.prototype.getTime, caller function name:func_main_0@builtin… 52 time = new Date(990000000000) 53 //aot: [trace] aot inline builtin: Date.prototype.getTime, caller function name:func_main_0@builtin… 55 //aot: [trace] aot inline builtin: Date.prototype.getTime, caller function name:func_main_0@builtin… 59 time = new Date(1990, 2, 15, 16, 17, 18); 60 //aot: [trace] aot inline builtin: Date.prototype.getTime, caller function name:func_main_0@builtin… 62 //aot: [trace] aot inline builtin: Date.prototype.getTime, caller function name:func_main_0@builtin… 64 //aot: [trace] aot inline builtin: Date.prototype.getTime, caller function name:func_main_0@builtin… 66 //aot: [trace] aot inline builtin: Date.prototype.getTime, caller function name:func_main_0@builtin… [all …]
|
| /arkcompiler/runtime_core/static_core/plugins/ets/tests/ets-templates/09.classes/01.class_declaration/03.class_extension_clause/initialize_members/ |
| D | initialize_members_17.ets | 17 desc: To verify that the parent class member variable (type Date) is correctly initialized. 20 const date = new Date(2023, 10, 1); 23 public value: Date; 25 constructor(value: Date) { 31 constructor(value: Date) { 37 const myChild = new Child(date); 38 assertEQ(myChild.value, date);
|
| /arkcompiler/runtime_core/static_core/plugins/ets/tests/ets-templates/09.classes/01.class_declaration/03.class_extension_clause/accessing_parent_class/ |
| D | accessing_parent_class_public_array_date_02.ets | 17 desc: Subclasses accessing the initialization readonly Date[] of parent class members. 20 const date = new Date(2023, 10, 1); 23 public readonly value: Date[]; 25 this.value = [date, date]; 29 let check_value: Date | undefined; 44 assertEQ(check_value, date);
|
| D | accessing_parent_class_protected_array_date_02.ets | 17 desc: Subclasses accessing the initialization readonly Date[] of parent class members. 20 const date = new Date(2023, 10, 1); 23 protected readonly value: Date[]; 25 this.value = [date, date]; 29 let check_value: Date | undefined; 44 assertEQ(check_value, date);
|
| D | accessing_parent_class_protected_array_date_01.ets | 17 desc: Subclasses accessing the initialization Date[] of parent class members. 20 const date = new Date(2023, 10, 1); 23 protected value: Date[]; 25 this.value = [date, date]; 29 let check_value: Date | undefined; 44 assertEQ(check_value, date);
|