Skip to content

Commit

Permalink
Bug 1519167 - Part 1: Add config for Temporal. r=spidermonkey-reviewe…
Browse files Browse the repository at this point in the history
…rs,dminor

Add a new configure option "--with-temporal-api" to enable the Temporal API.

This option is off by default, because the Temporal spec is still work-in-progress.

Time zone and calendrical operations will require ICU, so we don't support
Temporal when "--without-intl-api" is specified.

Differential Revision: https://phabricator.services.mozilla.com/D174153
  • Loading branch information
anba committed Jun 21, 2023
1 parent 9c4f20b commit 1eb0160
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
15 changes: 15 additions & 0 deletions js/moz.configure
Original file line number Diff line number Diff line change
Expand Up @@ -1171,6 +1171,21 @@ set_define("U_USING_ICU_NAMESPACE", "0", when="--with-intl-api")
set_define("U_STATIC_IMPLEMENTATION", True, when=depends(system_icu)(lambda x: not x))


# ECMAScript Temporal API Support (uses ICU)
# ======================================================

option("--with-temporal-api", default=False, help="Enable ECMAScript Temporal API")

set_config("JS_HAS_TEMPORAL_API", True, when="--with-temporal-api")
set_define("JS_HAS_TEMPORAL_API", True, when="--with-temporal-api")


@depends("--with-temporal-api", "--with-intl-api")
def check_temporal_api(temporal_enabled, intl_enabled):
if temporal_enabled and not intl_enabled:
die("Can't use both --with-temporal-api and --without-intl-api")


# Initial support for WebAssembly JS-API Type Reflections
# =======================================================

Expand Down
3 changes: 3 additions & 0 deletions js/src/js-config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@
/* Define to 1 if SpiderMonkey should include support for the Intl API. */
#undef JS_HAS_INTL_API

/* Define to 1 if SpiderMonkey should include support for the Temporal API. */
#undef JS_HAS_TEMPORAL_API

/* Define to 1 if SpiderMonkey should include a breakpoint function for
* artificial OOMs. */
#undef JS_OOM_BREAKPOINT
Expand Down

0 comments on commit 1eb0160

Please sign in to comment.