From ce9ceaef2afea2d14c081f3208048e8cd6978728 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marja=20H=C3=B6ltt=C3=A4?= Date: Mon, 14 Oct 2024 00:30:33 +0200 Subject: [PATCH 1/2] add example to spec --- index.bs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/index.bs b/index.bs index 4566fb8..4c8f60f 100644 --- a/index.bs +++ b/index.bs @@ -3,8 +3,8 @@ Title: Explicit JavaScript Compile Hints (File-based) Shortname: explicit-js-compile-hints Level: None Status: LD -Repository: explainers-by-googlers/explicit-javascript-compile-hints-file-based -URL: https://explainers-by-googlers.github.io/explicit-javascript-compile-hints-file-based/ +Repository: WICG/explicit-javascript-compile-hints-file-based +URL: https://github.com/WICG/explicit-javascript-compile-hints-file-based Editor: Marja Hölttä, Google, https://google.com, marja@google.com Abstract: A magic comment in JavaScript for signaling certain scripts / functions should be prioritized. Markup Shorthands: markdown yes, css no @@ -25,6 +25,17 @@ This proposal introduces a new magic comment that signals to browsers that the f In its current form, it’s not a defined standard and is subject to modifications. +Example usage {#example} +======================== + +In this example, the magic comment is used for triggering the eager compilation of the two JavaScript functions in the file: +```JavaScript +//# eagerCompilation=all + +function foo() { ... } // will now be eagerly parsed and compiled +function bar() { ... } // will now be eagerly parsed and compiled +``` + Additions to Script Records and Source Text Module Records {#additions} ======================================================================= From 8c8f7f9a21833d8914006c22e3f41a75488fb2b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marja=20H=C3=B6ltt=C3=A4?= Date: Mon, 14 Oct 2024 00:36:10 +0200 Subject: [PATCH 2/2] just to retrigger checks --- index.bs | 1 - 1 file changed, 1 deletion(-) diff --git a/index.bs b/index.bs index 4c8f60f..5bd8acc 100644 --- a/index.bs +++ b/index.bs @@ -114,4 +114,3 @@ If a script or module record contains the \[\[CompileHintAnnotation]] internal f

Example: The user agent might cache the compilation results more eagerly than it otherwise would.

The user agent may also completely ignore the \[\[CompileHintAnnotation]] internal field. -