From c7ec61d7b06c40bc038674e9530ebcf4979e17e7 Mon Sep 17 00:00:00 2001
From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com>
Date: Sat, 18 Jan 2025 12:03:57 -0500
Subject: [PATCH 01/32] Default globals for strict mode
---
text/0000-default-globals-for-strict-mode.md | 95 ++++++++++++++++++++
1 file changed, 95 insertions(+)
create mode 100644 text/0000-default-globals-for-strict-mode.md
diff --git a/text/0000-default-globals-for-strict-mode.md b/text/0000-default-globals-for-strict-mode.md
new file mode 100644
index 0000000000..0466d45fa8
--- /dev/null
+++ b/text/0000-default-globals-for-strict-mode.md
@@ -0,0 +1,95 @@
+---
+stage: accepted
+start-date: 2025-01-18T00:00:00.000Z
+release-date: # In format YYYY-MM-DDT00:00:00.000Z
+release-versions:
+teams: # delete teams that aren't relevant
+ - cli
+ - framework
+ - learning
+prs:
+ accepted: # Fill this in with the URL for the Proposal RFC PR
+project-link:
+suite:
+---
+
+
+
+# Default globals for strict mode
+
+## Summary
+
+This RFC aims to introduce platform-native globals as allowed defaults in strict-mode components, allowing for more intuitive usage, and less "know how the compiler works"
+
+## Motivation
+
+Early on there was a bug in the build tools of strict-mode components that allowed _any_ global to be used components. This was dangerous, as strict-mode allows use of all in-scoped variables to be used in all valid syntax positions in the template, and while this is what folks would expect for languages with a scope-system, it means that if someone defined `window.div`, all `
`s in components would use that implementation instead. This was fixed, but during that time, we realized that it's _very_ convenient to use platform-native globals as utilities, such as `Array`, `Boolean`, `String`, `Infinity`, `JSON`, and many more.
+
+While we don't want to support _everything_ on `globalThis`, we can aim support a good list of utilities fitting some criteria. Committing to this list means that we promise to never create a keyword with the same name + casing as the platform-native API, likewise, having an allow-list of which platform-native APIs to support guides our decisions around what keywords to implement in templates, as the platform-native globals would take precedence over / be used instead of any same-named keywords.
+
+## Detailed design
+
+
+> This is the bulk of the RFC.
+
+> Explain the design in enough detail for somebody
+familiar with the framework to understand, and for somebody familiar with the
+implementation to implement. This should get into specifics and corner-cases,
+and include examples of how the feature is used. Any new terminology should be
+defined here.
+
+> Please keep in mind any implications within the Ember ecosystem, such as:
+> - Lint rules (ember-template-lint, eslint-plugin-ember) that should be added, modified or removed
+> - Features that are replaced or made obsolete by this feature and should eventually be deprecated
+> - Ember Inspector and debuggability
+> - Server-side Rendering
+> - Ember Engines
+> - The Addon Ecosystem
+> - IDE Support
+> - Blueprints that should be added or modified
+
+## How we teach this
+
+> What names and terminology work best for these concepts and why? How is this
+idea best presented? As a continuation of existing Ember patterns, or as a
+wholly new one?
+
+> Would the acceptance of this proposal mean the Ember guides must be
+re-organized or altered? Does it change how Ember is taught to new users
+at any level?
+
+> How should this feature be introduced and taught to existing Ember
+users?
+
+> Keep in mind the variety of learning materials: API docs, guides, blog posts, tutorials, etc.
+
+## Drawbacks
+
+> Why should we *not* do this? Please consider the impact on teaching Ember,
+on the integration of this feature with other existing and planned features,
+on the impact of the API churn on existing apps, etc.
+
+> There are tradeoffs to choosing any path, please attempt to identify them here.
+
+## Alternatives
+
+> What other designs have been considered? What is the impact of not doing this?
+
+> This section could also include prior art, that is, how other frameworks in the same domain have solved this problem.
+
+## Unresolved questions
+
+> Optional, but suggested for first drafts. What parts of the design are still
+TBD?
From 277cdbe7b69ba99ce7f9a3e69ec30a91cc6b6ea6 Mon Sep 17 00:00:00 2001
From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com>
Date: Sat, 18 Jan 2025 12:05:32 -0500
Subject: [PATCH 02/32] Update meta
---
...r-strict-mode.md => 1070-default-globals-for-strict-mode.md} | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
rename text/{0000-default-globals-for-strict-mode.md => 1070-default-globals-for-strict-mode.md} (98%)
diff --git a/text/0000-default-globals-for-strict-mode.md b/text/1070-default-globals-for-strict-mode.md
similarity index 98%
rename from text/0000-default-globals-for-strict-mode.md
rename to text/1070-default-globals-for-strict-mode.md
index 0466d45fa8..60cc8856d9 100644
--- a/text/0000-default-globals-for-strict-mode.md
+++ b/text/1070-default-globals-for-strict-mode.md
@@ -8,7 +8,7 @@ teams: # delete teams that aren't relevant
- framework
- learning
prs:
- accepted: # Fill this in with the URL for the Proposal RFC PR
+ accepted: https://github.com/emberjs/rfcs/pull/1070
project-link:
suite:
---
From d33b0b1f21e293f6845ab28c97c87341faf82718 Mon Sep 17 00:00:00 2001
From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com>
Date: Sat, 18 Jan 2025 12:20:50 -0500
Subject: [PATCH 03/32] Updates
---
text/1070-default-globals-for-strict-mode.md | 105 +++++++++++++++++++
1 file changed, 105 insertions(+)
diff --git a/text/1070-default-globals-for-strict-mode.md b/text/1070-default-globals-for-strict-mode.md
index 60cc8856d9..a4c2efcde6 100644
--- a/text/1070-default-globals-for-strict-mode.md
+++ b/text/1070-default-globals-for-strict-mode.md
@@ -39,8 +39,113 @@ Early on there was a bug in the build tools of strict-mode components that allow
While we don't want to support _everything_ on `globalThis`, we can aim support a good list of utilities fitting some criteria. Committing to this list means that we promise to never create a keyword with the same name + casing as the platform-native API, likewise, having an allow-list of which platform-native APIs to support guides our decisions around what keywords to implement in templates, as the platform-native globals would take precedence over / be used instead of any same-named keywords.
+Without this RFC, all platform-native globals must be accessed via globalThis:
+
+```gjs
+
+ {{globalThis.JSON.stringify @data null 3}}
+
+```
+or
+```gjs
+const { JSON } = globalThis;
+
+
+ {{JSON.stringify @data null 3}}
+
+```
+
+After this RFC is implemented, the following would work:
+```gjs
+
+ {{JSON.stringify @data null 3}}
+
+```
+
## Detailed design
+Allowing defaults means: when using `JSON` (for example) in a component, the compiled-to-plain-JS output results in the reference to JSON being added to the "scope bag", for example: :
+
+```js
+// Post-RFC 931
+import { template } from '@ember/template-compiler';
+
+const data = {};
+
+export default template('{{JSON.stringify data}}', { scope: () => ({ JSON, data }) });
+```
+
+pre-RFC#931
+
+```js
+// Pre-RFC 931
+import { precompileTemplate } from "@ember/template-compilation";
+import { setComponentTemplate } from "@ember/component";
+import templateOnly from "@ember/component/template-only";
+
+const data = {};
+
+export default setComponentTemplate(
+ precompileTemplate('{{JSON.stringify data}}', {
+ strictMode: true,
+ scope: () => ({ JSON, data }) }
+ ), templateOnly()
+);
+```
+
+
+
+Criteria for a platform-native global to be accepted as default:
+
+Any of
+- begins with an uppercase letter
+- guaranteed to never be added to glimmer as a keyword (e.g.: `globalThis`)
+
+And
+- must not need `new` to invoke
+- must be one one of these lists:
+ - https://tc39.es/ecma262/#sec-global-object
+ - https://tc39.es/ecma262/#sec-function-properties-of-the-global-object
+ - https://html.spec.whatwg.org/multipage/nav-history-apis.html#window
+
+
+Given the above criteria, the following should be added to default-available strict-mode scope:
+
+### namespaces
+
+- `globalThis`
+- `JSON`
+- `Math`
+- `Atomics`
+- `Reflect`
+
+### functions / utilities
+
+- `isNaN`
+- `isFinite`
+- `parseInt`
+- `parseFloat`
+- `decodeURI`
+- `decodeURIComponent`
+- `encodeURI`
+- `encodeURIComponent`
+
+### new-less constructors (still functions / utilities)
+
+- `Number`
+- `Object`
+- `Array`
+- `String`
+- `BigInt`
+- `Date`
+
+### Values
+
+- `Infinity`
+
+
+
+
> This is the bulk of the RFC.
From e80bd6716ad599c05589507b00bfb96d802dd8af Mon Sep 17 00:00:00 2001
From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com>
Date: Sat, 18 Jan 2025 13:02:14 -0500
Subject: [PATCH 04/32] Updates
---
text/1070-default-globals-for-strict-mode.md | 64 ++++++++++++++------
1 file changed, 44 insertions(+), 20 deletions(-)
diff --git a/text/1070-default-globals-for-strict-mode.md b/text/1070-default-globals-for-strict-mode.md
index a4c2efcde6..b47de0bbe3 100644
--- a/text/1070-default-globals-for-strict-mode.md
+++ b/text/1070-default-globals-for-strict-mode.md
@@ -113,38 +113,62 @@ Given the above criteria, the following should be added to default-available str
### namespaces
-- `globalThis`
-- `JSON`
-- `Math`
-- `Atomics`
-- `Reflect`
+- [`globalThis`](https://tc39.es/ecma262/#sec-globalthis)
+- [`Atomics`](https://tc39.es/ecma262/#sec-atomics)
+- [`JSON`](https://tc39.es/ecma262/#sec-json)
+- [`Math`](https://tc39.es/ecma262/#sec-math)
+- [`Reflect`](https://tc39.es/ecma262/#sec-reflect)
### functions / utilities
-- `isNaN`
-- `isFinite`
-- `parseInt`
-- `parseFloat`
-- `decodeURI`
-- `decodeURIComponent`
-- `encodeURI`
-- `encodeURIComponent`
+- [`isNaN`](https://tc39.es/ecma262/#sec-isnan-number)
+- [`isFinite`](https://tc39.es/ecma262/#sec-isfinite-number)
+- [`parseInt`](https://tc39.es/ecma262/#sec-parseint-string-radix)
+- [`parseFloat`](https://tc39.es/ecma262/#sec-parsefloat-string)
+- [`decodeURI`](https://tc39.es/ecma262/#sec-decodeuri-encodeduri)
+- [`decodeURIComponent`](https://tc39.es/ecma262/#sec-decodeuricomponent-encodeduricomponent)
+- [`encodeURI`](https://tc39.es/ecma262/#sec-encodeuri-uri)
+- [`encodeURIComponent`](https://tc39.es/ecma262/#sec-encodeuricomponent-uricomponent)
### new-less constructors (still functions / utilities)
-- `Number`
-- `Object`
-- `Array`
-- `String`
-- `BigInt`
-- `Date`
+- [`Array`](https://tc39.es/ecma262/#sec-constructor-properties-of-the-global-object-array)
+- [`BigInt`](https://tc39.es/ecma262/#sec-constructor-properties-of-the-global-object-bigint)
+- [`Boolean`](https://tc39.es/ecma262/#sec-constructor-properties-of-the-global-object-boolean)
+- [`Date`](https://tc39.es/ecma262/#sec-constructor-properties-of-the-global-object-date)
+- [`Number`](https://tc39.es/ecma262/#sec-constructor-properties-of-the-global-object-number)
+- [`Object`](https://tc39.es/ecma262/#sec-constructor-properties-of-the-global-object-object)
+- [`String`](https://tc39.es/ecma262/#sec-constructor-properties-of-the-global-object-string)
### Values
-- `Infinity`
+- [`Infinity`](https://tc39.es/ecma262/#sec-value-properties-of-the-global-object-infinity)
+- [`NaN`](https://tc39.es/ecma262/#sec-value-properties-of-the-global-object-nan)
+### Matching criteria, but not included
+
+Existing keywords don't need to be included in the global scope allow-list
+
+- [`undefined`](https://tc39.es/ecma262/#sec-undefined)
+
+These do not exist in all supported environments:
+
+- [`Encode`](https://tc39.es/ecma262/#sec-encode)
+- [`Decode`](https://tc39.es/ecma262/#sec-decode)
+- [`ParseHexOctet`](https://tc39.es/ecma262/#sec-parsehexoctet)
+
+These are not common and / or may be actively dangerous to make easier to use:
+
+- `eval`
+- `PerformEval`
+- `Function`
+
+Uncommon entries from the "Constructor Properties" list: https://tc39.es/ecma262/#sec-constructor-properties-of-the-global-object
+- `${...}Error`, e.g.: `AggregateError`
+- `${...}Int${...}Array`, e.g.: `BigUint64Array`,
+- anything that requires `new`, e.g.: `DataView`, `Map`
> This is the bulk of the RFC.
From f1370c4751aeafdd1d14fbe854a6b7da13ae314f Mon Sep 17 00:00:00 2001
From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com>
Date: Sat, 18 Jan 2025 13:27:03 -0500
Subject: [PATCH 05/32] Updates
---
text/1070-default-globals-for-strict-mode.md | 119 +++++++++++++------
1 file changed, 80 insertions(+), 39 deletions(-)
diff --git a/text/1070-default-globals-for-strict-mode.md b/text/1070-default-globals-for-strict-mode.md
index b47de0bbe3..f79187a44f 100644
--- a/text/1070-default-globals-for-strict-mode.md
+++ b/text/1070-default-globals-for-strict-mode.md
@@ -33,6 +33,8 @@ suite: Leave as is
This RFC aims to introduce platform-native globals as allowed defaults in strict-mode components, allowing for more intuitive usage, and less "know how the compiler works"
+This is an ergonomics-focused RFC. The proposed changes today can be polyfilled via `globalThis['...']` accesses.
+
## Motivation
Early on there was a bug in the build tools of strict-mode components that allowed _any_ global to be used components. This was dangerous, as strict-mode allows use of all in-scoped variables to be used in all valid syntax positions in the template, and while this is what folks would expect for languages with a scope-system, it means that if someone defined `window.div`, all `
`s in components would use that implementation instead. This was fixed, but during that time, we realized that it's _very_ convenient to use platform-native globals as utilities, such as `Array`, `Boolean`, `String`, `Infinity`, `JSON`, and many more.
@@ -111,16 +113,77 @@ And
Given the above criteria, the following should be added to default-available strict-mode scope:
-### namespaces
+### namespaces / objects
+
+TC39:
- [`globalThis`](https://tc39.es/ecma262/#sec-globalthis)
+
+ Already available. [Example](https://limber.glimdown.com/edit?c=MYewdgzgLgBAJgQygmBeGBvGBzATgU3ygEsxsAuGAcgAt8AbekGKOggQipgF8BuAKH4AeKPgC2AB3pJ8APn4xMGbEwBGCegBUaxCADoAUgGUA8gDk90XKWzEAZgE94SBN27CA9KMnTRsoA&format=gjs):
+ ```gjs
+
+ {{globalThis.JSON.stringify @data}}
+
+ ```
+
- [`Atomics`](https://tc39.es/ecma262/#sec-atomics)
+
+ [Example](https://limber.glimdown.com/edit?c=MYewdgzgLgBARgVwGZIKYCcYF4ZlQdxgEF10BDATwCFk10AKARgDYBKAbgChRJYEBLMFAAc2XARgBVQSJLkK9RCgwdOAocIDaABgC6YgOxdOAehMwDMetsa3WMABoB5AEowATFe03t9nAFYvRhtWAB44dAA%2BTiIoEABbfmAIADoADxAGdREAGhhtPPdWTk5QqFR4gAcAGzJy6JgYAG8mgHNqkDgyaoAVAAt%2BVNiEpNSOsgATGGzhAF9Z0pNyqtr6oA&format=gjs):
+ ```gjs
+ const buffer = new ArrayBuffer(16);
+ const uint8 = new Uint8Array(buffer);
+ uint8[0] = 7;
+
+ // 7 (0111) XOR 2 (0010) = 5 (0101)
+ Atomics.xor(uint8, 0, 2)
+
+
+ {{globalThis.Atomics.load uint8}} === 5
+
+ ```
+
+
- [`JSON`](https://tc39.es/ecma262/#sec-json)
+
+ [Example](https://limber.glimdown.com/edit?c=MYewdgzgLgBAJgQygmBeGBvGBzATgU3ygEsxsAuGAcgAt8AbekGKOggQipgF8BuAKH4AeKPgC2AB3pJ8APn4xMGbEwBGCegBUaxCADoAUgGUA8gDk90XKWzEAZgE94SBN27CA9KMnTRsoA&format=gjs):
+ ```gjs
+
+ {{JSON.stringify @data}}
+
+ ```
+
- [`Math`](https://tc39.es/ecma262/#sec-math)
+
+ [Example](https://limber.glimdown.com/edit?c=FAHgLgpgtgDgNgQ0gPmAAjQb0wczgewCME4AVACwEsBnAOgFklzaoEAPNABjQCY0AWAL6DQAekixEKIA&format=gjs):
+ ```gjs
+
+ {{Math.max 0 2 4}}
+
+ ```
+
- [`Reflect`](https://tc39.es/ecma262/#sec-reflect)
+ [Example](https://limber.glimdown.com/edit?c=MYewdgzgLgBAJgQygmBeGBvGBzATgU3ygEsxsAuGAcgAt8AbekGKOgqmAXwG4AoXgDxR8AWwAO9JPgB8vGJgzYmAIwT0AKjWIQAdACV8AM3r5gUHdiLwkKKnkIkyVTp0EB6YeMnDpQA&format=gjs):
+ ```gjs
+ const data = { greeting: 'hello there' };
+
+
+ {{Reflect.get data 'greeting'}}
+
+ ```
+
+WHATWG:
+
+- [`location`](https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-location)
+- [`history`](https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-history)
+- [`navigator`](https://html.spec.whatwg.org/multipage/system-state.html#dom-navigator)
+- [`window`](https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-window)
+- [`document`](https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-document-2)
+
### functions / utilities
+TC39:
+
- [`isNaN`](https://tc39.es/ecma262/#sec-isnan-number)
- [`isFinite`](https://tc39.es/ecma262/#sec-isfinite-number)
- [`parseInt`](https://tc39.es/ecma262/#sec-parseint-string-radix)
@@ -130,8 +193,14 @@ Given the above criteria, the following should be added to default-available str
- [`encodeURI`](https://tc39.es/ecma262/#sec-encodeuri-uri)
- [`encodeURIComponent`](https://tc39.es/ecma262/#sec-encodeuricomponent-uricomponent)
+WHATWG:
+
+- [`postMessage`](https://html.spec.whatwg.org/multipage/web-messaging.html#dom-window-postmessage)
+
### new-less constructors (still functions / utilities)
+TC39:
+
- [`Array`](https://tc39.es/ecma262/#sec-constructor-properties-of-the-global-object-array)
- [`BigInt`](https://tc39.es/ecma262/#sec-constructor-properties-of-the-global-object-bigint)
- [`Boolean`](https://tc39.es/ecma262/#sec-constructor-properties-of-the-global-object-boolean)
@@ -142,12 +211,14 @@ Given the above criteria, the following should be added to default-available str
### Values
+TC39:
+
- [`Infinity`](https://tc39.es/ecma262/#sec-value-properties-of-the-global-object-infinity)
- [`NaN`](https://tc39.es/ecma262/#sec-value-properties-of-the-global-object-nan)
-### Matching criteria, but not included
+### Potentially matching criteria, but not included
Existing keywords don't need to be included in the global scope allow-list
@@ -170,55 +241,25 @@ Uncommon entries from the "Constructor Properties" list: https://tc39.es/ecma262
- `${...}Int${...}Array`, e.g.: `BigUint64Array`,
- anything that requires `new`, e.g.: `DataView`, `Map`
+APIs from WHATWG that are highly likely to collide with user-land code or are already ambiguous (and thus would be confusing to use):
-> This is the bulk of the RFC.
-
-> Explain the design in enough detail for somebody
-familiar with the framework to understand, and for somebody familiar with the
-implementation to implement. This should get into specifics and corner-cases,
-and include examples of how the feature is used. Any new terminology should be
-defined here.
+- `stop()`, `close()`, `status()`, `focus()`, `blur()`, `open()`, `parent`, `confirm()`, `self`, etc
-> Please keep in mind any implications within the Ember ecosystem, such as:
-> - Lint rules (ember-template-lint, eslint-plugin-ember) that should be added, modified or removed
-> - Features that are replaced or made obsolete by this feature and should eventually be deprecated
-> - Ember Inspector and debuggability
-> - Server-side Rendering
-> - Ember Engines
-> - The Addon Ecosystem
-> - IDE Support
-> - Blueprints that should be added or modified
## How we teach this
-> What names and terminology work best for these concepts and why? How is this
-idea best presented? As a continuation of existing Ember patterns, or as a
-wholly new one?
-
-> Would the acceptance of this proposal mean the Ember guides must be
-re-organized or altered? Does it change how Ember is taught to new users
-at any level?
+Developers should primarily reference exising documentation on the web for the above-mentioned APIs, such as on MDN.
-> How should this feature be introduced and taught to existing Ember
-users?
-
-> Keep in mind the variety of learning materials: API docs, guides, blog posts, tutorials, etc.
+If we don't already, we should have an extensive guide on Polish Syntax, potentially similar to [https://cheatsheet.glimmer.nullvoxpopuli.com/docs/templates](https://cheatsheet.glimmer.nullvoxpopuli.com/docs/templates)
## Drawbacks
-> Why should we *not* do this? Please consider the impact on teaching Ember,
-on the integration of this feature with other existing and planned features,
-on the impact of the API churn on existing apps, etc.
-
-> There are tradeoffs to choosing any path, please attempt to identify them here.
+Takes a small amount of work to implement.
## Alternatives
-> What other designs have been considered? What is the impact of not doing this?
-
-> This section could also include prior art, that is, how other frameworks in the same domain have solved this problem.
+Do nothing, but this is worse, as folks intuitively expect these a lot of the above-mentioned APIs to "just work", without needing weird scope-tricks to convince our Scope-tracking tools in the build tools that certain APIs are in scope..
## Unresolved questions
-> Optional, but suggested for first drafts. What parts of the design are still
-TBD?
+none
From 3352ab04e81bbe1a319688a28fd64e1b5003723c Mon Sep 17 00:00:00 2001
From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com>
Date: Sat, 18 Jan 2025 13:27:50 -0500
Subject: [PATCH 06/32] The colons look weird
---
text/1070-default-globals-for-strict-mode.md | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/text/1070-default-globals-for-strict-mode.md b/text/1070-default-globals-for-strict-mode.md
index f79187a44f..90ceb674cc 100644
--- a/text/1070-default-globals-for-strict-mode.md
+++ b/text/1070-default-globals-for-strict-mode.md
@@ -119,7 +119,7 @@ TC39:
- [`globalThis`](https://tc39.es/ecma262/#sec-globalthis)
- Already available. [Example](https://limber.glimdown.com/edit?c=MYewdgzgLgBAJgQygmBeGBvGBzATgU3ygEsxsAuGAcgAt8AbekGKOggQipgF8BuAKH4AeKPgC2AB3pJ8APn4xMGbEwBGCegBUaxCADoAUgGUA8gDk90XKWzEAZgE94SBN27CA9KMnTRsoA&format=gjs):
+ Already available. [Example](https://limber.glimdown.com/edit?c=MYewdgzgLgBAJgQygmBeGBvGBzATgU3ygEsxsAuGAcgAt8AbekGKOggQipgF8BuAKH4AeKPgC2AB3pJ8APn4xMGbEwBGCegBUaxCADoAUgGUA8gDk90XKWzEAZgE94SBN27CA9KMnTRsoA&format=gjs)
```gjs
{{globalThis.JSON.stringify @data}}
@@ -128,7 +128,7 @@ TC39:
- [`Atomics`](https://tc39.es/ecma262/#sec-atomics)
- [Example](https://limber.glimdown.com/edit?c=MYewdgzgLgBARgVwGZIKYCcYF4ZlQdxgEF10BDATwCFk10AKARgDYBKAbgChRJYEBLMFAAc2XARgBVQSJLkK9RCgwdOAocIDaABgC6YgOxdOAehMwDMetsa3WMABoB5AEowATFe03t9nAFYvRhtWAB44dAA%2BTiIoEABbfmAIADoADxAGdREAGhhtPPdWTk5QqFR4gAcAGzJy6JgYAG8mgHNqkDgyaoAVAAt%2BVNiEpNSOsgATGGzhAF9Z0pNyqtr6oA&format=gjs):
+ [Example](https://limber.glimdown.com/edit?c=MYewdgzgLgBARgVwGZIKYCcYF4ZlQdxgEF10BDATwCFk10AKARgDYBKAbgChRJYEBLMFAAc2XARgBVQSJLkK9RCgwdOAocIDaABgC6YgOxdOAehMwDMetsa3WMABoB5AEowATFe03t9nAFYvRhtWAB44dAA%2BTiIoEABbfmAIADoADxAGdREAGhhtPPdWTk5QqFR4gAcAGzJy6JgYAG8mgHNqkDgyaoAVAAt%2BVNiEpNSOsgATGGzhAF9Z0pNyqtr6oA&format=gjs)
```gjs
const buffer = new ArrayBuffer(16);
const uint8 = new Uint8Array(buffer);
@@ -145,7 +145,7 @@ TC39:
- [`JSON`](https://tc39.es/ecma262/#sec-json)
- [Example](https://limber.glimdown.com/edit?c=MYewdgzgLgBAJgQygmBeGBvGBzATgU3ygEsxsAuGAcgAt8AbekGKOggQipgF8BuAKH4AeKPgC2AB3pJ8APn4xMGbEwBGCegBUaxCADoAUgGUA8gDk90XKWzEAZgE94SBN27CA9KMnTRsoA&format=gjs):
+ [Example](https://limber.glimdown.com/edit?c=MYewdgzgLgBAJgQygmBeGBvGBzATgU3ygEsxsAuGAcgAt8AbekGKOggQipgF8BuAKH4AeKPgC2AB3pJ8APn4xMGbEwBGCegBUaxCADoAUgGUA8gDk90XKWzEAZgE94SBN27CA9KMnTRsoA&format=gjs)
```gjs
{{JSON.stringify @data}}
@@ -154,7 +154,7 @@ TC39:
- [`Math`](https://tc39.es/ecma262/#sec-math)
- [Example](https://limber.glimdown.com/edit?c=FAHgLgpgtgDgNgQ0gPmAAjQb0wczgewCME4AVACwEsBnAOgFklzaoEAPNABjQCY0AWAL6DQAekixEKIA&format=gjs):
+ [Example](https://limber.glimdown.com/edit?c=FAHgLgpgtgDgNgQ0gPmAAjQb0wczgewCME4AVACwEsBnAOgFklzaoEAPNABjQCY0AWAL6DQAekixEKIA&format=gjs)
```gjs
{{Math.max 0 2 4}}
@@ -163,7 +163,7 @@ TC39:
- [`Reflect`](https://tc39.es/ecma262/#sec-reflect)
- [Example](https://limber.glimdown.com/edit?c=MYewdgzgLgBAJgQygmBeGBvGBzATgU3ygEsxsAuGAcgAt8AbekGKOgqmAXwG4AoXgDxR8AWwAO9JPgB8vGJgzYmAIwT0AKjWIQAdACV8AM3r5gUHdiLwkKKnkIkyVTp0EB6YeMnDpQA&format=gjs):
+ [Example](https://limber.glimdown.com/edit?c=MYewdgzgLgBAJgQygmBeGBvGBzATgU3ygEsxsAuGAcgAt8AbekGKOgqmAXwG4AoXgDxR8AWwAO9JPgB8vGJgzYmAIwT0AKjWIQAdACV8AM3r5gUHdiLwkKKnkIkyVTp0EB6YeMnDpQA&format=gjs)
```gjs
const data = { greeting: 'hello there' };
From 35bb99f595ac69445bcc2613c392d0fd94bedd6d Mon Sep 17 00:00:00 2001
From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com>
Date: Sat, 18 Jan 2025 13:40:15 -0500
Subject: [PATCH 07/32] The colons look weird
---
text/1070-default-globals-for-strict-mode.md | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/text/1070-default-globals-for-strict-mode.md b/text/1070-default-globals-for-strict-mode.md
index 90ceb674cc..a1c1087fdb 100644
--- a/text/1070-default-globals-for-strict-mode.md
+++ b/text/1070-default-globals-for-strict-mode.md
@@ -105,10 +105,17 @@ Any of
And
- must not need `new` to invoke
+- must not require lifetime management (e.g.: `setTimeout`)
- must be one one of these lists:
- https://tc39.es/ecma262/#sec-global-object
- https://tc39.es/ecma262/#sec-function-properties-of-the-global-object
- https://html.spec.whatwg.org/multipage/nav-history-apis.html#window
+ - https://html.spec.whatwg.org/multipage/indices.html#all-interfaces
+ - https://html.spec.whatwg.org/multipage/webappapis.html
+
+
+> [!IMPORTANT]
+> Because all function invocations are reactive by default, every function called from these APIs will be re-called when arguments change.
Given the above criteria, the following should be added to default-available strict-mode scope:
@@ -179,6 +186,8 @@ WHATWG:
- [`navigator`](https://html.spec.whatwg.org/multipage/system-state.html#dom-navigator)
- [`window`](https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-window)
- [`document`](https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-document-2)
+- [`localStorage`](https://html.spec.whatwg.org/multipage/webstorage.html#the-localstorage-attribute)
+- [`sessionStorage`](https://html.spec.whatwg.org/multipage/webstorage.html#the-sessionstorage-attribute)
### functions / utilities
@@ -195,7 +204,10 @@ TC39:
WHATWG:
+- [`atob`](https://html.spec.whatwg.org/multipage/webappapis.html#dom-btoa)
+- [`btoa`](https://html.spec.whatwg.org/multipage/webappapis.html#dom-atob)
- [`postMessage`](https://html.spec.whatwg.org/multipage/web-messaging.html#dom-window-postmessage)
+- [`structuredClone`](https://html.spec.whatwg.org/multipage/structured-data.html#dom-structuredclone)
### new-less constructors (still functions / utilities)
@@ -216,6 +228,10 @@ TC39:
- [`Infinity`](https://tc39.es/ecma262/#sec-value-properties-of-the-global-object-infinity)
- [`NaN`](https://tc39.es/ecma262/#sec-value-properties-of-the-global-object-nan)
+WHATWG:
+
+- [`isSecureContext`](https://html.spec.whatwg.org/multipage/webappapis.html#dom-issecurecontext)
+
### Potentially matching criteria, but not included
From 952ad7034ceea37b9c4570f142612c72fb3a4c22 Mon Sep 17 00:00:00 2001
From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com>
Date: Sat, 18 Jan 2025 13:54:21 -0500
Subject: [PATCH 08/32] Updates
---
text/1070-default-globals-for-strict-mode.md | 72 ++++++++++++++++++++
1 file changed, 72 insertions(+)
diff --git a/text/1070-default-globals-for-strict-mode.md b/text/1070-default-globals-for-strict-mode.md
index a1c1087fdb..a58b7eb761 100644
--- a/text/1070-default-globals-for-strict-mode.md
+++ b/text/1070-default-globals-for-strict-mode.md
@@ -106,6 +106,7 @@ Any of
And
- must not need `new` to invoke
- must not require lifetime management (e.g.: `setTimeout`)
+- if the API is a function, the return value should not be a promise
- must be one one of these lists:
- https://tc39.es/ecma262/#sec-global-object
- https://tc39.es/ecma262/#sec-function-properties-of-the-global-object
@@ -182,13 +183,84 @@ TC39:
WHATWG:
- [`location`](https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-location)
+
+ [Example](https://limber.glimdown.com/edit?c=FAHgLgpgtgDgNgQ0gPmAAjQb0wczgewCME4AVACwEsBnAOgIGMlL8A7W8gJwgDM0BffqAD0kWIhRA&format=gjs)
+ ```gjs
+
+ {{location.href }}
+
+ ```
+
- [`history`](https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-history)
+
+ Example[^glimmer-call-bug]
+ ```gjs
+ import { on } from '@ember/modifier';
+
+
+
+
+ ```
+ [^glimmer-call-bug]: demo/example omitted because the glimmer-vm, at the time of the writing of this RFC has not fixed a bug that where this-binding is lost on method calls.
+
- [`navigator`](https://html.spec.whatwg.org/multipage/system-state.html#dom-navigator)
+
+ [Example](https://limber.glimdown.com/edit?c=FAHgLgpgtgDgNgQ0gPmAAjQb0wczgewCME4AVACwEsBnAOgDsEA3SnJfAJ1oFdqIOAgjgj0wAXzGgA9JFiIUQA&format=gjs)
+ ```gjs
+
+ {{navigator.userAgent}}
+
+
+
+ ```
+
- [`window`](https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-window)
+
+ Most APIs are also available on `window`
+
- [`document`](https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-document-2)
+
+ Example[^glimmer-call-bug]
+ ```gjs
+
+
+
+ {{#in-element (document.getElementById 'foo')}}
+ rendered elsewhere
+ {{/in-element}}
+
+ ```
+
+
- [`localStorage`](https://html.spec.whatwg.org/multipage/webstorage.html#the-localstorage-attribute)
+
+ Example[^glimmer-call-bug]
+ ```gjs
+
+ Current Theme: {{localStorage.getItem 'theme'}}
+
+
+
+ ```
+
- [`sessionStorage`](https://html.spec.whatwg.org/multipage/webstorage.html#the-sessionstorage-attribute)
+ Example[^glimmer-call-bug]
+ ```gjs
+
+ Current Theme: {{sessionStorage.getItem 'theme'}}
+
+
+
+ ```
+
+
### functions / utilities
TC39:
From 98474a4a98697993ce81298f1e10f52876c6e874 Mon Sep 17 00:00:00 2001
From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com>
Date: Sat, 18 Jan 2025 14:08:00 -0500
Subject: [PATCH 09/32] Updates
---
text/1070-default-globals-for-strict-mode.md | 73 ++++++++++++++++++++
1 file changed, 73 insertions(+)
diff --git a/text/1070-default-globals-for-strict-mode.md b/text/1070-default-globals-for-strict-mode.md
index a58b7eb761..713bba10d7 100644
--- a/text/1070-default-globals-for-strict-mode.md
+++ b/text/1070-default-globals-for-strict-mode.md
@@ -266,14 +266,87 @@ WHATWG:
TC39:
- [`isNaN`](https://tc39.es/ecma262/#sec-isnan-number)
+
+ [Example](https://limber.glimdown.com/edit?c=FAHgLgpgtgDgNgQ0gPmAAjQb0wYgJYBmaAFAOZwD2ARgnACoAWeAzgHQsByCHaADAJQBfQegxoWaLh1HYIcZhGGiMEgrQUBPGZgD0hJSB2RYiFEA&format=gjs)
+ ```gjs
+
+ {{#if (isNaN 0)}}
+ is NaN
+ {{else}}
+ is falsey
+ {{/if}}
+
+ ```
+
- [`isFinite`](https://tc39.es/ecma262/#sec-isfinite-number)
+
+ [Example](https://limber.glimdown.com/edit?c=FAHgLgpgtgDgNgQ0gPmAAjQb0wYgJYBmaAFAOZwD2ARgnACoAWeAzgHQsBieAdnpGuWq1GLVgEluBHnwCeASgC%2BC9BjQs0XXpBXYIcZhCUqM6grQMydmAPSEjIa5FiIUQA&format=gjs)
+ ```gjs
+
+ {{#if (isFinite Infinity)}}
+ is Finite
+ {{else}}
+ is falsey
+ {{/if}}
+
+ ```
+
- [`parseInt`](https://tc39.es/ecma262/#sec-parseint-string-radix)
+
+
+ [Example](https://limber.glimdown.com/edit?c=FAHgLgpgtgDgNgQ0gPmAAjQb0wczgewCME4AVACwEsBnAOhgQCdqIBJAOzDQCZaBmAL4DQAekixEKIA&format=gjs)
+ ```gjs
+
+ {{parseInt 2.3}}
+
+ ```
+
- [`parseFloat`](https://tc39.es/ecma262/#sec-parsefloat-string)
+
+
+ [Example](https://limber.glimdown.com/edit?c=FAHgLgpgtgDgNgQ0gPmAAjQb0wczgewCME4AVACwEsBnAOhgQCdqIAxApNAJloGYBffqAD0kWIhRA&format=gjs)
+ ```gjs
+
+ {{parseFloat 2.3}}
+
+ ```
+
- [`decodeURI`](https://tc39.es/ecma262/#sec-decodeuri-encodeduri)
+
+ [Example](https://limber.glimdown.com/edit?c=FAHgLgpgtgDgNgQ0gPmAAjQb0wczgewCME4AVACwEsBnAOgBMIBjfRgVQCUBJNAIgFIArACEAHkIAivAL7S0oAPSRYiFEA&format=gjs)
+ ```gjs
+
+ {{decodeURI "%5Bx%5D"}}
+
+ ```
+
- [`decodeURIComponent`](https://tc39.es/ecma262/#sec-decodeuricomponent-encodeduricomponent)
+
+ [Example](https://limber.glimdown.com/edit?c=FAHgLgpgtgDgNgQ0gPmAAjQb0wczgewCME4AVACwEsBnAOgBMIBjfRgVQCUBJAYX1nwA7CILBoARAFIArACEAHjIAi4gL6q0oAPSRYiFEA&format=gjs)
+ ```gjs
+
+ {{decodeURIComponent "%5Bx%5D"}}
+
+ ```
+
- [`encodeURI`](https://tc39.es/ecma262/#sec-encodeuri-uri)
+
+ [Example](https://limber.glimdown.com/edit?c=FAHgLgpgtgDgNgQ0gPmAAjQb0wczgewCME4AVACwEsBnAOggDsBjfAEwgFUAlASTQCIA2gA8AuvwC%2BEtKAD0kWIhRA&format=gjs)
+ ```gjs
+
+ {{encodeURI "[x]"}}
+
+ ```
+
- [`encodeURIComponent`](https://tc39.es/ecma262/#sec-encodeuricomponent-uricomponent)
+ [Example](https://limber.glimdown.com/edit?c=FAHgLgpgtgDgNgQ0gPmAAjQb0wczgewCME4AVACwEsBnAOggDsBjfAEwgFUAlASQGF8sfA0Zg0AIgDaADwC64gL4K0oAPSRYiFEA&format=gjs)
+ ```gjs
+
+ {{encodeURIComponent "[x]"}}
+
+ ```
+
WHATWG:
- [`atob`](https://html.spec.whatwg.org/multipage/webappapis.html#dom-btoa)
From 23a4afd7217f2f8033bf51873f5b99a530005b0a Mon Sep 17 00:00:00 2001
From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com>
Date: Sat, 18 Jan 2025 14:13:43 -0500
Subject: [PATCH 10/32] Updates
---
text/1070-default-globals-for-strict-mode.md | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/text/1070-default-globals-for-strict-mode.md b/text/1070-default-globals-for-strict-mode.md
index 713bba10d7..9c4421588c 100644
--- a/text/1070-default-globals-for-strict-mode.md
+++ b/text/1070-default-globals-for-strict-mode.md
@@ -359,6 +359,20 @@ WHATWG:
TC39:
- [`Array`](https://tc39.es/ecma262/#sec-constructor-properties-of-the-global-object-array)
+
+ [Example](https://limber.glimdown.com/edit?c=DwFwpgtgDgNghuAfAKAATtQb0wYjHAYwAtUAKAcxgHsAjOGAFSIEsBnAOgEEAnbuAT1QBGVACZUAZgCUqOK1QAfZuAgKAvmrQZt2ZZA1b02APT5iB4MZWwEYFEA&format=gjs)
+ ```gjs
+
+ {{#each (Array 1 2 3) as |item|}}
+ {{item}}
+ {{/each}}
+
+ ```
+
+ > [!NOTE]
+ > This is the same behavior as `(array)` in loose mode, and `import { array } from '@ember/helper';`, however, while the creation of the array is reactive (e.g.: if we had said `(Array @foo @bar)`, changes to `@foo` and `@bar` would cause the creation of a new array instance), the proposed _built-in_ `(array)` _keyword_ behavior _may_ have reactive items, as proposed by [RFC#1068](https://github.com/emberjs/rfcs/pull/1068)
+
+
- [`BigInt`](https://tc39.es/ecma262/#sec-constructor-properties-of-the-global-object-bigint)
- [`Boolean`](https://tc39.es/ecma262/#sec-constructor-properties-of-the-global-object-boolean)
- [`Date`](https://tc39.es/ecma262/#sec-constructor-properties-of-the-global-object-date)
From 16659411a20520d62cca9e0b41016a27837914d8 Mon Sep 17 00:00:00 2001
From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com>
Date: Sat, 18 Jan 2025 14:14:46 -0500
Subject: [PATCH 11/32] Updates
---
text/1070-default-globals-for-strict-mode.md | 1 -
1 file changed, 1 deletion(-)
diff --git a/text/1070-default-globals-for-strict-mode.md b/text/1070-default-globals-for-strict-mode.md
index 9c4421588c..fd8f4bfe62 100644
--- a/text/1070-default-globals-for-strict-mode.md
+++ b/text/1070-default-globals-for-strict-mode.md
@@ -368,7 +368,6 @@ TC39:
{{/each}}
```
-
> [!NOTE]
> This is the same behavior as `(array)` in loose mode, and `import { array } from '@ember/helper';`, however, while the creation of the array is reactive (e.g.: if we had said `(Array @foo @bar)`, changes to `@foo` and `@bar` would cause the creation of a new array instance), the proposed _built-in_ `(array)` _keyword_ behavior _may_ have reactive items, as proposed by [RFC#1068](https://github.com/emberjs/rfcs/pull/1068)
From 5082c39ebcf26326a2d088c48417cf9aa5c08928 Mon Sep 17 00:00:00 2001
From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com>
Date: Sat, 18 Jan 2025 14:15:09 -0500
Subject: [PATCH 12/32] Updates
---
text/1070-default-globals-for-strict-mode.md | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/text/1070-default-globals-for-strict-mode.md b/text/1070-default-globals-for-strict-mode.md
index fd8f4bfe62..f3cdc9acf8 100644
--- a/text/1070-default-globals-for-strict-mode.md
+++ b/text/1070-default-globals-for-strict-mode.md
@@ -361,6 +361,9 @@ TC39:
- [`Array`](https://tc39.es/ecma262/#sec-constructor-properties-of-the-global-object-array)
[Example](https://limber.glimdown.com/edit?c=DwFwpgtgDgNghuAfAKAATtQb0wYjHAYwAtUAKAcxgHsAjOGAFSIEsBnAOgEEAnbuAT1QBGVACZUAZgCUqOK1QAfZuAgKAvmrQZt2ZZA1b02APT5iB4MZWwEYFEA&format=gjs)
+ > [!NOTE]
+ > This is the same behavior as `(array)` in loose mode, and `import { array } from '@ember/helper';`, however, while the creation of the array is reactive (e.g.: if we had said `(Array @foo @bar)`, changes to `@foo` and `@bar` would cause the creation of a new array instance), the proposed _built-in_ `(array)` _keyword_ behavior _may_ have reactive items, as proposed by [RFC#1068](https://github.com/emberjs/rfcs/pull/1068)
+
```gjs
{{#each (Array 1 2 3) as |item|}}
@@ -368,9 +371,7 @@ TC39:
{{/each}}
```
- > [!NOTE]
- > This is the same behavior as `(array)` in loose mode, and `import { array } from '@ember/helper';`, however, while the creation of the array is reactive (e.g.: if we had said `(Array @foo @bar)`, changes to `@foo` and `@bar` would cause the creation of a new array instance), the proposed _built-in_ `(array)` _keyword_ behavior _may_ have reactive items, as proposed by [RFC#1068](https://github.com/emberjs/rfcs/pull/1068)
-
+
- [`BigInt`](https://tc39.es/ecma262/#sec-constructor-properties-of-the-global-object-bigint)
- [`Boolean`](https://tc39.es/ecma262/#sec-constructor-properties-of-the-global-object-boolean)
From 045d0919cc0a0750c1eda3b31a2c8cb67f4fee75 Mon Sep 17 00:00:00 2001
From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com>
Date: Sat, 18 Jan 2025 14:15:30 -0500
Subject: [PATCH 13/32] Updates
---
text/1070-default-globals-for-strict-mode.md | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/text/1070-default-globals-for-strict-mode.md b/text/1070-default-globals-for-strict-mode.md
index f3cdc9acf8..26714f3ca6 100644
--- a/text/1070-default-globals-for-strict-mode.md
+++ b/text/1070-default-globals-for-strict-mode.md
@@ -360,9 +360,10 @@ TC39:
- [`Array`](https://tc39.es/ecma262/#sec-constructor-properties-of-the-global-object-array)
- [Example](https://limber.glimdown.com/edit?c=DwFwpgtgDgNghuAfAKAATtQb0wYjHAYwAtUAKAcxgHsAjOGAFSIEsBnAOgEEAnbuAT1QBGVACZUAZgCUqOK1QAfZuAgKAvmrQZt2ZZA1b02APT5iB4MZWwEYFEA&format=gjs)
> [!NOTE]
> This is the same behavior as `(array)` in loose mode, and `import { array } from '@ember/helper';`, however, while the creation of the array is reactive (e.g.: if we had said `(Array @foo @bar)`, changes to `@foo` and `@bar` would cause the creation of a new array instance), the proposed _built-in_ `(array)` _keyword_ behavior _may_ have reactive items, as proposed by [RFC#1068](https://github.com/emberjs/rfcs/pull/1068)
+
+ [Example](https://limber.glimdown.com/edit?c=DwFwpgtgDgNghuAfAKAATtQb0wYjHAYwAtUAKAcxgHsAjOGAFSIEsBnAOgEEAnbuAT1QBGVACZUAZgCUqOK1QAfZuAgKAvmrQZt2ZZA1b02APT5iB4MZWwEYFEA&format=gjs)
```gjs
From a6f328948396620e20f0164ff650ffc1633bef94 Mon Sep 17 00:00:00 2001
From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com>
Date: Sat, 18 Jan 2025 14:15:49 -0500
Subject: [PATCH 14/32] Updates
---
text/1070-default-globals-for-strict-mode.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/text/1070-default-globals-for-strict-mode.md b/text/1070-default-globals-for-strict-mode.md
index 26714f3ca6..04103f19ba 100644
--- a/text/1070-default-globals-for-strict-mode.md
+++ b/text/1070-default-globals-for-strict-mode.md
@@ -360,8 +360,8 @@ TC39:
- [`Array`](https://tc39.es/ecma262/#sec-constructor-properties-of-the-global-object-array)
- > [!NOTE]
- > This is the same behavior as `(array)` in loose mode, and `import { array } from '@ember/helper';`, however, while the creation of the array is reactive (e.g.: if we had said `(Array @foo @bar)`, changes to `@foo` and `@bar` would cause the creation of a new array instance), the proposed _built-in_ `(array)` _keyword_ behavior _may_ have reactive items, as proposed by [RFC#1068](https://github.com/emberjs/rfcs/pull/1068)
+> [!NOTE]
+> This is the same behavior as `(array)` in loose mode, and `import { array } from '@ember/helper';`, however, while the creation of the array is reactive (e.g.: if we had said `(Array @foo @bar)`, changes to `@foo` and `@bar` would cause the creation of a new array instance), the proposed _built-in_ `(array)` _keyword_ behavior _may_ have reactive items, as proposed by [RFC#1068](https://github.com/emberjs/rfcs/pull/1068)
[Example](https://limber.glimdown.com/edit?c=DwFwpgtgDgNghuAfAKAATtQb0wYjHAYwAtUAKAcxgHsAjOGAFSIEsBnAOgEEAnbuAT1QBGVACZUAZgCUqOK1QAfZuAgKAvmrQZt2ZZA1b02APT5iB4MZWwEYFEA&format=gjs)
From 64e5962fc1a80176d3a61996027677c4c3467835 Mon Sep 17 00:00:00 2001
From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com>
Date: Sat, 18 Jan 2025 14:16:45 -0500
Subject: [PATCH 15/32] Updates
---
text/1070-default-globals-for-strict-mode.md | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/text/1070-default-globals-for-strict-mode.md b/text/1070-default-globals-for-strict-mode.md
index 04103f19ba..63299186a6 100644
--- a/text/1070-default-globals-for-strict-mode.md
+++ b/text/1070-default-globals-for-strict-mode.md
@@ -360,8 +360,6 @@ TC39:
- [`Array`](https://tc39.es/ecma262/#sec-constructor-properties-of-the-global-object-array)
-> [!NOTE]
-> This is the same behavior as `(array)` in loose mode, and `import { array } from '@ember/helper';`, however, while the creation of the array is reactive (e.g.: if we had said `(Array @foo @bar)`, changes to `@foo` and `@bar` would cause the creation of a new array instance), the proposed _built-in_ `(array)` _keyword_ behavior _may_ have reactive items, as proposed by [RFC#1068](https://github.com/emberjs/rfcs/pull/1068)
[Example](https://limber.glimdown.com/edit?c=DwFwpgtgDgNghuAfAKAATtQb0wYjHAYwAtUAKAcxgHsAjOGAFSIEsBnAOgEEAnbuAT1QBGVACZUAZgCUqOK1QAfZuAgKAvmrQZt2ZZA1b02APT5iB4MZWwEYFEA&format=gjs)
@@ -372,6 +370,12 @@ TC39:
{{/each}}
```
+
+
+> [!NOTE]
+> This is the same behavior as `(array)` in loose mode, and `import { array } from '@ember/helper';`, however, while the creation of the array is reactive (e.g.: if we had said `(Array @foo @bar)`, changes to `@foo` and `@bar` would cause the creation of a new array instance), the proposed _built-in_ `(array)` _keyword_ behavior _may_ have reactive items, as proposed by [RFC#1068](https://github.com/emberjs/rfcs/pull/1068)
+
+
+
> [!NOTE]
> This is the same behavior as `(array)` in loose mode, and `import { array } from '@ember/helper';`, however, while the creation of the array is reactive (e.g.: if we had said `(Array @foo @bar)`, changes to `@foo` and `@bar` would cause the creation of a new array instance), the proposed _built-in_ `(array)` _keyword_ behavior _may_ have reactive items, as proposed by [RFC#1068](https://github.com/emberjs/rfcs/pull/1068)
+
+ .. pull-quote::
+ [!NOTE]
+ This is the same behavior as `(array)` in loose mode, and `import { array } from '@ember/helper';`, however, while the creation of the array is reactive (e.g.: if we had said `(Array @foo @bar)`, changes to `@foo` and `@bar` would cause the creation of a new array instance), the proposed _built-in_ `(array)` _keyword_ behavior _may_ have reactive items, as proposed by [RFC#1068](https://github.com/emberjs/rfcs/pull/1068)
-> [!NOTE]
-> This is the same behavior as `(array)` in loose mode, and `import { array } from '@ember/helper';`, however, while the creation of the array is reactive (e.g.: if we had said `(Array @foo @bar)`, changes to `@foo` and `@bar` would cause the creation of a new array instance), the proposed _built-in_ `(array)` _keyword_ behavior _may_ have reactive items, as proposed by [RFC#1068](https://github.com/emberjs/rfcs/pull/1068)
-
-
-
- [`BigInt`](https://tc39.es/ecma262/#sec-constructor-properties-of-the-global-object-bigint)
From 66864797982474d54b54264b4581eb79a0c9f451 Mon Sep 17 00:00:00 2001
From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com>
Date: Sat, 18 Jan 2025 14:19:17 -0500
Subject: [PATCH 19/32] Updates
---
text/1070-default-globals-for-strict-mode.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/text/1070-default-globals-for-strict-mode.md b/text/1070-default-globals-for-strict-mode.md
index 753bd76e99..44a51bfe27 100644
--- a/text/1070-default-globals-for-strict-mode.md
+++ b/text/1070-default-globals-for-strict-mode.md
@@ -373,6 +373,7 @@ TC39:
.. pull-quote::
+
[!NOTE]
This is the same behavior as `(array)` in loose mode, and `import { array } from '@ember/helper';`, however, while the creation of the array is reactive (e.g.: if we had said `(Array @foo @bar)`, changes to `@foo` and `@bar` would cause the creation of a new array instance), the proposed _built-in_ `(array)` _keyword_ behavior _may_ have reactive items, as proposed by [RFC#1068](https://github.com/emberjs/rfcs/pull/1068)
From 85c472a838cb7954940cc18578521213bc1a4a0d Mon Sep 17 00:00:00 2001
From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com>
Date: Sat, 18 Jan 2025 14:19:31 -0500
Subject: [PATCH 20/32] Updates
---
text/1070-default-globals-for-strict-mode.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/text/1070-default-globals-for-strict-mode.md b/text/1070-default-globals-for-strict-mode.md
index 44a51bfe27..34a54aa3b4 100644
--- a/text/1070-default-globals-for-strict-mode.md
+++ b/text/1070-default-globals-for-strict-mode.md
@@ -374,8 +374,8 @@ TC39:
.. pull-quote::
- [!NOTE]
- This is the same behavior as `(array)` in loose mode, and `import { array } from '@ember/helper';`, however, while the creation of the array is reactive (e.g.: if we had said `(Array @foo @bar)`, changes to `@foo` and `@bar` would cause the creation of a new array instance), the proposed _built-in_ `(array)` _keyword_ behavior _may_ have reactive items, as proposed by [RFC#1068](https://github.com/emberjs/rfcs/pull/1068)
+ > [!NOTE]
+ > This is the same behavior as `(array)` in loose mode, and `import { array } from '@ember/helper';`, however, while the creation of the array is reactive (e.g.: if we had said `(Array @foo @bar)`, changes to `@foo` and `@bar` would cause the creation of a new array instance), the proposed _built-in_ `(array)` _keyword_ behavior _may_ have reactive items, as proposed by [RFC#1068](https://github.com/emberjs/rfcs/pull/1068)
From 030feb4635b9ea810b535d1f04601ca0b873488d Mon Sep 17 00:00:00 2001
From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com>
Date: Sat, 18 Jan 2025 14:20:32 -0500
Subject: [PATCH 21/32] Updates
---
text/1070-default-globals-for-strict-mode.md | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/text/1070-default-globals-for-strict-mode.md b/text/1070-default-globals-for-strict-mode.md
index 34a54aa3b4..2f1db1d31f 100644
--- a/text/1070-default-globals-for-strict-mode.md
+++ b/text/1070-default-globals-for-strict-mode.md
@@ -371,11 +371,8 @@ TC39:
```
-
- .. pull-quote::
-
- > [!NOTE]
- > This is the same behavior as `(array)` in loose mode, and `import { array } from '@ember/helper';`, however, while the creation of the array is reactive (e.g.: if we had said `(Array @foo @bar)`, changes to `@foo` and `@bar` would cause the creation of a new array instance), the proposed _built-in_ `(array)` _keyword_ behavior _may_ have reactive items, as proposed by [RFC#1068](https://github.com/emberjs/rfcs/pull/1068)
+> > [!NOTE]
+> > This is the same behavior as `(array)` in loose mode, and `import { array } from '@ember/helper';`, however, while the creation of the array is reactive (e.g.: if we had said `(Array @foo @bar)`, changes to `@foo` and `@bar` would cause the creation of a new array instance), the proposed _built-in_ `(array)` _keyword_ behavior _may_ have reactive items, as proposed by [RFC#1068](https://github.com/emberjs/rfcs/pull/1068)
From 6318ef246d830717ecef1997f63b603035d827c6 Mon Sep 17 00:00:00 2001
From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com>
Date: Sat, 18 Jan 2025 14:20:45 -0500
Subject: [PATCH 22/32] Updates
---
text/1070-default-globals-for-strict-mode.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/text/1070-default-globals-for-strict-mode.md b/text/1070-default-globals-for-strict-mode.md
index 2f1db1d31f..6173acf7bd 100644
--- a/text/1070-default-globals-for-strict-mode.md
+++ b/text/1070-default-globals-for-strict-mode.md
@@ -371,8 +371,8 @@ TC39:
```
-> > [!NOTE]
-> > This is the same behavior as `(array)` in loose mode, and `import { array } from '@ember/helper';`, however, while the creation of the array is reactive (e.g.: if we had said `(Array @foo @bar)`, changes to `@foo` and `@bar` would cause the creation of a new array instance), the proposed _built-in_ `(array)` _keyword_ behavior _may_ have reactive items, as proposed by [RFC#1068](https://github.com/emberjs/rfcs/pull/1068)
+> [!NOTE]
+> This is the same behavior as `(array)` in loose mode, and `import { array } from '@ember/helper';`, however, while the creation of the array is reactive (e.g.: if we had said `(Array @foo @bar)`, changes to `@foo` and `@bar` would cause the creation of a new array instance), the proposed _built-in_ `(array)` _keyword_ behavior _may_ have reactive items, as proposed by [RFC#1068](https://github.com/emberjs/rfcs/pull/1068)
From 4def2186ce26c60eb511d91d0227470d34f5771d Mon Sep 17 00:00:00 2001
From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com>
Date: Sat, 18 Jan 2025 14:25:07 -0500
Subject: [PATCH 23/32] Updates
---
text/1070-default-globals-for-strict-mode.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/text/1070-default-globals-for-strict-mode.md b/text/1070-default-globals-for-strict-mode.md
index 6173acf7bd..52c8f2f48f 100644
--- a/text/1070-default-globals-for-strict-mode.md
+++ b/text/1070-default-globals-for-strict-mode.md
@@ -361,6 +361,7 @@ TC39:
- [`Array`](https://tc39.es/ecma262/#sec-constructor-properties-of-the-global-object-array)
+ See note about `(array)`, `@ember/helper`, and [RFC#1000](https://github.com/emberjs/rfcs/pull/1000)[^reactive-array-note]
[Example](https://limber.glimdown.com/edit?c=DwFwpgtgDgNghuAfAKAATtQb0wYjHAYwAtUAKAcxgHsAjOGAFSIEsBnAOgEEAnbuAT1QBGVACZUAZgCUqOK1QAfZuAgKAvmrQZt2ZZA1b02APT5iB4MZWwEYFEA&format=gjs)
```gjs
@@ -371,8 +372,7 @@ TC39:
```
-> [!NOTE]
-> This is the same behavior as `(array)` in loose mode, and `import { array } from '@ember/helper';`, however, while the creation of the array is reactive (e.g.: if we had said `(Array @foo @bar)`, changes to `@foo` and `@bar` would cause the creation of a new array instance), the proposed _built-in_ `(array)` _keyword_ behavior _may_ have reactive items, as proposed by [RFC#1068](https://github.com/emberjs/rfcs/pull/1068)
+ [^reactive-array-note]: This is the same behavior as `(array)` in loose mode, and `import { array } from '@ember/helper';`, however, while the creation of the array is reactive (e.g.: if we had said `(Array @foo @bar)`, changes to `@foo` and `@bar` would cause the creation of a new array instance), the proposed _built-in_ `(array)` _keyword_ behavior _may_ have reactive items, as proposed by [RFC#1068](https://github.com/emberjs/rfcs/pull/1068)
From 917b997ff06186afa0bc419e12cb0508c65029bd Mon Sep 17 00:00:00 2001
From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com>
Date: Sat, 18 Jan 2025 14:25:35 -0500
Subject: [PATCH 24/32] Updates
---
text/1070-default-globals-for-strict-mode.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/text/1070-default-globals-for-strict-mode.md b/text/1070-default-globals-for-strict-mode.md
index 52c8f2f48f..5e7a46dcef 100644
--- a/text/1070-default-globals-for-strict-mode.md
+++ b/text/1070-default-globals-for-strict-mode.md
@@ -362,6 +362,7 @@ TC39:
See note about `(array)`, `@ember/helper`, and [RFC#1000](https://github.com/emberjs/rfcs/pull/1000)[^reactive-array-note]
+
[Example](https://limber.glimdown.com/edit?c=DwFwpgtgDgNghuAfAKAATtQb0wYjHAYwAtUAKAcxgHsAjOGAFSIEsBnAOgEEAnbuAT1QBGVACZUAZgCUqOK1QAfZuAgKAvmrQZt2ZZA1b02APT5iB4MZWwEYFEA&format=gjs)
```gjs
From 397e18b5e2090c6be0fe174f4504f131b1ee379c Mon Sep 17 00:00:00 2001
From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com>
Date: Sat, 18 Jan 2025 14:25:49 -0500
Subject: [PATCH 25/32] Updates
---
text/1070-default-globals-for-strict-mode.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/text/1070-default-globals-for-strict-mode.md b/text/1070-default-globals-for-strict-mode.md
index 5e7a46dcef..ff23de38ec 100644
--- a/text/1070-default-globals-for-strict-mode.md
+++ b/text/1070-default-globals-for-strict-mode.md
@@ -361,7 +361,7 @@ TC39:
- [`Array`](https://tc39.es/ecma262/#sec-constructor-properties-of-the-global-object-array)
- See note about `(array)`, `@ember/helper`, and [RFC#1000](https://github.com/emberjs/rfcs/pull/1000)[^reactive-array-note]
+ See note[^reactive-array-note] about `(array)`, `@ember/helper`, and [RFC#1000](https://github.com/emberjs/rfcs/pull/1000)[^reactive-array-note]
[Example](https://limber.glimdown.com/edit?c=DwFwpgtgDgNghuAfAKAATtQb0wYjHAYwAtUAKAcxgHsAjOGAFSIEsBnAOgEEAnbuAT1QBGVACZUAZgCUqOK1QAfZuAgKAvmrQZt2ZZA1b02APT5iB4MZWwEYFEA&format=gjs)
From 31aedfdc0004e3f2eb531dd74ffafb3529154fef Mon Sep 17 00:00:00 2001
From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com>
Date: Sat, 18 Jan 2025 18:33:11 -0500
Subject: [PATCH 26/32] Updates
---
text/1070-default-globals-for-strict-mode.md | 53 ++++++++++++++++++++
1 file changed, 53 insertions(+)
diff --git a/text/1070-default-globals-for-strict-mode.md b/text/1070-default-globals-for-strict-mode.md
index ff23de38ec..1d90adf32b 100644
--- a/text/1070-default-globals-for-strict-mode.md
+++ b/text/1070-default-globals-for-strict-mode.md
@@ -378,12 +378,65 @@ TC39:
- [`BigInt`](https://tc39.es/ecma262/#sec-constructor-properties-of-the-global-object-bigint)
+
+ [Example](https://limber.glimdown.com/edit?c=DwFwpgtgDgNghuAfAKAATtQb0wcxgewCM4YAVACwEsBnAOgCFKcBJAOxFQCIAGADwEYAZsJGiRnAL4TkwAPTho8JMiA&format=gjs)
+ ```gjs
+
+ {{BigInt "0x1fffffffffffff"}}
+
+ ```
+
- [`Boolean`](https://tc39.es/ecma262/#sec-constructor-properties-of-the-global-object-boolean)
+
+ [Example](https://limber.glimdown.com/edit?c=DwFwpgtgDgNghuAfAKAATtQb0wYgJYBmqAFAOYwD2ARnDACoAWeAzgHQBCFFMYcAdqgBEggJQBfMWgzoQAJwCuYKemxgYzMBOUYCtDduwB6QluCHw0eEmRA&format=gjs)
+ ```gjs
+
+ {{#if (Boolean "")}}
+ true
+ {{else}}
+ false
+ {{/if}}
+
+ ```
+
- [`Date`](https://tc39.es/ecma262/#sec-constructor-properties-of-the-global-object-date)
+
+ [Example](https://limber.glimdown.com/edit?c=DwFwpgtgDgNghuAfAKAATtQb0wcxgewCM4YAVACwEsBnAOgBEExUBGAdgGY2AmAFg4AMAgKwBOPgF8JyYAHpw0eEmRA&format=gjs)
+ ```gjs
+
+ {{Date 1737243005924}}
+
+ ```
+
- [`Number`](https://tc39.es/ecma262/#sec-constructor-properties-of-the-global-object-number)
+
+ [Example](https://limber.glimdown.com/edit?c=DwFwpgtgDgNghuAfAKAATtQb0wcxgewCM4YAVACwEsBnAOgDkBXCQsAJ1QCIAmbzgX37JgAenDR4SZEA&format=gjs)
+ ```gjs
+
+ {{Number "22"}}
+
+ ```
+
- [`Object`](https://tc39.es/ecma262/#sec-constructor-properties-of-the-global-object-object)
+
+ [Example](https://limber.glimdown.com/edit?c=DwFwpgtgDgNghuAfAKAATtQb0wYjHAYwAsBaASwDtUAKAcxgHsAjOGAFSLIGcA6AeSYArMARCo4AXgCMqJhIBMASnFdUAHwDWYAJ6oAbqwCuYNQF9TaDOmxbt5gFxZMBmMfOXrmAPT5i5Cu7AXuDQ8EjIQA&format=gjs)
+ ```gjs
+
+ {{#each-in (globalThis.Object a=1 b=2) as |key value|}}
+ {{key}}: {{value}}
+ {{/each-in}}
+
+ ```
+
- [`String`](https://tc39.es/ecma262/#sec-constructor-properties-of-the-global-object-string)
+ [Example](https://limber.glimdown.com/edit?c=DwFwpgtgDgNghuAfAKAATtQb0wcxgewCM4YAVACwEsBnAOgGUQAnSgOx1QCZOBfH5YAHpw0eEmRA&format=gjs)
+ ```gjs
+
+ {{globalThis.String 22}}
+
+ ```
+
### Values
TC39:
From 055687a065c52b6111f9d8d930754d773bfca987 Mon Sep 17 00:00:00 2001
From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com>
Date: Sat, 18 Jan 2025 18:37:26 -0500
Subject: [PATCH 27/32] Updates
---
text/1070-default-globals-for-strict-mode.md | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/text/1070-default-globals-for-strict-mode.md b/text/1070-default-globals-for-strict-mode.md
index 1d90adf32b..5a4eb52f37 100644
--- a/text/1070-default-globals-for-strict-mode.md
+++ b/text/1070-default-globals-for-strict-mode.md
@@ -125,15 +125,18 @@ Given the above criteria, the following should be added to default-available str
TC39:
-- [`globalThis`](https://tc39.es/ecma262/#sec-globalthis)
+- [`globalThis`](https://tc39.es/ecma262/#sec-globalthis) - Already available.
+ Example
- Already available. [Example](https://limber.glimdown.com/edit?c=MYewdgzgLgBAJgQygmBeGBvGBzATgU3ygEsxsAuGAcgAt8AbekGKOggQipgF8BuAKH4AeKPgC2AB3pJ8APn4xMGbEwBGCegBUaxCADoAUgGUA8gDk90XKWzEAZgE94SBN27CA9KMnTRsoA&format=gjs)
+ [Link](https://limber.glimdown.com/edit?c=MYewdgzgLgBAJgQygmBeGBvGBzATgU3ygEsxsAuGAcgAt8AbekGKOggQipgF8BuAKH4AeKPgC2AB3pJ8APn4xMGbEwBGCegBUaxCADoAUgGUA8gDk90XKWzEAZgE94SBN27CA9KMnTRsoA&format=gjs)
```gjs
{{globalThis.JSON.stringify @data}}
```
+
+
- [`Atomics`](https://tc39.es/ecma262/#sec-atomics)
[Example](https://limber.glimdown.com/edit?c=MYewdgzgLgBARgVwGZIKYCcYF4ZlQdxgEF10BDATwCFk10AKARgDYBKAbgChRJYEBLMFAAc2XARgBVQSJLkK9RCgwdOAocIDaABgC6YgOxdOAehMwDMetsa3WMABoB5AEowATFe03t9nAFYvRhtWAB44dAA%2BTiIoEABbfmAIADoADxAGdREAGhhtPPdWTk5QqFR4gAcAGzJy6JgYAG8mgHNqkDgyaoAVAAt%2BVNiEpNSOsgATGGzhAF9Z0pNyqtr6oA&format=gjs)
From cfefd279e8a185f5f7b17f646704b656ab056b15 Mon Sep 17 00:00:00 2001
From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com>
Date: Sat, 18 Jan 2025 18:42:15 -0500
Subject: [PATCH 28/32] ya
---
text/1070-default-globals-for-strict-mode.md | 164 ++++++++++++++++---
1 file changed, 141 insertions(+), 23 deletions(-)
diff --git a/text/1070-default-globals-for-strict-mode.md b/text/1070-default-globals-for-strict-mode.md
index 5a4eb52f37..72d965ea83 100644
--- a/text/1070-default-globals-for-strict-mode.md
+++ b/text/1070-default-globals-for-strict-mode.md
@@ -126,6 +126,7 @@ Given the above criteria, the following should be added to default-available str
TC39:
- [`globalThis`](https://tc39.es/ecma262/#sec-globalthis) - Already available.
+
Example
[Link](https://limber.glimdown.com/edit?c=MYewdgzgLgBAJgQygmBeGBvGBzATgU3ygEsxsAuGAcgAt8AbekGKOggQipgF8BuAKH4AeKPgC2AB3pJ8APn4xMGbEwBGCegBUaxCADoAUgGUA8gDk90XKWzEAZgE94SBN27CA9KMnTRsoA&format=gjs)
@@ -139,7 +140,9 @@ TC39:
- [`Atomics`](https://tc39.es/ecma262/#sec-atomics)
- [Example](https://limber.glimdown.com/edit?c=MYewdgzgLgBARgVwGZIKYCcYF4ZlQdxgEF10BDATwCFk10AKARgDYBKAbgChRJYEBLMFAAc2XARgBVQSJLkK9RCgwdOAocIDaABgC6YgOxdOAehMwDMetsa3WMABoB5AEowATFe03t9nAFYvRhtWAB44dAA%2BTiIoEABbfmAIADoADxAGdREAGhhtPPdWTk5QqFR4gAcAGzJy6JgYAG8mgHNqkDgyaoAVAAt%2BVNiEpNSOsgATGGzhAF9Z0pNyqtr6oA&format=gjs)
+ Example
+
+ [Link](https://limber.glimdown.com/edit?c=MYewdgzgLgBARgVwGZIKYCcYF4ZlQdxgEF10BDATwCFk10AKARgDYBKAbgChRJYEBLMFAAc2XARgBVQSJLkK9RCgwdOAocIDaABgC6YgOxdOAehMwDMetsa3WMABoB5AEowATFe03t9nAFYvRhtWAB44dAA%2BTiIoEABbfmAIADoADxAGdREAGhhtPPdWTk5QqFR4gAcAGzJy6JgYAG8mgHNqkDgyaoAVAAt%2BVNiEpNSOsgATGGzhAF9Z0pNyqtr6oA&format=gjs)
```gjs
const buffer = new ArrayBuffer(16);
const uint8 = new Uint8Array(buffer);
@@ -153,28 +156,40 @@ TC39:
```
+
+
- [`JSON`](https://tc39.es/ecma262/#sec-json)
- [Example](https://limber.glimdown.com/edit?c=MYewdgzgLgBAJgQygmBeGBvGBzATgU3ygEsxsAuGAcgAt8AbekGKOggQipgF8BuAKH4AeKPgC2AB3pJ8APn4xMGbEwBGCegBUaxCADoAUgGUA8gDk90XKWzEAZgE94SBN27CA9KMnTRsoA&format=gjs)
+ Example
+
+ [Link](https://limber.glimdown.com/edit?c=MYewdgzgLgBAJgQygmBeGBvGBzATgU3ygEsxsAuGAcgAt8AbekGKOggQipgF8BuAKH4AeKPgC2AB3pJ8APn4xMGbEwBGCegBUaxCADoAUgGUA8gDk90XKWzEAZgE94SBN27CA9KMnTRsoA&format=gjs)
```gjs
{{JSON.stringify @data}}
```
+
+
- [`Math`](https://tc39.es/ecma262/#sec-math)
- [Example](https://limber.glimdown.com/edit?c=FAHgLgpgtgDgNgQ0gPmAAjQb0wczgewCME4AVACwEsBnAOgFklzaoEAPNABjQCY0AWAL6DQAekixEKIA&format=gjs)
+ Example
+
+ [Link](https://limber.glimdown.com/edit?c=FAHgLgpgtgDgNgQ0gPmAAjQb0wczgewCME4AVACwEsBnAOgFklzaoEAPNABjQCY0AWAL6DQAekixEKIA&format=gjs)
```gjs
{{Math.max 0 2 4}}
```
+
+
- [`Reflect`](https://tc39.es/ecma262/#sec-reflect)
- [Example](https://limber.glimdown.com/edit?c=MYewdgzgLgBAJgQygmBeGBvGBzATgU3ygEsxsAuGAcgAt8AbekGKOgqmAXwG4AoXgDxR8AWwAO9JPgB8vGJgzYmAIwT0AKjWIQAdACV8AM3r5gUHdiLwkKKnkIkyVTp0EB6YeMnDpQA&format=gjs)
+ Example
+
+ [Link](https://limber.glimdown.com/edit?c=MYewdgzgLgBAJgQygmBeGBvGBzATgU3ygEsxsAuGAcgAt8AbekGKOgqmAXwG4AoXgDxR8AWwAO9JPgB8vGJgzYmAIwT0AKjWIQAdACV8AM3r5gUHdiLwkKKnkIkyVTp0EB6YeMnDpQA&format=gjs)
```gjs
const data = { greeting: 'hello there' };
@@ -183,19 +198,27 @@ TC39:
```
+
+
WHATWG:
- [`location`](https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-location)
- [Example](https://limber.glimdown.com/edit?c=FAHgLgpgtgDgNgQ0gPmAAjQb0wczgewCME4AVACwEsBnAOgIGMlL8A7W8gJwgDM0BffqAD0kWIhRA&format=gjs)
+ Example
+
+ [Link](https://limber.glimdown.com/edit?c=FAHgLgpgtgDgNgQ0gPmAAjQb0wczgewCME4AVACwEsBnAOgIGMlL8A7W8gJwgDM0BffqAD0kWIhRA&format=gjs)
```gjs
{{location.href }}
```
+
+
- [`history`](https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-history)
+ Example
+
Example[^glimmer-call-bug]
```gjs
import { on } from '@ember/modifier';
@@ -206,9 +229,13 @@ WHATWG:
```
[^glimmer-call-bug]: demo/example omitted because the glimmer-vm, at the time of the writing of this RFC has not fixed a bug that where this-binding is lost on method calls.
+
+
- [`navigator`](https://html.spec.whatwg.org/multipage/system-state.html#dom-navigator)
- [Example](https://limber.glimdown.com/edit?c=FAHgLgpgtgDgNgQ0gPmAAjQb0wczgewCME4AVACwEsBnAOgDsEA3SnJfAJ1oFdqIOAgjgj0wAXzGgA9JFiIUQA&format=gjs)
+ Example
+
+ [Link](https://limber.glimdown.com/edit?c=FAHgLgpgtgDgNgQ0gPmAAjQb0wczgewCME4AVACwEsBnAOgDsEA3SnJfAJ1oFdqIOAgjgj0wAXzGgA9JFiIUQA&format=gjs)
```gjs
{{navigator.userAgent}}
@@ -219,12 +246,16 @@ WHATWG:
```
+
+
- [`window`](https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-window)
Most APIs are also available on `window`
- [`document`](https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-document-2)
+ Example
+
Example[^glimmer-call-bug]
```gjs
@@ -236,9 +267,13 @@ WHATWG:
```
+
+
- [`localStorage`](https://html.spec.whatwg.org/multipage/webstorage.html#the-localstorage-attribute)
+ Example
+
Example[^glimmer-call-bug]
```gjs
@@ -250,8 +285,12 @@ WHATWG:
```
+
+
- [`sessionStorage`](https://html.spec.whatwg.org/multipage/webstorage.html#the-sessionstorage-attribute)
+ Example
+
Example[^glimmer-call-bug]
```gjs
@@ -263,6 +302,8 @@ WHATWG:
```
+
+
### functions / utilities
@@ -270,7 +311,9 @@ TC39:
- [`isNaN`](https://tc39.es/ecma262/#sec-isnan-number)
- [Example](https://limber.glimdown.com/edit?c=FAHgLgpgtgDgNgQ0gPmAAjQb0wYgJYBmaAFAOZwD2ARgnACoAWeAzgHQsByCHaADAJQBfQegxoWaLh1HYIcZhGGiMEgrQUBPGZgD0hJSB2RYiFEA&format=gjs)
+ Example
+
+ [Link](https://limber.glimdown.com/edit?c=FAHgLgpgtgDgNgQ0gPmAAjQb0wYgJYBmaAFAOZwD2ARgnACoAWeAzgHQsByCHaADAJQBfQegxoWaLh1HYIcZhGGiMEgrQUBPGZgD0hJSB2RYiFEA&format=gjs)
```gjs
{{#if (isNaN 0)}}
@@ -281,9 +324,13 @@ TC39:
```
+
+
- [`isFinite`](https://tc39.es/ecma262/#sec-isfinite-number)
- [Example](https://limber.glimdown.com/edit?c=FAHgLgpgtgDgNgQ0gPmAAjQb0wYgJYBmaAFAOZwD2ARgnACoAWeAzgHQsBieAdnpGuWq1GLVgEluBHnwCeASgC%2BC9BjQs0XXpBXYIcZhCUqM6grQMydmAPSEjIa5FiIUQA&format=gjs)
+ Example
+
+ [Link](https://limber.glimdown.com/edit?c=FAHgLgpgtgDgNgQ0gPmAAjQb0wYgJYBmaAFAOZwD2ARgnACoAWeAzgHQsBieAdnpGuWq1GLVgEluBHnwCeASgC%2BC9BjQs0XXpBXYIcZhCUqM6grQMydmAPSEjIa5FiIUQA&format=gjs)
```gjs
{{#if (isFinite Infinity)}}
@@ -294,79 +341,124 @@ TC39:
```
+
+
- [`parseInt`](https://tc39.es/ecma262/#sec-parseint-string-radix)
+ Example
- [Example](https://limber.glimdown.com/edit?c=FAHgLgpgtgDgNgQ0gPmAAjQb0wczgewCME4AVACwEsBnAOhgQCdqIBJAOzDQCZaBmAL4DQAekixEKIA&format=gjs)
+ [Link](https://limber.glimdown.com/edit?c=FAHgLgpgtgDgNgQ0gPmAAjQb0wczgewCME4AVACwEsBnAOhgQCdqIBJAOzDQCZaBmAL4DQAekixEKIA&format=gjs)
```gjs
{{parseInt 2.3}}
```
+
+
- [`parseFloat`](https://tc39.es/ecma262/#sec-parsefloat-string)
+ Example
- [Example](https://limber.glimdown.com/edit?c=FAHgLgpgtgDgNgQ0gPmAAjQb0wczgewCME4AVACwEsBnAOhgQCdqIAxApNAJloGYBffqAD0kWIhRA&format=gjs)
+ [Link](https://limber.glimdown.com/edit?c=FAHgLgpgtgDgNgQ0gPmAAjQb0wczgewCME4AVACwEsBnAOhgQCdqIAxApNAJloGYBffqAD0kWIhRA&format=gjs)
```gjs
{{parseFloat 2.3}}
```
+
+
- [`decodeURI`](https://tc39.es/ecma262/#sec-decodeuri-encodeduri)
- [Example](https://limber.glimdown.com/edit?c=FAHgLgpgtgDgNgQ0gPmAAjQb0wczgewCME4AVACwEsBnAOgBMIBjfRgVQCUBJNAIgFIArACEAHkIAivAL7S0oAPSRYiFEA&format=gjs)
+ Example
+
+ [Link](https://limber.glimdown.com/edit?c=FAHgLgpgtgDgNgQ0gPmAAjQb0wczgewCME4AVACwEsBnAOgBMIBjfRgVQCUBJNAIgFIArACEAHkIAivAL7S0oAPSRYiFEA&format=gjs)
```gjs
{{decodeURI "%5Bx%5D"}}
```
+
+
- [`decodeURIComponent`](https://tc39.es/ecma262/#sec-decodeuricomponent-encodeduricomponent)
- [Example](https://limber.glimdown.com/edit?c=FAHgLgpgtgDgNgQ0gPmAAjQb0wczgewCME4AVACwEsBnAOgBMIBjfRgVQCUBJAYX1nwA7CILBoARAFIArACEAHjIAi4gL6q0oAPSRYiFEA&format=gjs)
+ Example
+
+ [Link](https://limber.glimdown.com/edit?c=FAHgLgpgtgDgNgQ0gPmAAjQb0wczgewCME4AVACwEsBnAOgBMIBjfRgVQCUBJAYX1nwA7CILBoARAFIArACEAHjIAi4gL6q0oAPSRYiFEA&format=gjs)
```gjs
{{decodeURIComponent "%5Bx%5D"}}
```
+
+
- [`encodeURI`](https://tc39.es/ecma262/#sec-encodeuri-uri)
- [Example](https://limber.glimdown.com/edit?c=FAHgLgpgtgDgNgQ0gPmAAjQb0wczgewCME4AVACwEsBnAOggDsBjfAEwgFUAlASTQCIA2gA8AuvwC%2BEtKAD0kWIhRA&format=gjs)
+ Example
+
+ [Link](https://limber.glimdown.com/edit?c=FAHgLgpgtgDgNgQ0gPmAAjQb0wczgewCME4AVACwEsBnAOggDsBjfAEwgFUAlASTQCIA2gA8AuvwC%2BEtKAD0kWIhRA&format=gjs)
```gjs
{{encodeURI "[x]"}}
```
+
+
- [`encodeURIComponent`](https://tc39.es/ecma262/#sec-encodeuricomponent-uricomponent)
- [Example](https://limber.glimdown.com/edit?c=FAHgLgpgtgDgNgQ0gPmAAjQb0wczgewCME4AVACwEsBnAOggDsBjfAEwgFUAlASQGF8sfA0Zg0AIgDaADwC64gL4K0oAPSRYiFEA&format=gjs)
+ Example
+
+ [Link](https://limber.glimdown.com/edit?c=FAHgLgpgtgDgNgQ0gPmAAjQb0wczgewCME4AVACwEsBnAOggDsBjfAEwgFUAlASQGF8sfA0Zg0AIgDaADwC64gL4K0oAPSRYiFEA&format=gjs)
```gjs
{{encodeURIComponent "[x]"}}
```
+
+
WHATWG:
- [`atob`](https://html.spec.whatwg.org/multipage/webappapis.html#dom-btoa)
+
+ Example
+
+
+
- [`btoa`](https://html.spec.whatwg.org/multipage/webappapis.html#dom-atob)
+
+ Example
+
+
+
- [`postMessage`](https://html.spec.whatwg.org/multipage/web-messaging.html#dom-window-postmessage)
+
+ Example
+
+
+
- [`structuredClone`](https://html.spec.whatwg.org/multipage/structured-data.html#dom-structuredclone)
+ Example
+
+
+
+
### new-less constructors (still functions / utilities)
TC39:
- [`Array`](https://tc39.es/ecma262/#sec-constructor-properties-of-the-global-object-array)
+ Example
See note[^reactive-array-note] about `(array)`, `@ember/helper`, and [RFC#1000](https://github.com/emberjs/rfcs/pull/1000)[^reactive-array-note]
- [Example](https://limber.glimdown.com/edit?c=DwFwpgtgDgNghuAfAKAATtQb0wYjHAYwAtUAKAcxgHsAjOGAFSIEsBnAOgEEAnbuAT1QBGVACZUAZgCUqOK1QAfZuAgKAvmrQZt2ZZA1b02APT5iB4MZWwEYFEA&format=gjs)
+ [Link](https://limber.glimdown.com/edit?c=DwFwpgtgDgNghuAfAKAATtQb0wYjHAYwAtUAKAcxgHsAjOGAFSIEsBnAOgEEAnbuAT1QBGVACZUAZgCUqOK1QAfZuAgKAvmrQZt2ZZA1b02APT5iB4MZWwEYFEA&format=gjs)
```gjs
@@ -378,20 +470,28 @@ TC39:
[^reactive-array-note]: This is the same behavior as `(array)` in loose mode, and `import { array } from '@ember/helper';`, however, while the creation of the array is reactive (e.g.: if we had said `(Array @foo @bar)`, changes to `@foo` and `@bar` would cause the creation of a new array instance), the proposed _built-in_ `(array)` _keyword_ behavior _may_ have reactive items, as proposed by [RFC#1068](https://github.com/emberjs/rfcs/pull/1068)
+
+
- [`BigInt`](https://tc39.es/ecma262/#sec-constructor-properties-of-the-global-object-bigint)
- [Example](https://limber.glimdown.com/edit?c=DwFwpgtgDgNghuAfAKAATtQb0wcxgewCM4YAVACwEsBnAOgCFKcBJAOxFQCIAGADwEYAZsJGiRnAL4TkwAPTho8JMiA&format=gjs)
+ Example
+
+ [Link](https://limber.glimdown.com/edit?c=DwFwpgtgDgNghuAfAKAATtQb0wcxgewCM4YAVACwEsBnAOgCFKcBJAOxFQCIAGADwEYAZsJGiRnAL4TkwAPTho8JMiA&format=gjs)
```gjs
{{BigInt "0x1fffffffffffff"}}
```
+
+
- [`Boolean`](https://tc39.es/ecma262/#sec-constructor-properties-of-the-global-object-boolean)
- [Example](https://limber.glimdown.com/edit?c=DwFwpgtgDgNghuAfAKAATtQb0wYgJYBmqAFAOYwD2ARnDACoAWeAzgHQBCFFMYcAdqgBEggJQBfMWgzoQAJwCuYKemxgYzMBOUYCtDduwB6QluCHw0eEmRA&format=gjs)
+ Example
+
+ [Link](https://limber.glimdown.com/edit?c=DwFwpgtgDgNghuAfAKAATtQb0wYgJYBmqAFAOYwD2ARnDACoAWeAzgHQBCFFMYcAdqgBEggJQBfMWgzoQAJwCuYKemxgYzMBOUYCtDduwB6QluCHw0eEmRA&format=gjs)
```gjs
{{#if (Boolean "")}}
@@ -402,44 +502,62 @@ TC39:
```
+
+
- [`Date`](https://tc39.es/ecma262/#sec-constructor-properties-of-the-global-object-date)
- [Example](https://limber.glimdown.com/edit?c=DwFwpgtgDgNghuAfAKAATtQb0wcxgewCM4YAVACwEsBnAOgBEExUBGAdgGY2AmAFg4AMAgKwBOPgF8JyYAHpw0eEmRA&format=gjs)
+ Example
+
+ [Link](https://limber.glimdown.com/edit?c=DwFwpgtgDgNghuAfAKAATtQb0wcxgewCM4YAVACwEsBnAOgBEExUBGAdgGY2AmAFg4AMAgKwBOPgF8JyYAHpw0eEmRA&format=gjs)
```gjs
{{Date 1737243005924}}
```
+
+
- [`Number`](https://tc39.es/ecma262/#sec-constructor-properties-of-the-global-object-number)
- [Example](https://limber.glimdown.com/edit?c=DwFwpgtgDgNghuAfAKAATtQb0wcxgewCM4YAVACwEsBnAOgDkBXCQsAJ1QCIAmbzgX37JgAenDR4SZEA&format=gjs)
+ Example
+
+ [Link](https://limber.glimdown.com/edit?c=DwFwpgtgDgNghuAfAKAATtQb0wcxgewCM4YAVACwEsBnAOgDkBXCQsAJ1QCIAmbzgX37JgAenDR4SZEA&format=gjs)
```gjs
{{Number "22"}}
```
+
+
- [`Object`](https://tc39.es/ecma262/#sec-constructor-properties-of-the-global-object-object)
- [Example](https://limber.glimdown.com/edit?c=DwFwpgtgDgNghuAfAKAATtQb0wYjHAYwAsBaASwDtUAKAcxgHsAjOGAFSLIGcA6AeSYArMARCo4AXgCMqJhIBMASnFdUAHwDWYAJ6oAbqwCuYNQF9TaDOmxbt5gFxZMBmMfOXrmAPT5i5Cu7AXuDQ8EjIQA&format=gjs)
+ Example
+
+ [Link](https://limber.glimdown.com/edit?c=DwFwpgtgDgNghuAfAKAATtQb0wYjHAYwAsBaASwDtUAKAcxgHsAjOGAFSLIGcA6AeSYArMARCo4AXgCMqJhIBMASnFdUAHwDWYAJ6oAbqwCuYNQF9TaDOmxbt5gFxZMBmMfOXrmAPT5i5Cu7AXuDQ8EjIQA&format=gjs)
```gjs
- {{#each-in (globalThis.Object a=1 b=2) as |key value|}}
+ {{#each-in (Object a=1 b=2) as |key value|}}
{{key}}: {{value}}
{{/each-in}}
```
+
+
- [`String`](https://tc39.es/ecma262/#sec-constructor-properties-of-the-global-object-string)
- [Example](https://limber.glimdown.com/edit?c=DwFwpgtgDgNghuAfAKAATtQb0wcxgewCM4YAVACwEsBnAOgGUQAnSgOx1QCZOBfH5YAHpw0eEmRA&format=gjs)
+ Example
+
+ [Link](https://limber.glimdown.com/edit?c=DwFwpgtgDgNghuAfAKAATtQb0wcxgewCM4YAVACwEsBnAOgGUQAnSgOx1QCZOBfH5YAHpw0eEmRA&format=gjs)
```gjs
- {{globalThis.String 22}}
+ {{String 22}}
```
+
+
### Values
TC39:
From c39eadc0e321552751bfa9689d16bdbed1919136 Mon Sep 17 00:00:00 2001
From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com>
Date: Sat, 18 Jan 2025 18:52:38 -0500
Subject: [PATCH 29/32] ya
---
text/1070-default-globals-for-strict-mode.md | 68 +++++++++++++++++++-
1 file changed, 66 insertions(+), 2 deletions(-)
diff --git a/text/1070-default-globals-for-strict-mode.md b/text/1070-default-globals-for-strict-mode.md
index 72d965ea83..44ceaf14b8 100644
--- a/text/1070-default-globals-for-strict-mode.md
+++ b/text/1070-default-globals-for-strict-mode.md
@@ -132,7 +132,7 @@ TC39:
[Link](https://limber.glimdown.com/edit?c=MYewdgzgLgBAJgQygmBeGBvGBzATgU3ygEsxsAuGAcgAt8AbekGKOggQipgF8BuAKH4AeKPgC2AB3pJ8APn4xMGbEwBGCegBUaxCADoAUgGUA8gDk90XKWzEAZgE94SBN27CA9KMnTRsoA&format=gjs)
```gjs
- {{globalThis.JSON.stringify @data}}
+ {{JSON.stringify @data}}
```
@@ -152,7 +152,7 @@ TC39:
Atomics.xor(uint8, 0, 2)
- {{globalThis.Atomics.load uint8}} === 5
+ {{Atomics.load uint8}} === 5
```
@@ -427,24 +427,55 @@ WHATWG:
Example
+ [Link](https://limber.glimdown.com/edit?c=DwFwpgtgDgNghuAfAKAATtQb0wcxgewCM4YAVACwEsBnAOgSNQCI4BxANWsNYA4BeJgF9ByYAHpw0eEmRA&format=gjs)
+
+ ```gjs
+
+ {{atob "aGVsbG8="}}
+
+ ```
+
- [`btoa`](https://html.spec.whatwg.org/multipage/webappapis.html#dom-atob)
Example
+ [Link](https://limber.glimdown.com/edit?c=DwFwpgtgDgNghuAfAKAATtQb0wcxgewCM4YAVACwEsBnAOkJHzlQCJywYCWBfb5YAPTho8JMiA&format=gjs)
+
+ ```gjs
+
+ {{btoa "hello"}}
+
+ ```
+
- [`postMessage`](https://html.spec.whatwg.org/multipage/web-messaging.html#dom-window-postmessage)
Example
+ ```gjs
+
+
+
+ ```
+
- [`structuredClone`](https://html.spec.whatwg.org/multipage/structured-data.html#dom-structuredclone)
Example
+ ```gjs
+
+
+
+ ```
+
+
@@ -563,12 +594,45 @@ TC39:
TC39:
- [`Infinity`](https://tc39.es/ecma262/#sec-value-properties-of-the-global-object-infinity)
+
+ Example
+
+ ```gjs
+
+ {{Infinity}}
+
+ ```
+
+
+
- [`NaN`](https://tc39.es/ecma262/#sec-value-properties-of-the-global-object-nan)
+ Example
+
+ ```gjs
+
+ {{NaN}}
+
+ ```
+
+
+
WHATWG:
- [`isSecureContext`](https://html.spec.whatwg.org/multipage/webappapis.html#dom-issecurecontext)
+ Example
+
+ ```gjs
+
+ {{#if isSecureContext}}
+ is secure
+ {{/if}}
+
+ ```
+
+
+
### Potentially matching criteria, but not included
From 28050c093b932cb4b2e56fc293703cf6c4078161 Mon Sep 17 00:00:00 2001
From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com>
Date: Thu, 13 Feb 2025 16:14:49 -0500
Subject: [PATCH 30/32] Do not allow global single-word all lowercase apis as
befault
---
text/1070-default-globals-for-strict-mode.md | 145 ++++++++++---------
1 file changed, 76 insertions(+), 69 deletions(-)
diff --git a/text/1070-default-globals-for-strict-mode.md b/text/1070-default-globals-for-strict-mode.md
index 44ceaf14b8..b405da484b 100644
--- a/text/1070-default-globals-for-strict-mode.md
+++ b/text/1070-default-globals-for-strict-mode.md
@@ -106,6 +106,7 @@ Any of
And
- must not need `new` to invoke
- must not require lifetime management (e.g.: `setTimeout`)
+- must not be a single-word lower-case API, because of potential collision with future [new HTML elements](https://developer.mozilla.org/en-US/docs/Web/HTML/Element)
- if the API is a function, the return value should not be a promise
- must be one one of these lists:
- https://tc39.es/ecma262/#sec-global-object
@@ -202,74 +203,6 @@ TC39:
WHATWG:
-- [`location`](https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-location)
-
- Example
-
- [Link](https://limber.glimdown.com/edit?c=FAHgLgpgtgDgNgQ0gPmAAjQb0wczgewCME4AVACwEsBnAOgIGMlL8A7W8gJwgDM0BffqAD0kWIhRA&format=gjs)
- ```gjs
-
- {{location.href }}
-
- ```
-
-
-
-- [`history`](https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-history)
-
- Example
-
- Example[^glimmer-call-bug]
- ```gjs
- import { on } from '@ember/modifier';
-
-
-
-
- ```
- [^glimmer-call-bug]: demo/example omitted because the glimmer-vm, at the time of the writing of this RFC has not fixed a bug that where this-binding is lost on method calls.
-
-
-
-- [`navigator`](https://html.spec.whatwg.org/multipage/system-state.html#dom-navigator)
-
- Example
-
- [Link](https://limber.glimdown.com/edit?c=FAHgLgpgtgDgNgQ0gPmAAjQb0wczgewCME4AVACwEsBnAOgDsEA3SnJfAJ1oFdqIOAgjgj0wAXzGgA9JFiIUQA&format=gjs)
- ```gjs
-
- {{navigator.userAgent}}
-
-
-
- ```
-
-
-
-- [`window`](https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-window)
-
- Most APIs are also available on `window`
-
-- [`document`](https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-document-2)
-
- Example
-
- Example[^glimmer-call-bug]
- ```gjs
-
-
-
- {{#in-element (document.getElementById 'foo')}}
- rendered elsewhere
- {{/in-element}}
-
- ```
-
-
-
-
- [`localStorage`](https://html.spec.whatwg.org/multipage/webstorage.html#the-localstorage-attribute)
Example
@@ -673,9 +606,83 @@ If we don't already, we should have an extensive guide on Polish Syntax, potenti
Takes a small amount of work to implement.
+
## Alternatives
-Do nothing, but this is worse, as folks intuitively expect these a lot of the above-mentioned APIs to "just work", without needing weird scope-tricks to convince our Scope-tracking tools in the build tools that certain APIs are in scope..
+- Do nothing, but this is worse, as folks intuitively expect these a lot of the above-mentioned APIs to "just work", without needing weird scope-tricks to convince our Scope-tracking tools in the build tools that certain APIs are in scope..
+
+- Add some single-word globals, despite the risk of HTML element being implemented with the same word / casing
+
+
+- [`location`](https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-location)
+
+ Example
+
+ [Link](https://limber.glimdown.com/edit?c=FAHgLgpgtgDgNgQ0gPmAAjQb0wczgewCME4AVACwEsBnAOgIGMlL8A7W8gJwgDM0BffqAD0kWIhRA&format=gjs)
+ ```gjs
+
+ {{location.href }}
+
+ ```
+
+
+
+- [`history`](https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-history)
+
+ Example
+
+ Example[^glimmer-call-bug]
+ ```gjs
+ import { on } from '@ember/modifier';
+
+
+
+
+ ```
+ [^glimmer-call-bug]: demo/example omitted because the glimmer-vm, at the time of the writing of this RFC has not fixed a bug that where this-binding is lost on method calls.
+
+
+
+- [`navigator`](https://html.spec.whatwg.org/multipage/system-state.html#dom-navigator)
+
+ Example
+
+ [Link](https://limber.glimdown.com/edit?c=FAHgLgpgtgDgNgQ0gPmAAjQb0wczgewCME4AVACwEsBnAOgDsEA3SnJfAJ1oFdqIOAgjgj0wAXzGgA9JFiIUQA&format=gjs)
+ ```gjs
+
+ {{navigator.userAgent}}
+
+
+
+ ```
+
+
+
+- [`window`](https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-window)
+
+ Most APIs are also available on `window`
+
+- [`document`](https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-document-2)
+
+ Example
+
+ Example[^glimmer-call-bug]
+ ```gjs
+
+
+
+ {{#in-element (document.getElementById 'foo')}}
+ rendered elsewhere
+ {{/in-element}}
+
+ ```
+
+
+
+
+
## Unresolved questions
From 635e2360773a40914760220556042aa7254136e7 Mon Sep 17 00:00:00 2001
From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com>
Date: Thu, 13 Feb 2025 16:16:03 -0500
Subject: [PATCH 31/32] Also move atob and btoa out
---
text/1070-default-globals-for-strict-mode.md | 58 ++++++++++----------
1 file changed, 30 insertions(+), 28 deletions(-)
diff --git a/text/1070-default-globals-for-strict-mode.md b/text/1070-default-globals-for-strict-mode.md
index b405da484b..31fd9dc4d3 100644
--- a/text/1070-default-globals-for-strict-mode.md
+++ b/text/1070-default-globals-for-strict-mode.md
@@ -356,34 +356,6 @@ TC39:
WHATWG:
-- [`atob`](https://html.spec.whatwg.org/multipage/webappapis.html#dom-btoa)
-
- Example
-
- [Link](https://limber.glimdown.com/edit?c=DwFwpgtgDgNghuAfAKAATtQb0wcxgewCM4YAVACwEsBnAOgSNQCI4BxANWsNYA4BeJgF9ByYAHpw0eEmRA&format=gjs)
-
- ```gjs
-
- {{atob "aGVsbG8="}}
-
- ```
-
-
-
-- [`btoa`](https://html.spec.whatwg.org/multipage/webappapis.html#dom-atob)
-
- Example
-
- [Link](https://limber.glimdown.com/edit?c=DwFwpgtgDgNghuAfAKAATtQb0wcxgewCM4YAVACwEsBnAOkJHzlQCJywYCWBfb5YAPTho8JMiA&format=gjs)
-
- ```gjs
-
- {{btoa "hello"}}
-
- ```
-
-
-
- [`postMessage`](https://html.spec.whatwg.org/multipage/web-messaging.html#dom-window-postmessage)
Example
@@ -613,6 +585,36 @@ Takes a small amount of work to implement.
- Add some single-word globals, despite the risk of HTML element being implemented with the same word / casing
+WHATWG:
+
+- [`atob`](https://html.spec.whatwg.org/multipage/webappapis.html#dom-btoa)
+
+ Example
+
+ [Link](https://limber.glimdown.com/edit?c=DwFwpgtgDgNghuAfAKAATtQb0wcxgewCM4YAVACwEsBnAOgSNQCI4BxANWsNYA4BeJgF9ByYAHpw0eEmRA&format=gjs)
+
+ ```gjs
+
+ {{atob "aGVsbG8="}}
+
+ ```
+
+
+
+- [`btoa`](https://html.spec.whatwg.org/multipage/webappapis.html#dom-atob)
+
+ Example
+
+ [Link](https://limber.glimdown.com/edit?c=DwFwpgtgDgNghuAfAKAATtQb0wcxgewCM4YAVACwEsBnAOkJHzlQCJywYCWBfb5YAPTho8JMiA&format=gjs)
+
+ ```gjs
+
+ {{btoa "hello"}}
+
+ ```
+
+
+
- [`location`](https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-location)
From d00ed95c991611679b80324acfaea470ceb575b0 Mon Sep 17 00:00:00 2001
From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com>
Date: Thu, 13 Feb 2025 16:19:45 -0500
Subject: [PATCH 32/32] Also move atob and btoa out
---
text/1070-default-globals-for-strict-mode.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/text/1070-default-globals-for-strict-mode.md b/text/1070-default-globals-for-strict-mode.md
index 31fd9dc4d3..8700a26b76 100644
--- a/text/1070-default-globals-for-strict-mode.md
+++ b/text/1070-default-globals-for-strict-mode.md
@@ -583,7 +583,7 @@ Takes a small amount of work to implement.
- Do nothing, but this is worse, as folks intuitively expect these a lot of the above-mentioned APIs to "just work", without needing weird scope-tricks to convince our Scope-tracking tools in the build tools that certain APIs are in scope..
-- Add some single-word globals, despite the risk of HTML element being implemented with the same word / casing
+- Add some single-word globals, despite the potential future risk of HTML element being implemented with the same word / casing
WHATWG: