davidot
67865306d3
LibJS: Fix that functions in module did not look for var declarations
2022-11-15 12:00:36 +00:00
davidot
385c2f2eb8
LibJS: Use correct this value for tagged template calls
...
This has to get quite messy because we currently do evaluation to value
and reference separately meaning we have to deal with a lot of edge
cases here.
2022-11-15 12:00:36 +00:00
davidot
b3edd94869
LibJS: Treat '\\' as an escaped character in template literals
...
Before this change we would ignore that the second backslash is escaped
and template strings ending with ` \\` would be unterminated as the
second slash was used to escape the closing quote.
2022-11-15 12:00:36 +00:00
Luke Wilde
08750f69e4
LibJS: Add thorough tests for try/finally using continue and break
...
I wrote these tests a while ago while trying to improve the bytecode,
but didn't end up making them pass and gave up. They work in AST
interpreter mode, so we can have them in now to have them around for
anyone who wants to try and make them pass in bytecode.
2022-11-08 21:10:53 +00:00
Timothy Flynn
8eec25b7ae
LibJS: Use more accurate number-to-string method in Number toExponential
2022-11-04 21:12:10 +00:00
Timothy Flynn
5898db8c0f
LibJS: Use more accurate number-to-string method in Number toPrecision
2022-11-04 21:12:10 +00:00
Timothy Flynn
d56205f991
LibJS: Use more accurate number-to-string method in Intl.NumberFormat
...
Intl.NumberFormat only ever wants literal number-to-digits here, without
extra exponential formatting.
2022-11-04 21:12:10 +00:00
Luke Wilde
ac67077b57
LibJS: Fix length of PlainDateTime.withPlainTime
...
withPlainTime's argument is optional, so the length of the function is
actually 0.
2022-11-03 21:09:58 +00:00
Luke Wilde
b26b18a0bc
LibJS: Add timeZoneName: "critical" option to ZonedDateTime.toString()
...
This is a normative change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/d84937f
2022-11-03 19:15:50 +00:00
Luke Wilde
4a167cfbec
LibJS: Add calendarName: "critical" option to toString() methods
...
This is a normative change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/e715a50
2022-11-03 19:15:50 +00:00
Luke Wilde
192aa75279
LibJS: Align ISO 8601 grammar with annotations from IXDTF
...
This is a normative change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/c64b844
2022-11-03 19:15:50 +00:00
Timothy Flynn
a5bf32018f
LibJS+LibUnicode: Add "microsecond" and "nanosecond" as sanctioned units
...
This is a normative change in the ECMA-402 spec. See:
https://github.com/tc39/ecma402/commit/f627573
2022-11-03 18:37:48 +00:00
Timothy Flynn
4686989582
LibJS: Map DurationFormat's list style to "short" when it is "digital"
...
This is a normative change in the Intl.DurationFormat proposal. See:
https://github.com/tc39/proposal-intl-duration-format/commit/7495e32
2022-11-01 14:33:07 +00:00
Timothy Flynn
b077fccd3d
LibLocale+LibJS: Update to CLDR version 42.0.0
...
There were some notable changes to the CLDR JSON format and data in this
release.
The patterns for a date at a specific time, i.e. "{date} at {time}", now
appear under the "atTime" attribute of the "dateTimeFormats" object.
Locale specific changes that affected test-js:
All locales:
* In many patterns, the code points U+00A0 (NO-BREAK SPACE) and U+202F
(NARROW NO-BREAK SPACE) are now used in place of an ASCII space. For
example, before the "dayPeriod" fields AM and PM.
* Separators such as U+2013 (EN DASH) are now surrounded by U+2009 (THIN
SPACE) in place of an ASCII space character.
Locale "en":
* Narrow localizations of time formats are even more narrow. For
example, the abbreviation "wk." for "week" is now just "wk".
Locale "ar":
* The code point U+060C (ARABIC COMMA) is now used in place of an ASCII
comma.
* The code point U+200F (RIGHT-TO-LEFT MARK) now appears at the
beginning of many localizations.
* When the "latn" numbering system is used for currency formatting, the
currency symbol more consistently is placed at the end of the pattern.
Locale "he":
* The "many" plural rules category has been removed.
Locales "zh" and "es-419":
* Several display-name localizations were changed.
2022-10-25 10:10:39 +01:00
davidot
62fc3e50f3
LibJS: Make parseFloat use the new double parser
...
This means it no longer is locale dependent and doesn't incorrectly
accept hex floats anymore.
2022-10-23 15:48:45 +02:00
davidot
9921f80817
LibJS: Fix that non-double numbers from JSON were truncated to i32
2022-10-23 15:48:45 +02:00
davidot
66d07a452f
LibJS: Make a TypedArray test actually run on all different types
2022-10-23 15:48:45 +02:00
davidot
80f23abd0a
LibJS: Add descriptive output to test-commons expect().toThrow()
...
This (and still some other methods) just say Expectation error leaving
the user completely in the dark whether the method threw at all.
And since we have nice function printing now we can just toString the
function since most are lambda's.
2022-10-23 15:48:45 +02:00
Timothy Flynn
27737f613c
LibTimeZone+LibJS: Update to TZDB version 2022e
...
https://mm.icann.org/pipermail/tz-announce/2022-October/000074.html
This version changes America/Chicago's transtion from LMT to CST from
1883 Nov 18 12:09:24 to 1883 Nov 18 18:00.
2022-10-18 16:01:44 +02:00
leeight
0d96468e9b
LibJS: Implement RegExp legacy static properties
...
RegExp legacy static properties Spec url is https://github.com/tc39/proposal-regexp-legacy-features
2022-10-17 17:08:33 +02:00
Linus Groh
4567ded8e4
LibJS: Reject relativeTo string such as "2022-08-18T17:01Z"
...
This is a normative change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/2dc20bf
2022-10-17 12:56:05 +02:00
Luke Wilde
35c9e324b4
LibJS: Add fast path TimeZone conversion to PlainDate#toZonedDateTime
...
This is a normative chane in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/fcab1af
2022-10-16 13:40:21 +02:00
Luke Wilde
707f12f927
LibJS: Remove extra property check from Instant#toZonedDateTimeISO
...
This is a normative change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/7dfbd80
2022-10-16 13:40:21 +02:00
Luke Wilde
f7bb79d6d1
LibJS: Fast-path ToTemporalTimeZone when the argument is a TimeZone
...
This is a normative change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/54cea53
2022-10-16 13:40:21 +02:00
Luke Wilde
8c3512d6ce
LibJS: Fast-path ToTemporalCalendar when the argument is a Calendar
...
This is a normative change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/2a43b39
2022-10-16 13:40:21 +02:00
Luke Wilde
d5d1146cc3
LibJS/Temporal: Fix inconsistency in order of observable operations
...
This is a normative change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/a3a8237
2022-10-14 18:55:12 +02:00
davidot
1b0ca52c54
LibJS: Disallow one day long time zone offsets
...
This is a normative change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/9cc8b29b
2022-10-14 11:23:50 +02:00
Timothy Flynn
7fc03e8967
LibJS: Use Unicode normalization within String.prototype.normalize
2022-10-06 22:14:44 +01:00
Timothy Flynn
82e730eba1
LibJS: Change default time display options to "always" for digital style
...
This is a normative change in the Intl.DurationFormat proposal. See:
https://github.com/tc39/proposal-intl-duration-format/commit/d28076b
2022-09-22 14:39:24 +01:00
davidot
446a10a1ac
LibJS: Implement normative change in String.prototype.substr
...
And add spec comments while we're in the neighborhood.
2022-09-21 16:59:58 +01:00
Timothy Flynn
60a6bae53d
LibJS: Change digital default style from "narrow" to "short"
...
This is a normative change in the Intl.DurationFormat proposal. See:
https://github.com/tc39/proposal-intl-duration-format/commit/4c24876
2022-09-21 16:09:38 +01:00
Timothy Flynn
887dac0929
LibJS: Handle NumberFormat's [[UseGrouping]] option for "true" / "false"
...
This is a normative change to the Intl NumberFormat V3 spec. See:
https://github.com/tc39/proposal-intl-numberformat-v3/commit/4751da5
2022-09-18 09:45:40 -04:00
davidot
03c468fb7d
LibJS: Parse date strings like "9/17/2022"
2022-09-17 18:53:14 +02:00
Brian Gianforcaro
d0a1775369
Everywhere: Fix a variety of typos
...
Spelling fixes found by `codespell`.
2022-09-14 04:46:49 +00:00
davidot
9f661d20f7
LibJS: Allow anonymous functions as default exports
...
This requires a special case with names as the default function is
supposed to have a unique name ("*default*" in our case) but when
checked should have name "default".
2022-09-02 02:07:37 +01:00
davidot
0fc67ffd62
LibJS: Make indirect bindings of module behave like normal bindings
...
Before this we attempted to hack around this by only overriding
has_binding. However this did not cover all cases, for example when
assigning to variables before their declaration it didn't throw.
By using the new find_binding_and_index virtual method we can just
pretend the indirect bindings are real.
Since indirect binding do come from a normal environment we need to
ensure you cannot modify the binding and that properties like mutable
are false as expected by the spec for such an indirect binding.
2022-09-02 02:07:37 +01:00
davidot
faf1430ce4
LibJS: Allow exporting any imported bindings
2022-09-02 02:07:37 +01:00
davidot
462c6df24b
LibJS: Only check for duplicate exports if they have a name
...
Together with removing an incorrect VERIFY this allows multiple star
imports in a single module.
2022-09-02 02:07:37 +01:00
davidot
3b56043612
LibJS: Put exports before symbols in keys of module namespace object
2022-09-02 02:07:37 +01:00
davidot
fb61e9274a
LibJS: Call resolve instead of reject in AsyncFromSyncIteratorPrototype
2022-09-02 02:07:37 +01:00
davidot
3b1c3e574f
LibJS: Handle empty named export
...
This is an export which looks like `export {} from "module"`, and
although it doesn't have any real export entries it should still add
"module" to the required modules to load.
2022-09-02 02:07:37 +01:00
davidot
f75c51b097
LibJS: Allow full ModuleExportName in namespace
...
This means we should accept a string after 'export * as '.
2022-09-02 02:07:37 +01:00
Timothy Flynn
c477425b9b
LibJS: Create DurationFormat's ListFormat object with type and style
...
This is a normative change in the Intl.DurationFormat spec. See:
https://github.com/tc39/proposal-intl-duration-format/commit/1304e4b
2022-08-30 14:26:11 -04:00
Timothy Flynn
127b28c940
LibJS: Use numeric style if the previous style was numeric or 2-digit
...
This is a normative change in the Intl.DurationFormat proposal. See:
https://github.com/tc39/proposal-intl-duration-format/commit/3a46ee3
2022-08-30 14:26:11 -04:00
Timothy Flynn
d57b92da09
LibJS: Default to "short" for DurationFormat's style option
...
This is a normative change in the Intl.DurationFormat proposal. See:
https://github.com/tc39/proposal-intl-duration-format/commit/b289494
2022-08-30 14:26:11 -04:00
Timothy Flynn
765d016670
LibJS: Default to 0 for DurationFormat's fractionalDigits option
...
This is a normative change in the Intl.DurationFormat proposal. See:
https://github.com/tc39/proposal-intl-duration-format/commit/ac7e184
2022-08-30 14:26:11 -04:00
Slappy826
f4b3bb519f
LibJS: Handle non-decimal integer literals in Value::to_number
...
Implements support for parsing binary and octal literals, and fixes
instances where a hex literal is parsed in ways the spec doesn't
allow.
2022-08-30 01:00:48 +01:00
Luke Wilde
9643a5c63f
LibJS: Accept and ignore calendar annotation in Instant strings
...
This is a normative change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/3cd9669
2022-08-25 23:07:08 +01:00
Luke Wilde
54bb6bf2c0
LibJS: Avoid calling ToString on calendar when calendarName is "never"
...
This is a normative change in the Temporal spec.
See:
- https://github.com/tc39/proposal-temporal/commit/6122f4e
- https://github.com/tc39/proposal-temporal/commit/cf586bc
2022-08-25 21:11:23 +01:00
Timothy Flynn
6309b8773d
LibJS: Guard IntegerIndexedElementSet with receiver check
...
This is a normative change in the ECMA-262 spec. See:
https://github.com/tc39/ecma262/commit/3620f11
2022-08-25 19:50:04 +01:00